Skip to content

Instantly share code, notes, and snippets.

@lopezpdvn
Created July 1, 2016 00:23
Show Gist options
  • Save lopezpdvn/bbbf72e2ccc33c0e35b130eba0108e59 to your computer and use it in GitHub Desktop.
Save lopezpdvn/bbbf72e2ccc33c0e35b130eba0108e59 to your computer and use it in GitHub Desktop.
Compress raw video into Matroska container
date >> log.txt
echo 'Starting job' >> log.txt
sudo systemctl stop fahclient.service
sudo systemctl status --full fahclient.service
for src in *avi ; do
date >> log.txt ;
echo "Starting conversion for $src" >> log.txt ;
dst="$(echo $src | sed -e 's/\.avi$//')".mkv ;
ffmpeg -ac 2 -channel_layout stereo -i "$src" -c:v libx264 -preset slow -crf 17 -pix_fmt yuv422p -c:a pcm_s16le "$dst" ;
date >> log.txt ;
echo "Finished conversion, created $dst" >> log.txt ;
done
sudo systemctl start fahclient.service
sudo systemctl status --full fahclient.service
date >> log.txt
echo 'Ended job' >> log.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment