Jump to content

Hi I would like to run a bash script to take screenshots of a video


Recommended Posts

#!/bin/sh
 
file=$1
times=$2
x=1
 
while [ $x -le $times ]; do
    ffmpeg -ss $(echo "$x * 60" | bc -l) -i "$file" -an -vframes 1 -f image2 -vf "yadif,scale='max(sar,1)*iw':'max(1/sar,1)*ih'" image$(echo "$x").png;
    x=$(( $x + 1 ))
done

usage syntax is like this:
scriptname movie.mkv 20
scriptname is the name of the file you paste the commands in, movie.mkv is the video file, number at the end is the number of screenshots you want

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...