Video Preview from Command Line with ffmpeg

related

less than 1 minute read

Earlier I singleed about creating an animated preview gif from a given video. When using that method with a file list, ffmpeg would treat the file name as a data stream when read directly into the loop by piping the input file into the loop after done (see the first loop below). I like that method because it is easy, and uses 'read' which does not complain about spaces in file names.

You can read more about what I was trying to do here

The fix for the file-name-as-a-data-stream error is to dump each line of the input file into an array first. That is what I am doing below.
*Note: You have to set the IFS to something else if the file names have spaces

oldIFS=$IFS
IFS=:
while read line; do
filenames=("${filenames[@]}" "$line")
done > $errorfile
fi
let COUNTER=COUNTER+1
if [ "$COUNTER" -eq "10000100" ]
then
echo "First 100 Thumbnails Generated: `date`" > $OUTPUT/videosdone
fi
done
fi
IFS=$oldIFS

Tags:

Updated:

Leave a Comment