[FFmpeg-cvslog] r11621 - trunk/libavformat/mov.c

Reimar Döffinger Reimar.Doeffinger
Mon Jan 28 12:18:36 CET 2008


Hello,
On Sun, Jan 27, 2008 at 03:38:24PM +0100, Baptiste Coudurier wrote:
> michael wrote:
> > Author: michael
> > Date: Sat Jan 26 20:50:04 2008
> > New Revision: 11621
> > 
> > Log:
> > Select non jpeg if there are multiple substreams.
> > 
> > 
> > Modified:
> >    trunk/libavformat/mov.c
> > 
> > Modified: trunk/libavformat/mov.c
> > ==============================================================================
> > --- trunk/libavformat/mov.c	(original)
> > +++ trunk/libavformat/mov.c	Sat Jan 26 20:50:04 2008
> > @@ -600,8 +600,10 @@ static int mov_read_stsd(MOVContext *c, 
> >          get_be16(pb); /* reserved */
> >          get_be16(pb); /* index */
> >  
> > -        if (st->codec->codec_tag) {
> > -            /* multiple fourcc, just skip for now */
> > +        if (st->codec->codec_tag && st->codec->codec_tag != MKTAG('j', 'p', 'e', 'g')) {
> > +            /* multiple fourcc, we skip jpeg, this isnt correct, we should export it as
> > +               seperate AVStream but this needs a few changes in the mov demuxer, patch
> > +               welcome */
> >              url_fskip(pb, size - (url_ftell(pb) - start_pos));
> >              continue;
> >          }
> 
> This is hackish, and Im against it. You will have to add all image types
> (png and so on). The proper solution must be implemented, and adding
> hacks won't help.

May I suggest a different hack? It is ugly, but it would allow an
application that does enough of an effort to recover the original data
almost full, though it will not fix stream copy.
The idea would be to just have not only one codec id, but also an array
with additional ids.
The application could then: try decoding and when decoding fails try the
other decoders until it find one that works (note: breaks if the switch
is between formats that do not cause decoding errors like rgb/bgr).
Or it could export one video stream for each codec (with parts in the
other codec playing as crap).
Yes, this is a hackish solution, but I think it could be done quickly
and is sufficient for most cases.
A further extension to this would be that in addition to the codec_id
array we would have another array where the application can codec ids
for which the data should be discarded by the demuxer, this should even
allow for mostly working stream copy.

Greetings,
Reimar D?ffinger




More information about the ffmpeg-cvslog mailing list