easiest and fastest screenshot tutorial for uploaders.
i saw a plenty of tutorials how to make high quality screenshots in .png with ffmpeg. after trying to make some screenshots with ffmpeg with several tutorials that are posted on private trackers, i have noticed that it is very, very slow procedure to do that.
after that, i have decided to modify ffmpeg command to make a perfect screenshot in .png format and when it comes to procedure, it would be over in less then 5 seconds. here is the modified ffmpeg command to test it...
duration=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 yourfilename.mkv); num_screenshots=20; interval=$(echo "$duration / ($num_screenshots + 1)" | bc -l); for i in $(seq 1 $num_screenshots); do pos=$(echo "$interval * $i" | bc -l); ffmpeg -ss $pos -i yourfilename.mkv -y -vframes 1 -vf "scale='max(sar,1)*iw':'max(1/sar,1)*ih'" /home/yourusername/Pictures/path_to_screensot_folder/screenshot${i}.png; done
this line "num_screenshots=20" means that your ffmpeg will take 20 screenshots, if you want even more or less screenshots, than you should change only that number, for instance if you want 15 screenshots the command for 15 screenshots is this...
duration=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 yourfilename.mkv); num_screenshots=15; interval=$(echo "$duration / ($num_screenshots + 1)" | bc -l); for i in $(seq 1 $num_screenshots); do pos=$(echo "$interval * $i" | bc -l); ffmpeg -ss $pos -i yourfilename.mkv -y -vframes 1 -vf "scale='max(sar,1)*iw':'max(1/sar,1)*ih'" /home/yourusername/Pictures/path_toscreenshot_folder/screenshot${i}.png; done