Last active
April 25, 2024 17:46
-
-
Save fsalehpour/0cae06d8698c652f3c62d944d8ece9a4 to your computer and use it in GitHub Desktop.
Revisions
-
fsalehpour revised this gist
Nov 5, 2017 . 1 changed file with 4 additions and 4 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 @@ -8,11 +8,11 @@ mkdir -p output for i in * do output="output/$(echo $i | sed 's/\..*$/\.mp4/')" T=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$i") HEIGHT=$(ffprobe -v error -show_entries stream=height -of default=noprint_wrappers=1:nokey=1 "$i") ffmpeg -i "$dir/logo.png" -y -v quiet -vf scale=-1:$HEIGHT/12 "$dir/scaled.png" ffmpeg -i "$i" -i "$dir/scaled.png" -filter_complex "overlay=((W-w)/$T)*t:100,scale=-1:240" "$output" done ) -
fsalehpour created this gist
Nov 5, 2017 .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,18 @@ #!/bin/bash dir=$(pwd) (cd $1 mkdir -p output for i in * do output="output/$(echo $i | sed 's/\..*$/\.mp4/')" T=$(ffprobe -v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 "$i") HEIGHT=$(ffprobe -v error -show_entries stream=height -of default=noprint_wrappers=1:nokey=1 "$i") ffmpeg -i "$dir/logo.png" -y -v quiet -vf scale=-1:$HEIGHT/12 "$dir/scaled.png" ffmpeg -i "$i" -i "$dir/scaled.png" -filter_complex "overlay=((W-w)/$T)*t:100,scale=-1:240" "$output" done )