

#Generate single image from selected frame of video (default is 1), scale and save as jpgįfmpeg -i " $input " -ss $frame -vframes 1 -vf scale= "trunc(oh*a/2)*2: $scale " " $output.jpg "įfmpeg -i " $input " -vcodec libx264 -vprofile high -preset veryslow -b:v 225k -maxrate 300k -bufsize 1000k -vf scale= " $scale:trunc(ow/a/2)*2 " -threads 2 -pass 1 -y -an -f mp4 /dev/nullįfmpeg -i " $input " -vcodec libx264 -vprofile high -preset veryslow -b:v 225k -maxrate 300k -bufsize 1000k -vf scale= " $scale:trunc(ow/a/2)*2 " -threads 2 -pass 2 -acodec mp3 -b:a 128k -f mp4 " $output.mp4 "įfmpeg -i " $input " -codec:v libvpx -quality good -cpu-used 0 -b:v 225k -qmin 10 -qmax 42 -maxrate 300k -bufsize 1000k -threads 2 -vf scale= " $scale:trunc(ow/a/2)*2 " -y -an -pass 1 -f webm /dev/nullįfmpeg -i " $input " -codec:v libvpx -quality good -cpu-used 0 -b:v 225k -qmin 10 -qmax 42 -maxrate 300k -bufsize 1000k -threads 2 -vf scale= " $scale:trunc(ow/a/2)*2 " -codec:a libvorbis -b:a 128k -pass 2 -f webm " $output.webm "įfmpeg -i " $input " -ss $frame -vframes 1 -vf scale= " $scale:trunc(ow/a/2)*2 " " $output.jpg "Įcho "Scale factor not recognized. Default name is the input file name with a different extension "Įven= $(( $3 - ( $3 % 2) )) # Makes scale amount even just incase an odd number is givenĮcho "input is $input, output is $output "Įcho "scale factor is $2, scale amount is $scale "įfmpeg -i " $input " -vcodec libx264 -vprofile high -preset veryslow -b:v 225k -maxrate 300k -bufsize 1000k -vf scale= "trunc(oh*a/2)*2: $scale " -threads 2 -pass 1 -y -an -f mp4 /dev/nullįfmpeg -i " $input " -vcodec libx264 -vprofile high -preset veryslow -b:v 225k -maxrate 300k -bufsize 1000k -vf scale= "trunc(oh*a/2)*2: $scale " -threads 2 -pass 2 -acodec mp3 -b:a 128k -f mp4 " $output.mp4 "įfmpeg -i " $input " -codec:v libvpx -quality good -cpu-used 0 -b:v 225k -qmin 10 -qmax 42 -maxrate 300k -bufsize 1000k -threads 2 -vf scale= "trunc(oh*a/2)*2: $scale " -y -an -pass 1 -f webm /dev/nullįfmpeg -i " $input " -codec:v libvpx -quality good -cpu-used 0 -b:v 225k -qmin 10 -qmax 42 -maxrate 300k -bufsize 1000k -threads 2 -vf scale= "trunc(oh*a/2)*2: $scale " -codec:a libvorbis -b:a 128k -pass 2 -f webm " $output.webm " If ] || ] thenĮcho "Converts input video files for the web, with several parameters to ease the process and replicate across projects: "Įcho "Please provide all the necessary parameters "Įcho "Usage: video-convert // # means not required "Įcho "Example: video-convert video.mov width 720 // Converts video and scales it aspectly based on a width of 720 "Įcho "Example: video-convert video.mov height 560 25 // Converts video and scales it aspectly based on a height of 560 and exports thumbnail at 25 seconds in "Įcho "Example: video-convert video.mov height 560 25 myvideo // Converts video and scales it aspectly based on a height of 560 and exports thumbnail at 25 seconds in, and exports videos to myvideo.extension.


#- Watch out for sizing errors when not divisible by 2 #- Other options include setting both with & height You wanted to resize your video (-vf scale'480:-1'), and at the same time you wanted dont to use a video codec for encoding such resized video (-vcodec copy). #- Scale can be used as is which will set the height to 560 but keep aspect ratio for width.
