VideoHelp Forum
+ Reply to Thread
Results 1 to 3 of 3
Thread
  1. Member
    Join Date
    Aug 2009
    Location
    United States
    Search Comp PM
    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).
    1. So how do I create a RGB video file?
    2. 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?
    3. Should the extension be .rgb for such a file?

    Any help in this regards would be greatly appreciated ! Thank you!
    Quote Quote  
  2. 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.
    Quote Quote  
  3. Member
    Join Date
    Aug 2009
    Location
    United States
    Search Comp PM
    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 !
    Quote Quote  



Similar Threads

Visit our sponsor! Try DVDFab and backup Blu-rays!