Thx for your help. I'm a newbie in libav. Can you show me an example, or even this informations on pastebin?
This configurations are made in the frame struct, before the sws_scale call. Is this right? Does des_stride420p refer to frame->linesize array? Or I need to create a separated array struct (des_stride420p) for this process? Because I tried to store those informations on dstFrame->linesize, but the result was the same. What I understood is: each number in frame->linesize says the size of the corresponding array in frame->data. So in yuv420p frame->data[0] is the Y component, frame->data[1] is the U and frame->data[2] is the V component. Thx for your help, but I really need more explanations or even (and better) a code example. Because I couldn't find any examples in google using ffmpeg. (And sorry for my English. I'm Brazilian and English isn't my native language :-)) 2011/1/18 Glen Ruedinger <[email protected]> > On Tue, Jan 18, 2011 at 7:54 AM, Leandro Santiago < > [email protected] > > wrote: > > > Hello to all. > > I'm using libav to get images from my webcam. > > > > The resolution of the device is 640x480px. > > > > When I generate the video in this resolution, the video frames are ok. > The > > same happens when I scale the frame to a larger size (1024x768, etc.). > > > > But if I scale the frames to smaller sizes like 160x120 or 320x240, the > > resulting frames have green bands on the image bottom. > > > > The original frame size is 640x480: > > http://dl.dropbox.com/u/3550969/cap640x480.png > > > > The frame in 1024x768: > > http://dl.dropbox.com/u/3550969/cap1024.png > > > > And finally, the frame in smaller resolutions: > > 160x120: > > http://dl.dropbox.com/u/3550969/cap160x120.png > > > > 400x300: > > http://dl.dropbox.com/u/3550969/cap300x400.png > > > > And the code I'm using is in: > > http://ffmpeg.pastebin.com/ri1QxTB7 > > > > FFMPEG Version; > > > > Fmpeg version git-svn-r25853, Copyright (c) 2000-2010 the FFmpeg > developers > > built on Nov 30 2010 16:13:52 with gcc 4.4.5 > > configuration: --disable-gpl --enable-static --enable-libvpx > > --enable-pthreads --disable-stripping --enable-libschroedinger > > --enable-libtheora --prefix=/home/tenchi/projects/3rd/build/ > > libavutil 50.33. 0 / 50.33. 0 > > libavcore 0.14. 0 / 0.14. 0 > > libavcodec 52.97. 2 / 52.97. 2 > > libavformat 52.87. 1 / 52.87. 1 > > libavdevice 52. 2. 2 / 52. 2. 2 > > libavfilter 1.65. 0 / 1.65. 0 > > libswscale 0.12. 0 / 0.12. 0 > > > > Why do this happen? How can I scale a frame to a smaller size? > > _______________________________________________ > > libav-user mailing list > > [email protected] > > https://lists.mplayerhq.hu/mailman/listinfo/libav-user > > > > Don't forget that your destination format (YUV420P) is split into three > planes of data. You need to pass in the correct pointers to each plane and > strides for each plane. > > your dstFrame->linesize should be an array of stride sizes > > for YUV420P is should look something like > > > des_stride420p[0] = dest_width ; // Y DATA width > > des_stride420p[1] = dest_width / 2 ; // U DATA width > > des_stride420p[2] = dest_width / 2 ; // V DATA width > > > > dstFrame->data should also be an array of pointers pointing to each plane > of > data. > > > > Hope this helps > _______________________________________________ > 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
