S
S
SOTVM2018-03-17 19:23:57
Command line
SOTVM, 2018-03-17 19:23:57

Gifsicle commands (how to remove animation frames)?

please help with the gifsicle manual , I
figured out some parameters, but I don’t understand how to delete, say, every 2nd frame in the animation.
or everything after 50
tried
gifsicle -b anim.gif --delete #50- -o anim.gif
or do you need to extract all the frames>delete the necessary>collect back?
you can extract it like this, but I don’t know what to do next
gifsicle --explode anim.gif

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SOTVM, 2018-03-21
@sotvm

PS
I still couldn't master gifsicle , but I found a more universal way through ffmpeg ,
you can both cut from video and change gif .
cut out 5 sec. fragment starting from 90sec. from Full HD video 1920*1080 38.240 fps 3 000 Kbps the animation file turned out to be very large 28.1 MB (28102149 bytes) we will add parameters to reduce the number of frames and resolution.ffmpeg -ss 90 -t 5 -i "video.mp4" "default.gif"
the file has become much smaller than 2.4 MB (2428084 bytes)
by default, without the -gifflags -transdiff parameters , the created animation will be optimized,
and if we do not need it, then add them to the command

ffmpeg -ss 90 -t 5 -i "video.mp4"  -vf fps=10,scale=720:-1  -gifflags -transdiff -y "without_optimmize.gif"
so now the file has become a little more than 3.9 MB (3924420 bytes)
in the same way you can convert one gif file to another by changing the necessary parameters,
for example: take the very first file default.gif 28.1 MB (28102149 bytes)
in my it has 192 frames ≈ (38.240 fps x 5 sec.), if I want to delete every 4,
then we count (38-38 / 4 ≈ 29 ) and substitute fps = 29 into the parameter
ffmpeg  -i "default.gif" -vf fps=29:-1 -y "default_to_29fps.gif
and through the parameters trim=start_frame=12:end_frame=431 , you can set the start / end frame by frame,
ffmpeg -ss 90 -t 5 -i "video.mp4"  -vf trim=start_frame=12:end_frame=73,fps=10,scale=720:-1 -y "frames_12-73.gif"
the rest , ffmpeg commands/examples, you can peep here and there
,

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question