Created
February 12, 2011 04:44
-
-
Save nowl/823525 to your computer and use it in GitHub Desktop.
flv to ogg conversion script using mplayer and oggenc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| function do_conversion () | |
| { | |
| echo "processing $FLV_FILE" | |
| WAV_FILE="${FLV_FILE/.flv/.wav}" | |
| if [ "$WAV_FILE" == "$FLV_FILE" ]; then | |
| echo "filename does not end in .flv" | |
| exit 1 | |
| fi | |
| echo "building wav file: $WAV_FILE" | |
| mplayer -novideo -benchmark -ao pcm:file="$WAV_FILE" "$FLV_FILE" | |
| echo "generating ogg.." | |
| oggenc "$WAV_FILE" | |
| echo "cleaning and removing original.." | |
| rm -f "$WAV_FILE" "$FLV_FILE" | |
| } | |
| IFS=$'\n' | |
| if [ $# -eq 1 ]; then | |
| FLV_FILE="$1" | |
| do_conversion | |
| elif [ $# -eq 0 ]; then | |
| FLVS=$(ls *.flv) | |
| for file in $FLVS; do | |
| FLV_FILE="$file" | |
| do_conversion | |
| done | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment