View Full Version : Question about ffmpeg
koliva
22nd February 2010, 10:37
Dear all,
I have asked a question about encoding step by using ffmpeg. Now the problem is decoding. Whatever I do, I got always "could not find codec parameters",
For encoding,
ffmpeg -i out_%d.bmp -f rawvideo output.yuv
This is okay but how I can get my images back from output.yuv file?
I have tried
ffmpeg -i output.yuv -s 1400x800 rawvideo -f image2 out1_%d.bmp
but it didn't work.
Another question is, rawvideo means 4:0:0 or 4:2:2 ?
Boolsheet
22nd February 2010, 11:11
You have to put the resolution, framerate and colorspace for the raw file before the -i parameter. This way FFmpeg knows how to apply them correctly:
ffmpeg -s 1400x800 -vcodec rawvideo -f rawvideo -pix_fmt yuv422p -i output.yuv -vcodec bmp -f image2 out1_%d.bmp(I don't think you're supposed to save YUV images in BMP. It gets converted to RGB anyway, so this is not a lossless conversion)
For a list of the colorspaces execute:
ffmpeg -pix_fmt list
Another question is, rawvideo means 4:0:0 or 4:2:2 ?
Rawvideo means uncompressed and unencoded frames in the chosen colorspace.
4:2:2 and 4:2:0 is the notation for chroma subsampling used in YUV, it says how many pixels share the same color information.
koliva
22nd February 2010, 11:54
You have to put the resolution, framerate and colorspace for the raw file before the -i parameter. This way FFmpeg knows how to apply them correctly:
(I don't think you're supposed to save YUV images in BMP. It gets converted to RGB anyway, so this is not a lossless conversion)
For a list of the colorspaces execute:
ffmpeg -pix_fmt list
Rawvideo means uncompressed and unencoded frames in the chosen colorspace.
4:2:2 and 4:2:0 is the notation for chroma subsampling used in YUV, it says how many pixels share the same color information.
Thank you for your reply. I stil have l a problem.
I used for encoding:
ffmpeg -i out_%d.bmp -vcodec rawvideo -f output.yuv
and decoding,
ffmpeg -s 1400x800 -vcodec rawvideo -f rawvideo -pix_fmt yuv400p -i output.yuv -vcodec bmp -f image2 out1_%d.bmp
First, I have 2 grayscale(8 bit) images(named out_1.bmp, out_2.bmp) to be encoded. Therefore, I dont have Cb Cr components in yuv format. When I decode that output.yuv file, I got only one greenish bmp file. I tried many different configurations but it seems that there is a problem when I am combining my images.
My file sizes are:
out_1.bmp: 1095 KB
out_2.bmp: 1095 KB
output.yuv: 2190 KB
out1_1.bmp: 3282 KB ???
Boolsheet
22nd February 2010, 14:26
You can convert your bmps to yuv400p with the same pix_fmt parameter:ffmpeg -i out_%d.bmp -vcodec rawvideo -f rawvideo -pix_fmt yuv400p output.yuv
koliva
22nd February 2010, 16:40
You can convert your bmps to yuv400p with the same pix_fmt parameter:
It worked. Thank your so much :)
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.