Skip to content

Instantly share code, notes, and snippets.

@dvdvck
Created July 17, 2014 11:01
Show Gist options
  • Save dvdvck/39e9b4b94b10ad1749e2 to your computer and use it in GitHub Desktop.
Save dvdvck/39e9b4b94b10ad1749e2 to your computer and use it in GitHub Desktop.
h264 converter
#!/bin/bash
#recodifica a un formato que ocupe menos espacio en disco
#se utiliza el encoder h6264 para video. Este encoder automaticamente
#coloca el bitrate segun sus algoritmos. Resultando ~515kbps
#se utiliza el encoder vorbis para audio (default). De igual forma
#el bit rate es calculado a partir del sampleo. Para 24kHz se tiene ~66kbps
#Contenedor matroska que me parece fabuloso
#
#Ejecutarlo justo en la raiz de los directorios que contiene los videos
dest=/opt/dudding/
for path in `find . -name *.MP4`; do
dir=$dest$(dirname $path)
if [ ! -e $dir ]; then
echo "Creating dest dir $dir"
mkdir -p $dir
fi
#avprobe $path
avconv -y -i $path -ar 12k -c:v libx264 -s 640x360 -r 24 ${dest}${path%.*}.mkv
#break
done
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment