[FFmpeg-devel] m1v support in ffmpeg libavformat/mov.c

Gordon McCreight ffmpeg.to.gordon
Wed Aug 20 01:56:06 CEST 2008

  I have found a type of QuickTime video which works in QuickTime
player application, but not in ffmpeg.  It appears that the QuickTime
player application thinks it's acceptable to wrap an MPEG1 stream in a
.mov file, but there's not support for that in the libavformat/mov.c

I have an example file, and have made some changes to the
libavformat/mov.c source to allow for the processing of the file.  The
file now processes, however, the stream codec framerate differs
significantly from the container framerate, so the output video
appears very short.  I'm afraid that my skills aren't quite up to
snuff, and after a few hours of trying different things, I'm deciding
to cry "uncle" and to pass the issue along.

Cheers - Gordon


Example file:

% svn diff libavformat/mov.c
Index: libavformat/mov.c
--- libavformat/mov.c   (revision 14856)
+++ libavformat/mov.c   (working copy)
@@ -323,6 +323,8 @@
        st->codec->codec_type = CODEC_TYPE_AUDIO;
    else if(type == MKTAG('m','1','a',' '))
        st->codec->codec_id = CODEC_ID_MP2;
+    else if(type == MKTAG('m','1','v',' '))
+        st->codec->codec_id = CODEC_ID_MPEG1VIDEO;
    else if(type == MKTAG('s','u','b','p')) {
        st->codec->codec_type = CODEC_TYPE_SUBTITLE;
@@ -995,6 +997,9 @@
        st->codec->sample_rate= 8000;
        st->codec->channels= 1; /* really needed */
+        st->codec->codec_type = CODEC_TYPE_VIDEO;
+        break;
    case CODEC_ID_MP2:
    case CODEC_ID_MP3:
        st->codec->codec_type = CODEC_TYPE_AUDIO; /* force type after
stsd for m1a hdlr */

More information about the ffmpeg-devel mailing list