Browse Source

add ffmpeg audio

master
VirtuBox 5 months ago
parent
commit
809ed3ec49
Signed by: virtubox GPG Key ID: 22EB296C97BAD476
1 changed files with 14 additions and 0 deletions
  1. +14
    -0
      mybashrc

+ 14
- 0
mybashrc View File

@ -742,6 +742,19 @@ _MERGE_VIDEO() {
ffmpeg -f concat -safe 0 -i mylist.txt -c copy "output-merged.mp4"
}
_TRANSFER_AUDIO() {
if [ "$#" -eq 0 ]; then
echo "Usage : ffmpeg-audio <file-with-audio> <file-without-audio>"
else
rm -f "${1%.*}.aac"
ffmpeg -i "$1" -vn -acodec copy "${1%.*}.aac"
if [ -f "${1%.*}.aac" ]; then
rm -f "${2%.*}-sound.mp4"
ffmpeg -i "$2" -i "${1%.*}.aac" -map 0:v -map 1:a -c copy -y "${2%.*}-sound.mp4"
fi
fi
}
# enable color support of ls and also add handy aliases
# some more ls aliases
#alias wp='/usr/bin/wp --allow-root'
@ -769,6 +782,7 @@ alias ee-syslog='tail -n 250 /var/log/syslog | ccze -A'
alias egrep='egrep --color=auto'
alias ffmpeg-cut-start=ffmpeg_start_time
alias ffmpeg-merge=_MERGE_VIDEO
alias ffmpeg-audio=_TRANSFER_AUDIO
alias ftpadd=_FTP_ADD
alias fgrep='fgrep --color=auto'
alias gg="ping google.fr"


Loading…
Cancel
Save