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
yes it is possible using ffmpeg.
-install ffmpeg in your server.
-check below example code.
I think is easier if you extract one of the first frames as a thumbnail.
Instead of -ss I use -vf thumbnail=num_frame
Try this command
always set -ss before -i in order to optimize performance while grabbing thumbs from long length videos.
ok this seemed to work for me ffmpeg -itsoffset -4 -i test.avi -vcodec mjpeg -vframes 1 -an -f rawvideo -s 320x240 test.jpg