Create Time-lapse with FFmpeg Hardware Encoding
Creating a time-lapse video from a sequence of images can be highly resource-intensive for your CPU. By leveraging hardware acceleration—such as NVIDIA NVENC, Intel Quick Sync Video (QSV), Apple VideoToolbox, or AMD AMF—you can offload the processing to your graphics card to generate high-quality videos in a fraction of the time. This guide provides the exact commands needed to build a time-lapse from an image sequence using different hardware-accelerated encoders in FFmpeg.
Step 1: Prepare Your Image Sequence
Before running FFmpeg, ensure your images are sequentially named. The
most common format is a numbered sequence, such as
image_0001.jpg, image_0002.jpg, etc. In
FFmpeg, this pattern is represented as image_%04d.jpg
(where %04d represents a four-digit zero-padded
number).
Step 2: Choose Your Hardware Encoder Command
Run the appropriate command below based on your computer’s graphics hardware.
For NVIDIA Graphics Cards (NVENC)
NVIDIA GPUs use NVENC for extremely fast video encoding. This command uses the H.264 NVENC encoder:
ffmpeg -framerate 30 -i image_%04d.jpg -c:v h264_nvenc -pix_fmt yuv420p output.mp4For higher compression efficiency, you can use the H.265/HEVC encoder instead:
ffmpeg -framerate 30 -i image_%04d.jpg -c:v hevc_nvenc -pix_fmt yuv420p output.mp4For Intel Processors (Quick Sync Video - QSV)
If you are using an Intel CPU with integrated graphics, you can utilize Intel QSV:
ffmpeg -framerate 30 -i image_%04d.jpg -c:v h264_qsv -pix_fmt nv12 output.mp4For Apple Silicon & macOS (VideoToolbox)
Mac users with M1/M2/M3 chips or modern Intel Macs can use Apple’s native hardware acceleration API:
ffmpeg -framerate 30 -i image_%04d.jpg -c:v h264_videotoolbox -pix_fmt yuv420p output.mp4For AMD Graphics Cards (AMF)
If you have an AMD Radeon graphics card, use the Advanced Media Framework (AMF) encoder:
ffmpeg -framerate 30 -i image_%04d.jpg -c:v h264_amf -pix_fmt yuv420p output.mp4Command Parameters Explained
-framerate 30: Sets the speed of the time-lapse. In this case, FFmpeg will read 30 images per second of video. Adjust this number higher for a faster time-lapse, or lower for a slower one.-i image_%04d.jpg: Points to the input files. The%04dtells FFmpeg to look for sequential four-digit numbers.-c:v: Specifies the video codec (the hardware encoder).-pix_fmt yuv420p(ornv12): Sets the pixel format.yuv420pensures maximum compatibility across almost all media players and web browsers.output.mp4: The final output filename.