Last active
March 26, 2020 21:24
-
-
Save cnruby/96ea7978892831ec4b8b8815e4181551 to your computer and use it in GitHub Desktop.
ffpmeg-merging-mp4-video-files
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
# install ffmpeg on MacOS | |
brew install ffmpeg | |
brew cask install vlc | |
# merge two vidoes into one video | |
ls | |
INPUT_VIDEO_1=input_01 | |
INPUT_VIDEO_2=input_02 | |
OUTPUT_VIDEO=output | |
ffmpeg -i $INPUT_VIDEO_1.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts $INPUT_VIDEO_1.ts | |
ffmpeg -i $INPUT_VIDEO_2.mp4 -c copy -bsf:v h264_mp4toannexb -f mpegts $INPUT_VIDEO_2.ts | |
ffmpeg -i "concat:$INPUT_VIDEO_1.ts|$INPUT_VIDEO_2.ts" -c copy -bsf:a aac_adtstoasc $OUTPUT_VIDEO.mp4 | |
/Applications/VLC.app/Contents/MacOS/VLC $OUTPUT_VIDEO.mp4 | |
# change just once setting | |
/Applications/VLC.app/Contents/MacOS/VLC --version | |
vlc --version | |
echo "alias vlc=/Applications/VLC.app/Contents/MacOS/VLC" >> ~/.bash_profile | |
source ~/.bash_profile | |
vlc --version | |
# use the command 'vlc' | |
vlc $OUTPUT_VIDEO.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
youtube video