-
-
Notifications
You must be signed in to change notification settings - Fork 122
Description
QVH is a rock solid tool, except for the flaky gstreamer integration.
I can see two options to improve this:
- Integrate with ffmpeg
- Implement the mkv container format and export a stream via tcp so any media framework can be integrated easily
Some pointers:
We get a series of CMSampleBuf objects from the device (https://github.com/danielpaulus/quicktime_video_hack/blob/main/screencapture/coremedia/cmsamplebuf.go) which I decoded to a Golang struct. Those contain either raw h264 NaLus or PCM audio. Sometimes with a format descriptor that contains PPS Nalus needed to start a stream.
To understand how to work with this, look at the current implementations of CmSampleBufConsumer (
| type CmSampleBufConsumer interface { |
func (avfw AVFileWriter) Consume(buf CMSampleBuffer) error { func (gsta *GstAdapter) Consume(buf coremedia.CMSampleBuffer) error {
To solve this, we either need a MKVConsumer, that receives the above CMSampleBufs and turns them into an MKV stream or a FFMPEGConsumer that can use FFMPEG directly somehow to turn CMSampleBufs into a useful format.
If we have an MKVConsumer, we/me can hook it up easily to a local tCP server like f.ex. here: screencapture/gstadapter/tcp_server_adapter.go and stream it really fast to ffmpeg or gstreamer running in external processes which make everything much more stable.