[FFmpeg-devel] H.264: passing 2 fields at once to avcodec_decode_video() gives errors

Michael Niedermayer michaelni
Wed Apr 8 15:57:19 CEST 2009

On Wed, Apr 08, 2009 at 08:45:48AM +0200, Ivan Schreter wrote:
> Hi,
> Reinhard Nissl wrote:
>> Hi,
>> once again, I have some trouble using ffmpeg through xine-lib.
>> When I pass field data in separate calls to
>> avcodec_decode_video(), everything is fine. Some debug output shows:
>> [...]
>> When I pass almost (see below for details) the same data from
>> above of two fields in a single call to avcodec_decode_video(),
>> the output looks like that:
>> [...]
>> I wonder why I get a totally different behavior in the second
>> case. As I only get a picture after passing two fields of the
>> picture I do not see why it shouldn't work to pass both fields
>> into a single call. And I don't think that the 0 byte issue
>> matters as it yields the same NAL lengths.
> If I understand you correctly, you are trying to stuff two H.264 field 
> pictures in one buffer and pass it to the decoder.
> AFAIK, H.264 still decoder doesn't support handling more than one picture 
> (field or frame) in one call, 

yes, and a patch fixing this is welcome

> as it doesn't process NAL AUD properly. 

sorry, you are confused, AUD dont come into this anywhere
also our parser is well able to split things and does not depend on AUD

> Furthermore, NAL AUD might be missing completely,

yes, any patch that depends on AUD will not even be reviewed but immedeatly


> Effectively, you'd need to build a loop around the code in decoder 
> function, detect the AUD (including the implicit ones), terminate NAL 
> processing upon detecting the AUD, let the rest of the decoder function run 
> and then restart processing with the remainder of the buffer.

move the few lines of code that are executed after the loop&field into it
under appropriate if()

Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The greatest way to live with honor in this world is to be what we pretend
to be. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090408/9c42ed30/attachment.pgp>

More information about the ffmpeg-devel mailing list