[Ffmpeg-devel] Problem with avcodec_decode_video on an Intel Mac

ffmartin at mh1.de ffmartin
Tue Jan 17 15:32:15 CET 2006


I have a problem. Maybe a rather special one. But maybe it
has something to do with the latest changes to the ffmpeg
project. I checkout a current version of ffmpeg. I compiled it
with MacOS X on a PowerPC and on a IntelMac. I had to
deactivate mmx on the IntelMac, but that is not my problem.
I have some code in which I use the MPEG4 codec libavcodec.
This code works fine on a PowerPC, even with the current cvs
version. Now, I ran the same code compiled on an IntelMac
and it only gives me a green picture (the buffer of the yuv420
picture is completly zero). I tried debugging and I check for
endian issues, but I can find any problem in my code. The
values in the AVCodecContext seem to be fine. Here is a
snipped of my code:

AVCodec* mpeg4_dec = avcodec_find_decoder
AVCodecContext* ivcc = avcodec_alloc_context();

ivcc->width = ...;
ivcc->height = ...;

if (avcodec_open(ivcc, mpeg4_dec) < 0) {

AVFrame* frame = avcodec_alloc_frame();
AVFrame* yuv_frame = avcodec_alloc_frame();

while(...) {
   avcodec_decode_video(ivcc, frame, &got_picture,
es_buffer, buf_size);

   // frame is completely zero here

   if (got_picture) {

      // assume w = width and h = height

      avpicture_fill((AVPicture *)yuv_frame, some_buffer ,
ivcc->pix_fmt, w, h);
      img_copy((AVPicture*)yuv_frame, (AVPicture*)
frame,ivcc->pix_fmt, w, h);

      // color conversion

That's pretty much everything I do and it worked fine ever.
Does anyone have a clue? The thing is, the ffmpeg command
line tool, works fine on the InterlMac. So my guess is, that I
missed some option. Maybe somewhere in the
AVCodecContext. libavcodec does not send any errors and
the return value of avcodec_decode_video is always correct.
Seems kind of weird to me.

I appreciate your efforts. Thank you.


More information about the ffmpeg-devel mailing list