Skip to content

Instantly share code, notes, and snippets.

@jiaaro
Created August 7, 2014 19:10
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 jiaaro/d7ee73891691ebedb936 to your computer and use it in GitHub Desktop.
Save jiaaro/d7ee73891691ebedb936 to your computer and use it in GitHub Desktop.
Split Stereo Files (ffmpeg)
#!/bin/bash
INFILE="${1}"
LFILE=$(SND="$INFILE" python -c "import os; print '{0}.L{1}'.format(*os.path.splitext(os.environ['SND']))")
RFILE=$(SND="$INFILE" python -c "import os; print '{0}.R{1}'.format(*os.path.splitext(os.environ['SND']))")
echo "Splitting $INFILE into:"
echo " LEFT: $LFILE"
echo " RIGHT: $RFILE"
echo
ffmpeg -i "$INFILE" -map_channel 0.0.0 "$LFILE" -map_channel 0.0.1 "$RFILE"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment