Last active
August 2, 2021 10:07
-
-
Save mfd/d795c11aec7bca3bb6c10f91b9e01afa to your computer and use it in GitHub Desktop.
Revisions
-
mfd revised this gist
Aug 2, 2021 . No changes.There are no files selected for viewing
-
mfd revised this gist
Aug 2, 2021 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,5 @@ ## Scale to height 320 ``` ffmpeg -i input.mp4 -vf scale=-2:320 output.mp4 ``` -
mfd created this gist
Mar 11, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #!/bin/bash # Generates a cover image along with mute web-ready WebM and MP4 files for each master video in a folder. # See: https://gist.github.com/jaydenseric/220c785d6289bcfd7366. # Parameter 1: Input video format (e.g. "mov"). # Parameter 2: Output width in pixels (e.g. "1280"). # Example use: "./video4web.sh mov 1280". mkdir web rm -rf web/* for i in *.$1 do # Generate cover image ffmpeg -i $i -vframes 1 -vf scale=$2:-2 -q:v 1 web/${i%$1}jpg # Generate WebM ffmpeg -i $i -c:v libvpx -qmin 0 -qmax 25 -crf 4 -b:v 1M -vf scale=$2:-2 -an -threads 0 web/${i%$1}webm # Generate MP4 ffmpeg -i $i -c:v libx264 -pix_fmt yuv420p -profile:v baseline -level 3.0 -crf 22 -preset veryslow -vf scale=$2:-2 -an -movflags +faststart -threads 0 web/${i%$1}mp4 done