rawvideo and rgb32 values passed to FFmpeg

怎甘沉沦 提交于 2020-01-01 04:26:07

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/7238013/rawvideo-and-rgb32-values-passed-to-ffmpeg

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!