JuliaIO / VideoIO.jl

Reading and writing of video files in Julia via ffmpeg
https://juliaio.github.io/VideoIO.jl/stable
Other
126 stars 53 forks source link

Should we be using AVOutputFormat? #274

Closed galenlynch closed 3 years ago

galenlynch commented 3 years ago

Right now encoding is done by manually writing a temporary MPEG-2 elementary stream, and then using the ffmpeg binary to mux it into a mpeg-4 container. As #271 shows, it's hard to write video streams correctly by hand. It seems like the more recent encoding examples in FFMPEG use AVOutputFormat to write files. While the fix for #271 seems simple, perhaps a better fix would be to lean on the FFMPEG library more, and not try to write our own files. This obviously opens up the (real) potential for mis-configuring the AVOutputFormat, and perhaps it is better to just rely on the ffmpeg binary and its sensible defaults to do the heavy lifting of writing the resulting file. I'm just worried that there may be other errors with the way we are writing the MPEG-2 stream by hand.

I'm genuinely not sure which would be a better strategy.