I have an action camera which I use sometimes to record my rides or walks. It creates multiple MOV files of size 4GB. So to make a video using those big files takes lot of time, however all I really need to do is concatenate them, remove audio and then merge it with another big mp3 file. All the ffmpeg commands are below. Enjoy.
While concatenating multiple videos remove audio using
ffmpeg -safe 0 -f concat -i file.txt -vcodec copy -an output.MOV
Create file.txt for the concatenate to work
for f in *.mp3 ; do echo "file '${f}'" >> file.txt; done;
Concatenate audio files
ffmpeg -safe 0 -f concat -i file.txt -acodec copy all.mp3
Merge video with audio and keeping the shortest duration (from video)
ffmpeg -i output.MOV -i ~/Documents/sounds_youtube/tmp/all.mp3 -map 0:v -map 1:a -filter:a "volume=0.2" -vcodec copy -shortest final.MOV
You can also split video.
ffmpeg -i output.MOV -ss 00:00:00 -t 00:09:00 -c copy final.MOV
You can also reduce file size drastically using this command.
ffmpeg -i input.mp4 -vcodec libx265 -crf 28 output.mp4
Reduce the size of all the videos in a directory.
for f in *.MP4;do ffmpeg -i ${f} -vcodec libx265 -crf 28 small_${f};done;
All done.