GNOME Bugzilla – Bug 574661
[gstffmpegdec] Wrong usage of parsers
Last modified: 2012-08-27 21:06:44 UTC
Our usage of parsers is completely wrong. We currently assume that if there's a parser for a given codec we should use it, whereas there's no guarantee that it's the appropriate parser to use for the given stream. To figure out whether a parser is needed or not, we should actually probe the incoming stream mimicing the parsing being done in libavformat. As such, I'd like to *NOT* use the parsers for the following codecs (tested against many files, removes errors and introduces no regressions so far): * mpeg2video * aac
I would actually suggest to use the parser for aac. The aacparse has a seeking issue which rene is currently fixing/has fixed. One advantage of the aacparse is that one gets much quicker sane durations for vbr streams (over just using faad). Also it would be nice to explain what "probe the incoming stream mimicing the parsing being done in libavformat" actually means.
I was of course talking about AVParser (and not the -bad aacparse). As for the probing part, there is some code in libavformat (the demuxer/muxer part of ffmpeg) which is used by ffmpeg demuxers to figure out whether they need a parser for a given AVStream. This is how they figure out: * If a parser is needed for the given stream * Which parser is needed
Bumping target milestone to next release, we're too close to the release to grasp all the implications.
Bumping the target milestone even further... this clearly isn't making it into 0.10.8
Should we bump this again?
...and maybe again? :)
and maybe again indeed... *sigh*
And again
I did some grepping on the ffmpeg code. The code to initialize the parser (av_parser_init) is only called from 2 places, one for removing extra codecdata and the gst-libs/ext/ffmpeg/libavformat/utils.c. The utils.c functions are: av_find_stream_info() av_read_frame_internal() The first function is to setup all the streams. The way it works is that it iterates over all codec_ids and tries to create a parser. If this succeeds, it uses the parser. This is what we currently do. The second function basically does the same but also takes new dynamic streams into account. I did some more grepping to see who does the actual calls to av_parser_parse* and again the only callers are in gst-libs/ext/ffmpeg/libavformat/utils.c. Maybe I'm wrong in assuming that ffplay is doing the right thing?
Bumping to next release
We no longer use video parsers in latest code (0.10 and master). Shall we just close this ?
Let's.