How to encode grayscale video streams with FFmpeg?
问题 I've got a grayscale video stream coming off a Firewire astronomy camera, I'd like to use FFmpeg to compress the video stream but it will not accept single byte pixel formats for the MPEG1VIDEO codecs. How can I use the FFmpeg API to convert grayscale video frames into a frame format accepted by FFmpeg? 回答1: Edit MPEG-1 only accepts YUV. So convert your frame to yuv. Use the SwsContext structure, create it by calling sws_getContext, and then use sws_scale. Try the rawvideo codec. You will