Skip to content

Instantly share code, notes, and snippets.

View alexarje's full-sized avatar

Alexander Refsum Jensenius alexarje

View GitHub Profile
@alexarje
alexarje / mergevideos.sh
Last active March 31, 2022 18:29
Merge and compress a collection of video files. This works particularly well for video recordings that have been split across multiple files due to file size limitations.
#!/bin/bash
## Make list of video files
TMPFILE=$(mktemp -p .) || exit 1
for file in *.{mp4,MP4}
do
echo file \'$file\' >> $TMPFILE
done
@alexarje
alexarje / mxf-folder2mp4.sh
Last active May 3, 2023 15:35
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
@alexarje
alexarje / mxf2mp4.sh
Last active February 12, 2024 13:28
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"