For my particular application, because I have to use ffmpeg 0.5, I'm actually
using avcodec_decode_video with img_convert to convert the frames to RGB24.
In a previous implementation, I used a more recent revision of ffmpeg, and used
avcodec_decode_video2 with sws_scale.
In both cases, I was able to successfully convert the decoded frame into RGB24.
I would guess that other RGB formats would work equally well.
Assuming you prefer the modern version:
struct SwsContext* hSwsContext = sws_getContext(pCodecCtx->width,
pCodecCtx->height, pCodecCtx->pix_fmt,
pCodecCtx->width, pCodecCtx->height, PIX_FMT_RGB24, SWS_AREA, NULL,
NULL, NULL)
avcodec_decode_video2(pCodecCtx, pFrame, &frameFinished, &packet);
sws_scale(hSwsContext, pFrame->data, pFrame->linesize, 0,
pCodecCtx->height, pFrameRGB->data, pFrameRGB->linesize);
If any of the types are unclear, I'll clarify it.
As to relative speeds, I haven't used xvidcore, so I can't say anything about
that.
~Henry
-----Original Message-----
From: [email protected] [mailto:[email protected]]
On Behalf Of Igor R
Sent: Wednesday, December 02, 2009 11:20 AM
To: Libav* user questions and discussions
Subject: Re: [libav-user] decoding MPEG4 ASP to RGB
> Please correct me if I'm wrong, but I don't believe that's possible.
> I'm also decoding MP4's, and I haven't found a way to get around using a call
> to sws_scale() or the deprecated img_convert to convert the images.
I'm not sure I got you right - do you successfully use
avcodec_decode_video2() + sws_scale() to get RGB? Is it capable of
converting to various RGB formats (32, 24, 16 bits)?
Actually, I'm moving to ffmpeg from xvidcore, in order to get portable
optimized decoding that would work fast both on Win32 and on iPhone
(there's no xvidcore optimized for ARM). So the question is whether
avcodec_decode_video2() + sws_scale() will be faster, than xvidcore
decoding directly to RGB.
_______________________________________________
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