[FFmpeg-devel] mpeg4 frames decode

Artem Korneev tema
Wed Aug 15 17:37:22 CEST 2007


> try to dump all packets to a file, try to play them with ffmpeg -f m4v
> if it fails the problem is in the data (likely missing headers or such)

One more strange thing I saw when I increase debug information from my  
program.

I have these lines in the code
--------------------
len = avcodec_decode_video( data.inCtx, data.inPicture, &got_picture,  
inbuf, inbuf_size);
if (got_picture) {
     LOG("got_picture true,  len: %i", len);
} else {
     LOG("got_picture false, len: %i", len);
}
--------------------

And now I have log file like that:

got_picture false, len: 4996
got_picture true,  len: 0
got_picture false, len: 170
got_picture true,  len: 0
got_picture false, len: 419
got_picture true,  len: 0
got_picture false, len: 1339
got_picture true,  len: 0
got_picture false, len: 857
got_picture true,  len: 0
got_picture false, len: 5006
got_picture true,  len: 0
got_picture false, len: 951
got_picture true,  len: 0
got_picture false, len: 841
got_picture true,  len: 0
got_picture false, len: 1057
got_picture true,  len: 0
got_picture false, len: 756
got_picture true,  len: 0

Looks very strange for me. :( It's mean, when avcodec_decode_video returns  
something (not zero) got_picture variable is false. But when got_picture  
is true, avcodec_decode_video always returns 0. Is it ok?

As I understand, buffer on every iteration contain full frame (some frames  
are key frames, enother - not), but decoder return false on every frame  
until the next frame will received.

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/




More information about the ffmpeg-devel mailing list