I have found the problem: I modified the apixexample.c from libavcodec,
and left the following piece of code:
/* some codecs, such as MPEG, transmit the I and P frame with a
latency of one frame. You must do the following to have a
chance to get the last frame of the video */
len = avcodec_decode_video(c, picture, &got_picture,
NULL, 0);
which, obviously, must be performed just once, whenever the strams
finished (and not, as I do, for EVERY frame I encode/decode)
regards,
Gabriel
Gabriel Huecas wrote:
A minor clarification: the message is produced by my program, ffmpeg
did not report any warning or error message.
Gabriel
Gabriel Huecas wrote:
Dear colleagues,
I need a bit of help with an issue about MPEG-1 decoder. I have been
searching through google and forums, but I cannot find an answer.
I've been using ffmpeg for video codecs long time ago, and now I am
facing a problem that arosen on 2008, in the review -r11411.
This was a small change, autor name reported as Michael:
----
r11411 | michael | 2008-01-05 02:14:09 +0100 (Sat, 05 Jan 2008) | 2
lines
Drop non key frames before the first key frame.
----
My program performs a small test: take frames from a v4l device,
encode them, decode them and draw them. I do not set most of the
options of ffmpeg, just bit rate, width, hight, gop_size, ... It
works perfectly well for MPEG-4, and it worked for MPEG-1 up to
review 11410.
However, the changes from 11410 to 11411 seems very small, file
mpeg12.c [enclosed below the output of svn diff]
I got the following message:
[2010/05/19 18:30:32] bad decoded image!!, Bailing out
repeatedly, and from time to time some frames are correctly decoded
(and painted).
Could you please help me to understand what is happening? Should I
need to set any other options so MPEG-1 is properly decode?
BTW, I have been able to send the MPEG-1 over RTP and I have not seen
problems in the MPEG-1 encoder (I mean, if I encode MPEG-1 with any
version of ffmpeg, it is properly decode with version <= 11410, and
worngly decode with version >= 11411)
I hope someone can help me, as I cannot find a clue about the problem,
Thank you very much,
Gabriel Huecas
$ svn diff -r 11410
Index: libavcodec/mpeg12.c
===================================================================
--- libavcodec/mpeg12.c (revision 11410)
+++ libavcodec/mpeg12.c (working copy)
@@ -2329,8 +2329,10 @@
if(s2->last_picture_ptr==NULL){
/* Skip B-frames if we do not have reference frames. */
if(s2->pict_type==B_TYPE) break;
+ }
+ if(s2->next_picture_ptr==NULL){
/* Skip P-frames if we do not have reference frame no
valid header. */
-// if(s2->pict_type==P_TYPE && s2->first_field &&
!s2->first_slice) break;
+ if(s2->pict_type==P_TYPE && (s2->first_field ||
s2->picture_structure==PICT_FRAME)) break;
}
/* Skip B-frames if we are in a hurry. */
if(avctx->hurry_up && s2->pict_type==B_TYPE) break;
svn diff, from 11411:
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user