How to Trim/Cut Video Using FFmpeg (Detailed Guide)

Download Video Converter Ultimate for Free!

Trimming or cutting a video is a must-known editing skill for people to create videos today. There are many professional and easy-to-use video editors on the market now. Everyone can search for them online or in the app store for installing them to edit videos easily.

But today’s article is not going to introduce the way of using any video editing software to trim or cut videos, but using a less-known method, which is to use some FFmpeg commands. This method may be a little hard for some people to get started, but actually, it can help to accurately cut the videos without losing any quality but in very quick speed. Now, you can have a look at the tutorial and know how to control different FFmpeg commands to process the video trimming on computers accurately.

Catalog

How to Trim/Cut Video Using FFmpeg

FFmpeg is a completely free software, which can work with high speed to convert video and audio with original quality. People only need to enter some commands in the software, and FFmpeg will read them for processing the decoding, encoding, transcoding, editing, and other things you want it to do. To trim or cut a video using FFmpeg, there are several commands you can try, based on the needs you have. Now, let’s see how to control FFmpeg with different commands to trim videos easily.

FFmpeg Trim Video by Specifying the Duration

If you want to trim video for getting a specified duration from it, and save as a new video file, then you should enter this command to let FFmpeg process it:

$ ffmpeg -i input.mp4 -ss 00:05:20 -t 00:10:00 -c:v copy -c:a copy output1.mp4

 

This FFmpeg command is to let the software to cut out 10 minutes from the video “input.mp4” for you. “-ss” shows the starting point where you want to start trimming the video, and “-t” means the duration you want to trim out. So, this command means that FFmpeg will start trimming the video from “00:05:20”. After counting “00:10:00”, which is 10 minutes long, FFmpeg will directly cut at 00:15:20 accurately. Then the trimmed video will be saved as “output1.mp4” for you.

 

The “-c:v copy -c:a copy” command means that you are asking FFmpeg to process the original video by re-encoding a new one, so you can get the copied trimmed video at original quality without any losing, but don’t need to worry about damaging the original one.

FFmpeg Trim Video Using a Specific Time

Instead of trimming the video with duration, you can also control FFmpeg to cut it by specific time to start or end at the detailed timing. Here is the FFmpeg command you should use:

$ ffmpeg -i input.mp4 -ss 00:05:10 -to 00:15:30 -c:v copy -c:a copy output2.mp4

 

It is the same that “-ss” is showing FFmpeg the timing you want to start cutting the video, while “-to” is the ending timing. Using this command, FFmpeg will work to help you trim the video accurately from “00:05:10” to “00:15:30”. You need to make sure that the value of “-to” should not be smaller than “-ss”, or you would get an error message “Error: -to value smaller than -ss; aborting.”

FFmpeg Trim Video by Cutting the End of Video

When you just need to cut a video from its last several minutes or seconds, these two FFmpeg commands are just what you need:

$ ffmpeg -sseof -600 -i input.mp4 -c copy output5.mp4

$ ffmpeg -sseof -00:10:00 -i input.mp4 -c copy output6.mp4

 

These commands use “-sseof” to represent the last “n” seconds or minutes you want to cut from the video. You can use seconds like “-600” to show that you want to trim the last 600 seconds from the video; or use “-00:10:00” to mean cutting the last 10 minutes (the same as 600 seconds). If the value you enter is longer than the video length, the output video is completely the same as the original one.

FFmpeg Cut Video with/without Re-encoding

As mentioned before, if you use the “-c copy” option in the command while trimming a video, FFmpeg will re-encode a new video without directly trimming on the original file. You can change the output format to save the trimmed video using this command:

$ ffmpeg -ss 00:05:20 -accurate_seek -i input.mp4 -t 00:10:00 -c:v libx264 -c:a aac output7.mp4

 

For example, this command is going to re-encode the video as well as the audio during the trimming process. It also uses the “-accurate_seek” option to let FFmpeg cut the video more accurately.

Command Line of FFmpeg to Cut Several Parts from Video

There also has the command that can help people cut several parts from one video at the same time. You can try to edit and enter the following command to process it:

FFmpeg   – i  in.ts   -filter_complex \

“[0:v]trim=duration=15[a]; \

[0:v]trim=start=25:end=30, setup=PTS-STARTPTS[b]; \

[a] [b] concat [c]; \

[0:v]trim=start=40, setup=PTS-STARTPTS[d]; \

[c] [d] concat [out1]”  -map  [out1]  out.ts

 

This example shows that this command will cut the same video for getting 3 video clips, which is from 15-25 seconds, 30-40 seconds, the final from 40 seconds. You just need to change these values to trim the video to several parts based on your needs.

Best Alternative Way to Cut Video Easily with VideoSolo

FFmpeg may be complex for some people to understand and use. For those who still want an easy-to-use software to cut videos on Windows/Mac computers easily, VideoSolo Video Converter Ultimate is a reliable alternative to FFmpeg you can try. It is not only supported to convert video/audio to all common formats, but also provides the helpful tools inside to edit, compress, enhance, or adjust videos based on your needs. VideoSolo Video Converter Ultimate will be a suitable software for those who just want a simple way to cut videos within very easy clicks.

Key Features:

  • Provides very easy process to cut and trim videos within clicks
  • Offers more than 1000 formats to save the trimmed videos on computers
  • Offers more video editing tools such as cropping, adding filters, effects, and so on to adjust videos
  • Supports 50X faster speed to save the converted files offline without wasting much time
  • Keeps the best 8K/5K/4K/HD quality to output videos with the best condition

Ratings: ⭐⭐⭐⭐⭐

Step 1. Open VideoSolo Video Converter Ultimate and Import Video File

To begin, you need to install VideoSolo Video Converter Ultimate on your computer properly. Then open the software and you can directly drag the video file you want to trim to the home screen of it.

VideoSolo Video Converter Add Files

Step 2. Start Trimming Video

Click the “Cut” icon provided under the video information to enter the editor for beginning to trim the video. You only need to set the starting and ending points or drag the sliders on the timeline to decide where to trim the video. In this in-built editor, you can also use other video editing tools to edit the trimmed video if you need.

VideoSolo Video Converter Cut Video

Step 3. Select Output Format to Save the Trimmed Video

When you save the trimmed video, you will return back to the home screen. Now you can go to “Convert All to” for selecting the output format and quality to save the trimmed video.

VideoSolo Video Converter Select Output Format

Step 4. Convert the Trimmed Video for Saving Offline

Finally, directly click the “Convert” button, and VideoSolo Video Converter Ultimate will begin to save the trimmed video to your computer. This process only takes very short time, so you can quickly get the output offline for playback or sharing it later.

VideoSolo Video Converter Converting Video

In Conclusion

Using FFmpeg to trim videos can control the cutting to be more accurate, but this method would be difficult for some people to use. As a result, this article also prepares the best alternative way to cut videos, which is to use VideoSolo Video Converter Ultimate. So according to your preferences, just choose the better method for yourself when you have the video trimming needs.

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments