Category Archives: media

Media ingestion snippets

rename GoPro clips according to creation dates:

for f in *.MP4; do mv -n "$f" "$(date -r "$f" +"%Y%m%d_%H%M%S").mp4"; done

change picture names according to exif data:

exiftool -r '-FileName<CreateDate' -d '%Y-%m-%d %H.%M.%S%%-c.%%le' .

make timelapse video from JPG snapshots using Intel Quick Sync:

ffmpeg -r 12 -pattern_type glob -y -i '*.jpg' -vcodec mjpeg_qsv -crf 0 "output.mp4"

make timelapse video from normal video with some motion blur using Intel QuickSync:

ffmpeg -i input.mkv -filter:v "tblend=average,framestep=2,setpts=0.1*PTS" -r 96 -b:v 30M -crf 10 -vcodec h264_qsv -an -y output.mkv

merge video files without transcoding them:

ffmpeg -safe 0 -f concat -i <(find . -type f -name '*MP4' -printf "file '$PWD/%p'\n" | sort) -c copy output.mkv

Sort pictures to camera directories:

exiftool -d '.' '-directory<${model;}/$datetimeoriginal' *.jpg

Sort pictures to Year/Month direcotires:


exiftool -d '%Y/%m' '-directory<$CreateDate' *.jpg