posts from @ionchy tagged #ffmpeg

also:

magicbottle
@magicbottle

In my last post I made a gif from a video I took. I had always used various apps or websites to do it before but I decided to use ffmpeg this time. It was a lot simpler then I had feared! I'm posting this partly so I don't forget, but maybe it will inspire you to make some gifs.

  
ffmpeg
-i video_from_phone.mov \ The -i is for the input file! in this case it is a 720p video. -filter:v crop=720:720,scale=-1:400 \ The -filter:v means we're going to modify the video, with the following instructions, first we crop the video to a square resolution of 720 by 720 pixels, centered in the middle of the video. Because this is a 720p video we're cutting off part of the top and bottom but retain the full width. Gifs are large so we want to scale it to be even smaller, 400 pixels tall in fact. The -1 in the width:height pair means ffmpeg will pick the right number to maintain the aspect ratio. We'll still have a square gif in the end. -r 15 \ The -r is the frame rate of our gif, at 15 frames per second. -ss 22 \ I didn't want to convert the entire video to a gif, so the -ss argument seeks the video to 22 seconds, starting the conversion process from there. -t 15 \ I didn't want the rest of the video after 22 seconds, so I chose to make the duration 15 seconds long. shiny_new.gif And finally, the output filename for our shiny new .gif; ffmpeg knows you want a .gif because of the filename here!

Also yeah, I wanted to do some more CSS posting.


@ionchy shared with: