Skip to content

Instantly share code, notes, and snippets.

@dimalyshev
Last active May 2, 2018 11:38
Show Gist options
  • Save dimalyshev/299a6d2ada1d83675174f09f3634fa5f to your computer and use it in GitHub Desktop.
Save dimalyshev/299a6d2ada1d83675174f09f3634fa5f to your computer and use it in GitHub Desktop.
convert & organize (by dates) video & photos
for /F "delims=;" %%i in ('dir /b/s "%~1\%2"') do ffmpeg -i "%%i" -strict -2 "%%~ni.mp4" && move "%%~ni.mp4" "%%i"
for /F "delims=;" %%i in ('dir /b/s "%~1"') do ffmpeg -i "%%i" -strict -2 "%%~ni.mp4" && del "%%i"
for file in *.*; do
#convert
ffmpeg -i ${file} -map_metadata {0:g} -strict -2 ${file%%.*}.mp4
# change ext
mv ${file} ${file%%.*}.mp4
#sort with help of exiftool
#https://www.sno.phy.queensu.ca/~phil/exiftool/exiftool-10.94.zip
exiftool -o out/ '-filename<createdate' -d %Y/%m/%Y%m%d_%H%M%S%%-c.%%e ${file}
mkiso -r -J -o YYYY.iso -V photo_YYYY YYYY/
@echo off
for /F "delims=;" %%i in ('dir /b *Full-HD*.mp4') do (
call:loop "%%i"
)
goto:eof
:loop
set xxx=%~1
set xxx=%xxx:~0,-19%
set xxx="%xxx%.mp4"
set xxx=%xxx:..=.%
::echo "%1" --^> %xxx%.mp4
echo
move %1 %xxx%
goto:eof
@dimalyshev
Copy link
Author

dimalyshev commented Jan 4, 2018

README

Housekeeping my videos, cam rolls and so on

Video

  • convert.bat - converts *.some to *.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment