Skip to content

Instantly share code, notes, and snippets.

@illarionvk
Created April 2, 2015 09:03
Show Gist options
  • Save illarionvk/8d7fc1c160ff3aec8c6f to your computer and use it in GitHub Desktop.
Save illarionvk/8d7fc1c160ff3aec8c6f to your computer and use it in GitHub Desktop.
Convert video file for website with poster image
#!/bin/bash
for files in *.wmv
do
avconv -y -i "$files" -ss 0 -vframes 1 "${files%.wmv}_poster.jpg"
avconv -y -i "$files" -vcodec libtheora -acodec libvorbis -b:v 500k "${files%.wmv}.ogv"
avconv -y -i "$files" -pix_fmt yuv420p -c:v libx264 -b:v 500k -crf 30 -preset slower -profile:v Main -level 31 -c:a aac -b:a 192k -strict experimental "${files%.wmv}.mp4"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment