10 July, 2009

Convert Color Video To GrayScale

I've recently found it useful to convert color video into grayscale video. I found the following to be effective in doing so.

$ ffmpeg -y -i /tmp/video.avi -s 640x480 -pix_fmt gray -vcodec rawvideo /var/tmp/video.avi

I haven't however found a means to re-encode the grayscale into an alternative codec (sigh).


Nick Shaforostoff said...

i tried

ffmpeg -i VTS_05_1.VOB -pix_fmt gray -vcodec rawvideo -f yuv4mpegpipe - | ffmpeg -y -f yuv4mpegpipe -i - -vcodec libtheora out.avi

but it creates 12K sized file.

Anonymous said...

Thanks I was trying to extract a gray, grey or black and white png sequence from a video.

ffmpeg -i ay.mov -s 500x282 -pix_fmt gray -r 15 -f image2 image%03d.png