Created
March 19, 2015 11:54
-
-
Save ericholsinger/9fa39d7dcf6491ce6f96 to your computer and use it in GitHub Desktop.
convertmp4: A bash shell script to make the calls to ffmpeg a little simpler for converting OBS .flv output to .mp4
This file contains 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/bash | |
# | |
# this will call ffmeg to convert a .flv to a .mp4 | |
# | |
# NOTE: ffmeg is expected to be install and in your path | |
# | |
# usage: convertmp4 infile.flv | |
# | |
# output will be a .mp4 file in the same directory | |
# | |
# Example: | |
# convertmp4 /Users/myname/Movies/obsrecording.flv | |
# will create | |
# /Users/myname/Movies/obsrecording.mp4 | |
showUsage() | |
{ | |
echo "usage: $(basename "$0") infile.flv" | |
} | |
# only takes one parameter | |
if [ $# -ne 1 ] ; then | |
echo "Illegal number of arguments" | |
showUsage | |
exit 1 | |
fi | |
# only works on .flv files | |
if [[ $1 =~ \.flv$ ]]; then | |
'ffmpeg' -i "$1" -c copy -copyts "${1%.*}.mp4" | |
else | |
echo "Filename should end with .flv" | |
showUsage | |
exit 1 | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment