FFmpeg allows you to choose a start time for a video and a finish time or duration and it will chop that part out and save it. There are two ways to do this, the first will cut the video and do no re-encoding, meaning it will be quick but the video most likely will be large and uncompressed. The second method will do a cut and re-encode, taking longer but compressing the file.
ffmpeg -ss 01:20:44 -i input.mp4 -t 00:02:00 -c copy output.mp4
The above command will make a 2 minute file called output.mp4 running from 1 hour, 20 minutes and 44 seconds through to 1 hour, 22 minutes and 44 seconds from input.mp4.
ffmpeg -ss 01:22:44 -i input.mp4 -c:v libx264 -preset slow -crf 23 -t 00:02:00 output.mp4
The above command does the same as the first one except it will compress the file, it takes longer but the end file will be smaller.
To read up on FFmpeg and encoding settings read here.
A drained and empty Kennington reservoir images from a drone in early July 2024. The…
Merrimu Reservoir from drone. Click images to view larger.
Some early September spring shots from a bushwalk, It is still too early for wildflowers.
I recently needed to clone over a smaller NVMe to a 2TB SK Hynix Platinum…
If you ever needed a simple solution in Laravel to delete an entire directory and…
How to enforce only one user to register or be registered in a Laravel web…