[Libav-user] Applied pad on the decoded frame

Francesco Damato francesco.damato7 at gmail.com
Tue Oct 15 00:49:14 CEST 2013

Hi Dolevo Jay,

i have a quastion for you: also i am writing a C program that use h264 to
encode video read from file.

I saw the example decoding_encoding.c that generates a video from dummy
pictures... but how do I replace this part and read and encode my video?

Can you help me, there are other examples or books available?


2013/10/14 Dolevo Jay <cmst at live.com>

> Hi all,
> I have encoder and decoder application in separate projects. I use x264 to
> encode the incoming frames and use libav to decode them. If the frame has a
> specific resolution like 1366 x 768, the decode frame contains extra black
> border at the right side of the frame. I have debugged it and realized that
> the av_pic.linesize[0] is 50 more than the linesize during the encoding.
> Here is the code:
>            lengthDec = avcodec_decode_video2(c1, av_pic, &pic, &pkt);
>     if (pic)
>        {
>        avpicture_fill((AVPicture *)rgbFrame, RGBimg, PIX_FMT_RGB32, w, h);
>        sws_scale(ctx, av_pic->data, av_pic->linesize, 0, h, rgbFrame->data, rgbFrame->linesize);
>        }
> So, in this code, I decode the packet and convert the decoded data into the rgb.
> Why does the avcodec_decode_video2 returns a padded linesize?
> Could anyone tell me how I can eliminate the black border?
> Thanks.
> _______________________________________________
> Libav-user mailing list
> Libav-user at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/libav-user

Francesco Damato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://ffmpeg.org/pipermail/libav-user/attachments/20131015/1ad06bcb/attachment.html>

More information about the Libav-user mailing list