Hi everyone,
I've inherited a C++ application that uses the LibAV* APIs from FFMpeg 0.6 to do some video encoding. I've been tasked with improving encoding efficiency of MPEG4 output.
Currently, we've got a slow algorithm that converts RGB frames into YUV420 frames, then squirts them out to an MPEG4 file. The configured pixel format of the output codec is PIX_FMT_YUV420P. This is all good, but we're looking to improve performance.
One of our investigations is into a very quick conversion from RGB to YUV422. I've got the pixel format conversion working, but the call to avcodec_open() fails when I use pixel formats: PIX_FMT_YUV422P or PIX_FMT_UYVY422. All other settings remain the same.
It's not worth posting my code yet, because my question is pretty simple: Is it actually possible to encode video using an MPEG4 video codec when pixel format is YUV422? I've hunted around via the gift of Google, but got no definitive answer
I'm guessing it's not possible, since I get the error message below:
[mpeg4 @ 0x2aaaac1650e0]only YUV420 is supported
Can anyone help me out?
Try StreamFab Downloader and download from Netflix, Amazon, Youtube! Or Try DVDFab and copy Blu-rays! or rip iTunes movies!
+ Reply to Thread
Results 1 to 7 of 7
Thread
-
-
What EXACTLY do you mean by "mpeg4 video codec "?
It can mean many different things
http://en.wikipedia.org/wiki/MPEG-4
Do you mean the container mpeg4 part 14 (.mp4)? Or do you mean the compression format mpeg 4 part 2 (ASP, e.g. xvid, Divx) ? AFAIK part 2 doesn't support YUV422p
Because mpeg 4 part 10 compression (AVC/h.264) can handle YUV422 as per the AVC specs. I think there is a recent patch to x264 so you can look at the sources and compile ffmpeg yourself
If you look at the x264 changelog:
commit bb9216dc319a39eb6f2a5508a98e36d6492ffa7e r2081
Author: Henrik Gramner <hengar-6@student.ltu.se>
Date: Fri Aug 26 15:57:04 2011 +0200
4:2:2 encoding support -
Thanks for the responses guys,
What EXACTLY do you mean by "mpeg4 video codec "?
AVCodecContext:: codec_id = CODEC_ID_MPEG4
AVCodecContext:: pix_fmt = PIX_FMT_UYVY422 or PIX_FMT_YUV422P
I'm dumping everything to a .avi file.
A cursory search doesn't give me any more information on what the codec ID represents. I don't think it's the container format, since I don't even get that far before the error is raised.
Looks like I might have to update the version of ffmpeg we're using and try out the x264 changes. -
My guess is CODEC_ID_MPEG4 means an ASP encoder, ie, MPEG 4 Part 2, like Divx and Xvid.
This libavcodec module from the VLC source would bear that out:
http://www.videolan.org/developers/vlc/doc/doxygen/html/fourcc_8h-source.html -
I think "codec ID" in ffmpeg terminology very likely means mpeg-4 part 2
ffmpeg -codecs will list the codecs that that particular version has support for
"mpeg4" specifically lists MPEG-4 Part 2 , at least in the few ffmpeg binaries I tested
and as mentioned above, I don't think part 2 has support for YUV422p .
I would ask clarification from whomever gave you this task
Similar Threads
-
MPEG4 video player (and codec?) for Windows ME
By JamesC2000 in forum Software PlayingReplies: 1Last Post: 12th Jan 2012, 07:07 -
Encoding .DV problems with ffmpeg (e.g. MPEG4 -> DV or VOB -> DV)
By AlphaMonk in forum ffmpegX general discussionReplies: 1Last Post: 23rd Feb 2010, 04:24 -
Does Theora Decoder in libavcodec (FFMPEG V0.5) support YUV422 YUV444 modes
By goldenmean in forum Newbie / General discussionsReplies: 0Last Post: 15th Feb 2010, 22:35 -
Where can i get YUV444 & YUV422 raw Video sequences?
By goldenmean in forum Newbie / General discussionsReplies: 5Last Post: 15th Feb 2010, 12:51 -
MPEG4 codec problem
By kris3 in forum Newbie / General discussionsReplies: 3Last Post: 21st Aug 2007, 01:57