Skip to content

Instantly share code, notes, and snippets.

@JamesDunne
Last active August 29, 2015 14:02
Show Gist options
  • Save JamesDunne/2f5c379ee055037f05f7 to your computer and use it in GitHub Desktop.
Save JamesDunne/2f5c379ee055037f05f7 to your computer and use it in GitHub Desktop.
Make animated GIF from Sherlock S03E02 scene: High-functioning sociopath
@echo off
rem Final result: http://i.bittwiddlers.org/b/KH8
rem goto annotate
:capture
ffmpeg -i Sherlock.3x02.the_sign_of_three.mkv -ss 10:37 -t 10 fr%d.png
:annotate
del /f /q v*.txt 2>NUL
rem Bloody psychopath!
for /L %%d in (27,1,61) DO echo fr%%d.png >> v0.txt
rem High-functioning sociopath
for /L %%d in (62,1,106) DO echo fr%%d.png >> v1.txt
rem ...
for /L %%d in (107,1,114) DO echo fr%%d.png >> v2.txt
rem with your number.
for /L %%d in (115,1,136) DO echo fr%%d.png >> v3.txt
rem :-D
for /L %%d in (137,1,180) DO echo fr%%d.png >> v4.txt
rem ...
for /L %%d in (181,1,219) DO echo fr%%d.png >> v5.txt
set CROPA=-gravity southwest -crop 776x480+0+240 +repage
set CROPB=-gravity southwest -crop 776x480+504+240 +repage
set ANNA=-gravity south -fill red -stroke black -strokewidth 3 -font impact -weight bold -pointsize 58 -annotate +0+10
set ANNB=-gravity south -fill yellow -stroke black -strokewidth 3 -font impact -weight bold -pointsize 58 -annotate +0+10
SET SCALE=-scale 50.0%%
echo BLOODY PSYCHOPATH!
convert %CROPA% %ANNA% "BLOODY PSYCHOPATH!" %SCALE% @v0.txt v0.mng
echo HIGH-FUNCTIONING SOCIOPATH
convert %CROPB% %ANNB% "HIGH-FUNCTIONING SOCIOPATH" %SCALE% @v1.txt v1.mng
echo ...
convert %CROPB% %SCALE% @v2.txt v2.mng
echo WITH YOUR NUMBER.
convert %CROPB% %ANNB% "WITH YOUR NUMBER." %SCALE% @v3.txt v3.mng
echo :-D
convert %CROPB% %ANNB% ":-D" %SCALE% @v4.txt v4.mng
echo ...
convert %CROPB% %SCALE% @v5.txt v5.mng
:combine
echo Combine
convert -delay 1x24 -depth 8 -colors 255 -quantize YCbCr +dither -coalesce -layers optimize-transparency -loop 0 v0.mng v1.mng v2.mng v3.mng v4.mng v5.mng sociopath.gif
:end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment