Skip to content

Instantly share code, notes, and snippets.

@mtrl
Created March 31, 2015 13:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtrl/2feb6a03ae01c212e851 to your computer and use it in GitHub Desktop.
Save mtrl/2feb6a03ae01c212e851 to your computer and use it in GitHub Desktop.
Convert all flvs to mp4 using ffmpeg
#!/bin/bash
# do a wc -l > flvs.txt from the root first then doit.sh flvs.txt
while read line
do
name=$line
outputfile=${name/\.\/0/\.\/mpgs\/}
dir=$(dirname "$outputfile")
mkdir -p $dir
out=${outputfile/\.flv/\.mp4}
echo "Processing ${out}"
ffmpeg -loglevel panic -i ${name} -c:v libx264 -crf 19 ${out} < /dev/null
done < $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment