Jira Courses, Training and Consulting: Sparxsys Trainings
Thanks for coming here, I hope you are enjoying learning here, I have also written some books in case you want to learn a bit more :)
If you need my help with Drupal, Linux, Jira, Scripting, Automation or want to contact me then raise a ticket for me please :) and I will get back to you, promise. At Sparxsys we provide Atlassian consultancy services, reach out to me at ravi at sparxsys dot com

ffmpeg to create walking/bike ride videos with background music

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.

Similar posts

Subscribe

* indicates required

Please confirm that you would like to from Sparxsys:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices.

Want to contact me?