Last active
March 24, 2021 05:54
-
-
Save jsfaint/eed8f868f0047981fe29bbc0b227dadd to your computer and use it in GitHub Desktop.
Convert FLV to MP4 powered by ffmpeg
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 | |
[[ -z $1 ]] && echo "flv2mp4 <flv name>" | |
src=$1 | |
if [[ -d $src ]] && command -v fzf > /dev/null 2>&1; then | |
src="$(fd . -e flv "$src" | fzf -e -m)" | |
fi | |
if [[ -z $src ]]; then | |
echo "Invalid parameter" | |
exit 1 | |
fi | |
dest="${src/.flv/}.mp4" | |
if test -z "$dest"; then | |
echo "Invalid parameter" | |
exit 1 | |
fi | |
echo "Convert $(basename "$src") to MP4" | |
ffmpeg -i "$src" -codec copy "$dest" | |
echo "All Done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment