[Libav-user] Encoding FLV gives green screen output
samhalligan15 at gmail.com
Mon May 6 21:58:13 CEST 2013
Solved it guys.
I was calling av_codec_encode_video2 twice for some reason, and the second
call was encoding a blank frame instead of the one that had data decoded
into it. Silly mistake :p
Thanks for the replies!
On Mon, May 6, 2013 at 7:51 PM, Alex Cohn <alexcohn at netvision.net.il> wrote:
> On Sun, May 5, 2013 at 2:59 PM, yy-zed <samhalligan15 at gmail.com> wrote:
> I've written a piece of C++ code that can capture webcam video frame,
>> them, convert them to YUV420P, encode them and then write them to a file.
>> I use the mpeg2 codec and write to a .mpg file, everything works
>> But, if I use flv, then the output produced is just a green screen. I'm
>> sure if there are different encoder settings I need to set for encoding
>> video?Or maybe I'm doing something wrong in sws_scale? Here's my code(the
>> relevant parts):
>> //Read a video frame in
>> //Decode the contents of packet into pFrame
> From your snippet, it is not clear what pCodecCtx is, but anyways it's
> good practice to check the return code from avcodec_decode_video2() and
> frameFinished, before you pass pFrame to sws_scale().
> Libav-user mailing list
> Libav-user at ffmpeg.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Libav-user