Skip to content

Instantly share code, notes, and snippets.

@alexarje
Last active May 3, 2023 15:35
Show Gist options
  • Save alexarje/46d28ae0e15b5e664223796450bf4a01 to your computer and use it in GitHub Desktop.
Save alexarje/46d28ae0e15b5e664223796450bf4a01 to your computer and use it in GitHub Desktop.
Convert a folder of MXF files to one MP4 file with FFmpeg
#!/bin/bash
# Script for converting a folder of MXF video files to different to a single MP4 file.
# Alexander Refsum Jensenius, RITMO, University of Oslo
# v0.1 2019-11-03
# Find and move all MXF files to the "root" (where the script is run from)
find . -name "*.MXF" -exec mv {} . ";"
# Create list of files to be used for concatenation
printf "file '%s'\n" ./*.MXF > mylist.txt
# Concatenate files
# Using a standard MP4 compression and yadif for deinterlacing
ffmpeg -f concat -safe 0 -i mylist.txt -c:v libx264 -vf yadif output.mp4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment