av_interleaved_write_frame(): I/O error occurred

Usually that means that input file is truncated and/or corrupted., complains ffmpeg.

No, there's not any problem with the input file. What really happened is that ffmpeg was asked for a sequence of files but you failed to provide an appropriate file mask that ffmpeg could expand into a sequence of file names.

For example:


ffmpeg -i video.mov -r 12 -y -sameq -t 1 -f image2 frame.jpg

will output that error and won't generate anything.

The correct form is


ffmpeg -i video.mov -r 12 -y -sameq -t 1 -f mjpeg frame.jpg

Note that the format is now forced to mjpeg, for obtaining a single frame. It actually looks very simple if you look at the format list and note that the image2 output format is described as image sequence. But... you need to find out the available formats list (with ffmpeg -formats).

The funny thing is that it actually performs all the required work for generating the frame you require. But it simply can't complete the operation because of the wrong file mask.

If anybody knows how to generate a single png, please let me know. It seems the only way of generating png's is via image2, but I don't want to generate several images each time I just want one...

EDIT: From their FAQ:

Instead of relying on file format self-recognition, you may also use -vcodec ppm'-vcodec png' `-vcodec mjpeg' to force the encoding.

So here's how to extract a single PNG from a movie with ffmpeg:


ffmpeg -i video.mov -r 12 -y -sameq -t 1 -vcodec png frame.png