[FFmpeg-devel] [PATCH] matroskaenc.c DefaultDuration wrong value on stream copy

Martin Tessarek mt
Tue Jan 11 21:52:43 CET 2011


on a stream copy with e.g.
ffmpeg -i input -vcodec copy output.mkv
the MATROSKA_ID_TRACKDEFAULTDURATION is set incorrectly to 1000, which some players or DLNA server interpret as 1000 FPS and then refuse to play the MKV.

here my proposed patch:

--- matroskaenc.c	2010-11-23 09:24:41.000000000 +0100
+++ matroskaenc.c	2011-01-11 21:31:41.000000000 +0100
@@ -580,7 +580,8 @@
         switch (codec->codec_type) {
             case AVMEDIA_TYPE_VIDEO:
                 put_ebml_uint(pb, MATROSKA_ID_TRACKTYPE, MATROSKA_TRACK_TYPE_VIDEO);
-                put_ebml_uint(pb, MATROSKA_ID_TRACKDEFAULTDURATION, av_q2d(codec->time_base)*1E9);
+                if(!st->stream_copy)
+                    put_ebml_uint(pb, MATROSKA_ID_TRACKDEFAULTDURATION, av_q2d(codec->time_base)*1E9);
 
                 if (!native_id &&
                       ff_codec_get_tag(codec_movvideo_tags, codec->codec_id) &&




More information about the ffmpeg-devel mailing list