[FFmpeg-devel] [HACK] mov.c: Handle MPEG-in-MOV (#241 and friends)

Petter Ericson petter.ericson at codemill.se
Tue Oct 16 21:33:24 CEST 2012


On Tue, Oct 16, 2012 at 06:43:50PM +0200, Hendrik Leppkes wrote:
> On Tue, Oct 16, 2012 at 5:18 PM, Petter Ericson
> <petter.ericson at codemill.se> wrote:
> > Greetings,
> >
> > Attached is a patch that handles the files provided in #241 and duplicates.
> > Needless to say, it is extremely hacky and would benefit from improvements,
> > but as it stands, it checks for the two places I have found the m1s tag, and
> > forces continued probing until mpegps_probe gets enough data to find its
> > own header. I considered using the mpegps demuxer as a "subprocess" simliar
> > to how DVDemuxer is used, but this proved to be too much trouble for me,
> > given that it really isn't made to work in that way, and the above
> > approach got the desired result.
> >
> > Improvements (rudimentary MOV parsing in the probe?) very welcome.
> >
> 
> The fixed offset of the tag in the file seems rather arbitrary to me.
> Did you confirm on multiple samples that its in that exact spot every
> time?

I checked two - my own sample and the one in the original ticket. They both
had the first offset (0x21E). A different duplicate (#600 something) had the
smaller offset due to missing the initial ftyp section before the moov atom.

I agree that something better should be found - a fixed offset from the
moov atom could probably work better, but that again takes us into 
rudimentary parsing territory. One might refactor the switch/case to use
score = MAX(returnvalue, score) or something like that, which would at least
allow slightly more flexibility - I'll cook something up tomorrow and
resubmit unless someone gets there before me.

/P

> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


More information about the ffmpeg-devel mailing list