Skip to content

Instantly share code, notes, and snippets.

@bytefade
Created January 8, 2016 19:09
Show Gist options
  • Save bytefade/08f83b0b556d1d64ab39 to your computer and use it in GitHub Desktop.
Save bytefade/08f83b0b556d1d64ab39 to your computer and use it in GitHub Desktop.
ffmpeg convert and rename
#!/bin/bash
#
#RUN: find ../uploads/videos/ -iname "*.mp4" -exec ./ffmpeg.sh {} ";"
dir_atual=$(dirname $1)
filename=$(basename $1)
extension=${filename##*.}
filename=${filename%.*}
cp $dir_atual/${filename}.mp4 $dir_atual/${filename}.old.mp4
mv $dir_atual/${filename}.mp4 $dir_atual/${filename}.bkp.mp4
#overrwrite -y
ffmpeg -i $dir_atual/${filename}.old.mp4 -threads 0 -strict experimental -f mp4 -vcodec libx264 -s 1280x720 $dir_atual/${filename}.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment