Search code examples
videoffmpegvideo-streaminghtml5-videolibav

libav / FFMPEG streaming in one encoding, saving as another


I'm using libav on an embedded device. After some effort, I got a fragmented MPEG4 livestream going with it. I am very happy with this now.

What I'd like to do now is have two outputs from the same input. The first output is what I currently have, which is a web-quality video (lossy @ video rate) being processed in a callback and streamed somewhere. The second output should be a lossless video saved to a file at a much higher framerate.

I know I can produce the second output independently, but is there a clever way for libav to do these together? Or do I just do them both independently?


Solution

  • Based on the question it looks like you would use the "Copy" filter.

    So this may be done at the command line when using ffmpeg, or in code using libavfilter.

    Here is the documentation on the Copy Filter:

    https://ffmpeg.org/ffmpeg-filters.html#copy