Search code examples
ffmpegpipevideo-processing

Ffmpeg pipe stream glitch


I want to process ffmpeg raw video stream, and I can't understand why this code produces glitches. What's wrong?

ffmpeg -i in.mp4 -f image2pipe -pix_fmt rgb24 -vcodec rawvideo - | 
ffmpeg -f rawvideo -vcodec rawvideo -s 1980x1080 -pix_fmt rgb24 -r 24 -i - -an out.avi

Thanks!


Solution

  • For rawvideo streams, you have to have the correct size set, so you need to change your invocation of ffmpeg to:

    ffmpeg -i in.mp4 -f image2pipe -pix_fmt rgb24 -vcodec rawvideo - | 
    ffmpeg -f rawvideo -vcodec rawvideo -s 1920x1080 -pix_fmt rgb24 -r 24 -i - -an out.avi
    

    This is assuming that your in.mp4 file is a Full HD file.