I found that I have a few different use cases in my workflow: Here’s the same command above changed to output ProRes: ffmpeg -framerate 30 -pattern_type glob -i "folder-with-photos/*.JPG" -s:v 1440x1080 -c:v prores -profile:v 3 -pix_fmt yuv422p10 my-timelapse.mov Workflow and usages of codecs ![]() More details on ProRes with FFmpeg and a comparison of some other codecs can be found here. Unlike H264, each frame in a ProRes video is independent of the other frames - while this means much less compression, it also means better performance inspecting individual frames in video editing software. This is a high quality codec (and it generates very large file-sizes) intended for usage during video editing rather than for playback. I use 17 when I want visually nearly lossless video, with manageable file-sizes. The range is 0–51 and a lower number means higher quality and higher file-size. The most important parameter for encoding H264 is probably crf, which determines the compression level and quality of the output. More details on encoding H264 with FFmpeg can be found here. This is what I would use for my final output, to be uploaded to an online platform. The most commonly used codec on the web today is H264, which gives excellent quality video at amazingly small file sizes. The world of video codecs is vast, and I don’t have the knowledge to delve deep into it, so I’m just going to go briefly over my practical understanding. Video codecs and formats H264 and ProRes ![]() The parameters before -i are all input options, and those after it are all output options. Note: There is some significance in the ordering of FFmpeg parameters. Ideally, your frame-rate should not be below 24 or the video will likely appear choppy. Play with the frame-rate to try out different time-lapse speeds. I did this immediately with my raw images, before doing anything further, just to get a preview of the output. This should create a quick time-lapse from your photos. pix_fmt: this needs to be set to yuv420p to allow many players, such as Quicktime to play the video (the FFmpeg docs say *dumb* players, I’ll be more forgiving).crf: A parameter specific to the H264 codec that determines the quality/compression.c:v: The output video codec (here, H264).Ensure that the aspect ratio matches your photos to avoid skewing the images (we’ll talk about cropping later). Note that this, as with most other things on a UNIX command line, is case sensitive. i: a pattern that matches all the input photos in your timelapse.pattern_type: we set this to glob to tell ffmpeg to use all the images that match the pattern in the following parameter.framerate: the number of images to render per second in the video.The final parameter is the filename of the output video. ![]() ffmpeg -framerate 30 -pattern_type glob -i "folder-with-photos/*.JPG" -s:v 1440x1080 -c:v libx264 -crf 17 -pix_fmt yuv420p my-timelapse.mp4 Let’s run a quick command to convert them into a video. I’ll also assume your sequence of images is ready in a single folder and are named such that they’re displayed in the order that they should be rendered. I’m going to assume you have FFmpeg set up (if not, here’s some info on how to install it) and know how to run it on terminal. But when things start to get more intricate it can be painful to work without the immediate feedback a video editing application gives you - for example when you’re trying making timing changes to sync up to your audio track, or zooming/panning.įirst step - a quick and dirty time-lapse But once I discovered how powerful the open-source command-line program FFmpeg is, I decided to give it a try.īefore I dive in, I should say that putting together a video on the command-line is quick, and efficient and gives you a lot of fine-grained control when you’re doing simple things (a straight time-lapse, joining together videos with simple transitions, cropping, adding an audio track in). Free software was limited and didn’t have much control, and I’m not quite ready to invest money into more professional software yet. Trying to find the right application to put the video together quickly got frustrating. I bought a cheap, second hand GoPro Hero 3+ Silver and a portable tripod to get started, and took them along on a trip to Manning Park. So it seemed like a good opportunity to experiment with time-lapse myself. I’ve been going camping a lot this summer, and I’m discovering just how spectacular British Columbia is. Time-lapse has fascinated me since I watched Terje Sørgjerd’s videos many, many years ago.
0 Comments
Leave a Reply. |