[FFmpeg-devel] MKV Header: Writing duration early

Soft Works softworkz at hotmail.com
Tue Jul 12 11:11:21 EEST 2016


Hi,

we are using ffmpeg to transcode or remux mkv to mkv. The result is being streamed on-the-fly to an HTML5 client (streaming starts while ffmpeg is still running).

The problem here is that the client is unable to detect the duration because the duration is only written to the mkv at the end of the transcoding/remoxing process. I tracked this down in the source code and found that in matroskaenc.c, the duration is only written during mkv_write_trailer but not during mkv_write_header.


Now I'm wondering if this could be fixed by early writing the duration in mkv_write_header if a duration is available at this time (usually taken from the source stream)?


Thanks for any help,


softworkz



More information about the ffmpeg-devel mailing list