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.
Using FTP and PHP to get an array of file details such as size and…
Creating and using Laravel form requests to create cleaner code, separation and reusability for your…
Improving the default Laravel login and register views in such a simple manner but making…
Laravel validation for checking if a field value exists in the database. The validation rule…