Last active
July 17, 2019 13:16
-
-
Save 599316527/425a6a8d8cdfde4e85aef1c577d89f19 to your computer and use it in GitHub Desktop.
Revisions
-
599316527 revised this gist
Jul 17, 2019 . 1 changed file with 1 addition 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 @@ -7,5 +7,6 @@ fileSizeParam="-b:v 1.6M -maxrate 1.6M -bufsize 2m"; echo "Convert: $1 -> $2"; # Use two-pass to reduce size https://trac.ffmpeg.org/wiki/Encode/H.264 /usr/local/bin/ffmpeg $ffmpegParam -i $1 $videoEncodeParam $audioEncodeParam $fileSizeParam -pass 1 -f mp4 /dev/null && \ /usr/local/bin/ffmpeg $ffmpegParam -i $1 $videoEncodeParam $audioEncodeParam $fileSizeParam -pass 2 -f mp4 $2 -
599316527 created this gist
Jul 17, 2019 .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,11 @@ #!/bin/zsh ffmpegParam="-hide_banner -y"; videoEncodeParam="-c:v libx264 -crf 23 -profile:v main -level 3.1 -pix_fmt yuv420p -movflags +faststart -s 1024x768"; audioEncodeParam="-an"; fileSizeParam="-b:v 1.6M -maxrate 1.6M -bufsize 2m"; echo "Convert: $1 -> $2"; /usr/local/bin/ffmpeg $ffmpegParam -i $1 $videoEncodeParam $audioEncodeParam $fileSizeParam -pass 1 -f mp4 /dev/null && \ /usr/local/bin/ffmpeg $ffmpegParam -i $1 $videoEncodeParam $audioEncodeParam $fileSizeParam -pass 2 -f mp4 $2