rawvideo and rgb32 values passed to FFmpeg
I'm converting a file to PNG format using this call:
ffmpeg.exe -vframes 1 -vcodec rawvideo -f rawvideo -pix_fmt rgb32 -s <width>x<height> -i infile -f image2 -vcodec png out.png
I want to use a converter that can be linked or compiled into a closed-source commercial product, unlike FFmpeg
, so I need to understand the format of the input file I'm passing in.
So, what does rawvideo
mean to FFmpeg
?
Is FFmpeg
determining what type of raw format the input file has, or does rawvideo
denote something distinct?
What does rgb32
mean here?
The size of the input file is a little more than (width * height * 8)
bytes.
Normally a video file contains a video stream (whose format is specified using -vcodec
), embedded in a media container (e.g. mp4, mkv, wav, etc.). The -f
option is used to specify the container format. -f rawvideo
is basically a dummy setting that tells ffmpeg that your video is not in any container.
-vcodec rawvideo
means that the video data within the container is not compressed. However, there are many ways uncompressed video could be stored, so it is necessary to specify the -pix_fmt
option. In your case, -pix_fmt rgb32
says that each pixel in your raw video data uses 32 bits (1 byte each for red, green, and blue, and the remaining byte ignored).
For more information on what the options mean, see the ffmpeg documentation.
精彩评论