Last active
September 27, 2015 04:08
-
-
Save overplumbum/1208936 to your computer and use it in GitHub Desktop.
Video clip from frames generation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Windows: http://en.cze.cz/Images-to-video | |
## MacOSX & Linux below | |
clipdir=/tmp/clip/ | |
rm -fr $clipdir && mkdir $clipdir | |
# crop&resize 3x4 frames to 16x9 1280x720 | |
for i in *.JPG ; do convert -verbose $i -strip -resample 72x72 -crop x1386+0+100 -resize 1280x $clipdir/$i ; done | |
#:> cmds.lst && for i in *.JPG ; do echo convert -verbose $i -strip -resample 72x72 -crop x1386+0+100 -resize 1280x $clipdir/$i >> cmds.lst ; done | |
#parallel ... todo ... | |
# renaming frames to 0000.jpg, 0001.jpg, ... | |
python -c "import os, glob; [os.rename(f, '$clipdir/{0:04d}.jpg'.format(n)) for n, f in enumerate(sorted(glob.glob('$clipdir/*.JPG')))]" | |
# frames2video | |
ffmpeg -r 25 -i $clipdir/%04d.jpg -b:v 8M $clipdir/clip.mp4 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment