Created
          January 11, 2023 23:21 
        
      - 
      
 - 
        
Save gibatronic/f152319bdcfa71ec14b14c26a55f7801 to your computer and use it in GitHub Desktop.  
Revisions
- 
        
gibatronic created this gist
Jan 11, 2023 .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,33 @@ #!/usr/bin/env bash # # Slide an image to the left using ffmpeg # # Usage: # ./slide photo_input.jpg video_output.mp4 # # See: # https://ffmpeg.org/ffmpeg-filters.html#overlay-1 # https://easings.net/ # main() { local photo_input=$1 local video_output=$2 local duration='10' # in seconds local fps='30' local width='2160' local height='3840' ratio="t/${duration}" easing="-(cos(PI*(${ratio}))-1)/2" # in-out-sine overlay="(W-w)*(${easing}):(H-h)/2" ffmpeg -f lavfi -i "\ color=black:r=${fps}:d=${duration}:s=${width}x${height}[background]; \ movie=${photo_input}[overlay]; \ [background][overlay]overlay='${overlay}' \ " -y "${video_output}" } main "$@"