I am learning video encoding & decoding in FFmpeg. I tried the code sample on this page (only the video encoding & decoding part). Here the dummy image being created is in YCbCr format. How do I achieve similar encoding by creating RGB frames? I am stuck at:
Firstly, how to create this RGB dummy frame?
Secondly, how to encode it? Which codec to use? Most of them work with YUV420p only...
EDIT: I have a YCbCr encoder and decoder as given on the this page. The thing is, I have RGB frame-sequence in my database and I need to encode it. But the encoder is for YCbCr. So, I am wondering to convert RGB frames to YCbCr (or YUV420P) somehow and then encode them. At decoding end, I get decoded YCbCr frames and I convert them back to RGB. How to go ahead with it?
I did try the swscontext thing, but the converted frames lose color information and also scaling errors. I thought of doing it manually using two for loops and colorspace conversion formulae but I am not able to access individual pixel of a frame using FFmpeg/libav library! Like in OpenCV we can easily access it with something like: Mat img(x,y) but no such thing here! I am totally a newcomer to this area...
Someone can help me?
Many Thanks!
ffmpeg -h encoder=foo
. – llogan