I need to get one image out of an video to use as a thumbnail
So I am trying this:
ffmpeg -ss 00:05:34.05 -i input.avi -vframes 1 -sameq output.jpg
This works just fine however every once in a while I come across a file where this fails with the following error message
av_interleaved_write_frame(): I/O error occurred
Usually that means that input file is truncated and/or corrupted.
What are my options if any ?
Thanks
解决方案
Try this command
ffmpeg -ss 5 -i sample.mp4 -vframes 1 -s 320x240 -f image2 -y sample.jpg;
always set -ss before -i in order to optimize performance while grabbing thumbs from long length videos.