Skip to main content

How to create a sample of a video using FFmpeg

· One min read

Setting up

First make sure you have FFmpeg installed. Follow this guide if you haven't already:

https://docs.tdarr.io/blog/how-to-install-ffmpeg

Running the CLI

To create a sample of a file using FFmpeg, use the following command:

ffmpeg -ss 00:00:0 -i "C:\Transcode\input.mkv" -t 00:00:30 -map 0:v? -map 0:a? -map 0:s? -map 0:d? -c copy "C:\Transcode\output.mkv"

You can set the start time of the sample using the -ss flag. Set the duration of the sample using the -t flag. For example, to have a sample which starts at the 11 second mark and runs for 43 seconds, use the following:

ffmpeg -ss 00:00:11 -i "C:\Transcode\input.mkv" -t 00:00:43 -map 0:v? -map 0:a? -map 0:s? -map 0:d? -c copy "C:\Transcode\output.mkv"

You can automate this process using Tdarr.

info

Get started using Tdarr transcode automation for free with this link:

https://tdarr.io/download/