Skip to content

Instantly share code, notes, and snippets.

@alexarje
Last active July 1, 2024 11:34
Show Gist options
  • Save alexarje/dbc45c9f2ffeef2c8c1cbda98992cbc0 to your computer and use it in GitHub Desktop.
Save alexarje/dbc45c9f2ffeef2c8c1cbda98992cbc0 to your computer and use it in GitHub Desktop.
Convert MXF files to MP4 using FFmpeg
#!/bin/bash
# Script for converting MXF video files to different to other file formats.
for i in *.MXF; do
if [ -e "$i" ]; then
file=`basename "$i" .MXF`
# MP4 file with default settings + deinterlacing
ffmpeg -i "$i" -c:v libx264 -vf yadif "$file.mp4"
# Create AVI video file with MJPEG compression that works with QTM and Matlab
# ffmpeg -i "$i" -c:v mjpeg -q:v 3 -acodec pcm_s16le -ar 44100 "$name_conv.avi";
# Create uncompressed audio file
# ffmpeg -i "$i" -acodec pcm_s16le "$name_conv.wav";
# Create thumbnail from the first image in the video file
ffmpeg -i "$i" -vf "thumbnail" -frames:v 1 "$file.png"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment