Hi gurus,
My problem is that avcodec_encode_video crashes when I use
PIX_FMT_YUYV422 rather than PIX_FMT_YUV420P. When PIX_FMT_YUV420P is
used the code works properly.
I'm using libx264 and
c->codec_type = CODEC_TYPE_VIDEO;
c->codec_id = CODEC_ID_H264;
'c' is AVCodecContext.
The structure array_raw contains (vaild and confirmed) YUYV422 encoded
raw frame and
1. Combination of
c->pix_fmt = PIX_FMT_YUV420P;
int size = avpicture_fill( (AVPicture *)picture, array_raw.ptr(),
PIX_FMT_YUV420P, SZ_FRAME.cx, SZ_FRAME.cy );
out_size = avcodec_encode_video(videoEncoderContext, outbuf,
outbuf_size, picture);
works. Of course the video is not great, but it looks as expected (like
a 422 treated as 420P, hehe). I also tried with the a proper 420P
picture and it works beautifully.
2. Combination of
c->pix_fmt = PIX_FMT_YUYV422;
int size = avpicture_fill( (AVPicture *)picture, array_raw.ptr(),
PIX_FMT_YUYV422, SZ_FRAME.cx, SZ_FRAME.cy );
out_size = avcodec_encode_video(videoEncoderContext, outbuf,
outbuf_size, picture);
makes avcodec_encode_video crash.
In both case avpicture_fill returns the expected size.
Is there some magic I need to do on AVCodecContext because I'm changing
pix_fmt?
I'm using ffmpeg from 05 Mar 2010. Win32, VC++2008 if that makes any
difference...
Thanks in advance for any help.
Cheers
Tymek
_______________________________________________
libav-user mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/libav-user