[FFmpeg-devel] Video encoding using compiling ffmpeg.c

Ik Seong Bae ikseong.bae
Wed Feb 13 08:57:05 CET 2008


Hi. I have question of video encoding using ffmpeg.

source video size is 640 x 480.
target video size is same.


During debugging video encoding in ffmpeg.c, I have found the bug(?) in
avcodec_encode_video().

In ffmpeg.c,

            AVFrame big_picture;    // source video frame
            AVCodecContext *enc; // target video struture

            ret = avcodec_encode_video(enc,                           //
target (?)
                                       bit_buffer,
bit_buffer_size,           // target

&big_picture);                           // source

  After ffmpeg.c call the avcodec_encode_video(), informations of "enc" are
different to "big_picture"

    before :
       big_picture->linesize[0] = 640;
       big_picture->linesize[1] = 320;
       big_picture->linesize[2] = 320;

       big_picutre->data[0] : 640 x 480 size    // Y data

   after :
      enc->coded_frame->linesize[0] = 672;
      enc->coded_frame->linesize[1] = 336;
      enc->coded_frame->linesize[2] = 336;

      enc->coded_frame->data[0] : 672 x 480   // Y data

   And the pixel values between big_picture and enc are a litte different.

  I saved the raw video frames.
  source frame(640x480) link is big_picture
frame<http://bp3.blogger.com/_kp8Z6g3l0nc/R7KgLafyKaI/AAAAAAAAABs/zOheSltdHKQ/s1600-h/big_picture.JPG>
  target frame(672x480)t link is enc
frame<http://bp0.blogger.com/_kp8Z6g3l0nc/R7KgRqfyKbI/AAAAAAAAAB0/bPPm4eLiQKo/s1600-h/enc.JPG>
.

  In fflplay, encoded video is good played  .. displayed size is 640 x 480.

 Has enc->coded_frame->data[0] buffer reduant buffer (32 byte per one line)
?

 Help me..

Best regrads

Bae




More information about the ffmpeg-devel mailing list