Hi all,
I have used H.264/AVC for my research work before but with only YUV sequences as input. I am now in a situation where the input (intermediate result of my research) is in RGB format. I do not know how to use H.264/AVC to compress this.
Specifically, in my C program I do some processing and get results in an RGB format. I am not supposed convert this to YUV because of some research-related restrictions (comparison of results, etc).
- So how do I create a RGB video file?
- Is there a fixed format that H.264/AVC wants? Or can I just create a file using "fwrite" in C that contains RGB similar to how I would create a YUV 4:4:4 file?
- Should the extension be .rgb for such a file?
Any help in this regards would be greatly appreciated ! Thank you!
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 3 of 3
Thread
-
-
Most AVC encoders will use YUV with 4:2:0 subsampling (YV12) internally, and expect that as input. You can't just write out raw digital video without some kind of container organization*. Even if your encoder supports RGB as input you'll need a container. AVI is probably easiest if your source is constant frame rate.
http://fourcc.org/yuv.php#YV12
*Actually, you can write raw frames without a container but you'll need special handling to get that into the encoder. -
Thanks jagabo.
I think what I'll do is to use OpenCV to write the RGB arrays into an AVI file and then invoke the JM reference H.264/AVC encoder to compress it. The frame rate or processing is not of concern at this stage of my work -- currently I am only interested in the compression ratio and quantization effects owing to the nature of my input data.
Thanks !
Similar Threads
-
AVI container encoded with H.264/AVC video and PCM sound
By LoLaha in forum Video ConversionReplies: 6Last Post: 20th Mar 2012, 22:14 -
Transcoding miniDV to mpeg 2: Input video is RGB 16-235?
By Sullah in forum Video ConversionReplies: 24Last Post: 3rd Aug 2011, 03:02 -
Video Player for MPEG-4 AVC/H.264
By wingspar in forum Software PlayingReplies: 3Last Post: 15th Jun 2011, 22:56 -
Blocking Artifacts in MPEG-4 AVC / H.264 Video
By Eva-Unit01 in forum Video ConversionReplies: 0Last Post: 28th Aug 2010, 14:36 -
MPEG-4 AVC/H.264 video codecs comparison
By DmitriyK in forum Latest Video NewsReplies: 6Last Post: 30th Jun 2010, 06:54