Last active
May 16, 2020 18:07
-
-
Save timabell/26716d7773b61d7b586c5a1babe8fb28 to your computer and use it in GitHub Desktop.
combine cycliq videos on a linux commandline
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
# https://gist.github.com/timabell/26716d7773b61d7b586c5a1babe8fb28 | |
# make a picture in picture video from multiple front/back camera chunked video files | |
# expects files in folders `front/` and `back/` | |
mkdir -p output | |
# front | |
# concat file chunks together https://trac.ffmpeg.org/wiki/Concatenate | |
ls front/*.MP4 | awk '{print "file " "'\''" $0 "'\''"}' | tee front-files.txt | |
ffmpeg -f concat -i front-files.txt -c copy -flags +global_header -acodec libvo_aacenc output/front.mp4 | |
# back | |
# concat file chunks together https://trac.ffmpeg.org/wiki/Concatenate | |
ls back/*.MP4 | awk '{print "file " "'\''" $0 "'\''"}' | tee back-files.txt | |
ffmpeg -f concat -i back-files.txt -c copy -flags +global_header -acodec libvo_aacenc output/back.mp4 | |
# combine front and back | |
# https://www.oodlestechnologies.com/blogs/PICTURE-IN-PICTURE-effect-using-FFMPEG/ | |
ffmpeg -i output/front.mp4 -i output/back.mp4 -filter_complex \ | |
"[1]scale=iw/5:ih/5 [pip]; [0][pip] overlay=main_w-overlay_w-10:main_h-overlay_h-10" \ | |
-s 1920x1090 -vcodec h264 -acodec libvo_aacenc output/pip.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment