Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexander Refsum Jensenius alexarje

View GitHub Profile
View FFmpeg-30-video-grid.sh
ffmpeg \
-i dance_addition.mp4 \
-i dance_and.mp4 \
-i dance_average.mp4 \
-i dance_blend.mp4 \
-i dance_burn.mp4 \
-i dance_darken.mp4 \
-i dance_difference.mp4 \
-i dance_divide.mp4 \
-i dance_dodge.mp4 \
View FFmpeg-tblend-exploration.sh
ffmpeg -i dance.avi -filter_complex "tblend=all_mode=addition" dance_addition.mp4
ffmpeg -i dance.avi -filter_complex "tblend=all_mode=grainmerge" dance_grainmerge.mp4
ffmpeg -i dance.avi -filter_complex "tblend=all_mode=and" dance_and.mp4
ffmpeg -i dance.avi -filter_complex "tblend=all_mode=average" dance_average.mp4
ffmpeg -i dance.avi -filter_complex "tblend=all_mode=burn" dance_burn.mp4
ffmpeg -i dance.avi -filter_complex "tblend=all_mode=darken" dance_darken.mp4
ffmpeg -i dance.avi -filter_complex "tblend=all_mode=difference" dance_difference.mp4
ffmpeg -i dance.avi -filter_complex "tblend=all_mode=grainextract" dance_grainextract.mp4
ffmpeg -i dance.avi -filter_complex "tblend=all_mode=divide" dance_divide.mp4
ffmpeg -i dance.avi -filter_complex "tblend=all_mode=dodge" dance_dodge.mp4
@alexarje
alexarje / mxf-folder2mp4.sh
Created Nov 3, 2019
Convert a folder of MXF files to one MP4 file with FFmpeg
View mxf-folder2mp4.sh
#!/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 Jun 1, 2021
Convert MXF files to MP4 using FFmpeg
View mxf2mp4.sh
#!/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"
@alexarje
alexarje / circle_image.sh
Created Sep 13, 2019
Create circular thumbnails in the terminal
View circle_image.sh
#!/bin/bash
for i in *.jpg;
do
name=`echo $i | cut -d'.' -f1`;
convert "$i" \
\( +clone -threshold -1 -negate -fill white -draw "circle 100,100 100,0" \) \
-alpha off -compose copy_opacity -composite $name.png;
done
@alexarje
alexarje / Rotate multiple JPEG files
Created May 19, 2019
Automagically rotate multiple images based on EXIF descriptors
View Rotate multiple JPEG files
find . *.jpg -exec jhead -autorot {} \;
@alexarje
alexarje / sortimages.sh
Created Nov 25, 2018
Sort images based on direction (portrait/landscape)
View sortimages.sh
# Based on: https://unix.stackexchange.com/questions/294341/shell-script-to-separate-and-move-landscape-and-portrait-images
# make directories
mkdir portraits
mkdir landscapes
# Check that all images have correct rotation
jhead -autorot *.jpg
jhead -autorot *.JPG
@alexarje
alexarje / trimvideofile.sh
Last active Dec 19, 2019
Trim video using ffmpeg
View trimvideofile.sh
ffmpeg -i input.mp4 -ss 01:10:27 -to 02:18:51 -c:v copy -c:a copy output.mp4
@alexarje
alexarje / multieps2pdf.sh
Last active Mar 8, 2018
Convert multiple EPS files to PDF
View multieps2pdf.sh
find . -name "*.eps" -exec epstopdf {} ";"
@alexarje
alexarje / pdf-split.sh
Last active Dec 31, 2018
Small shell script (for Ubuntu) that splits up one multi-page PDF to individual PDF files
View pdf-split.sh
#!/bin/sh
cd $NAUTILUS_SCRIPT_CURRENT_URI
pdftk $@ burst output $@-%d.pdf