For readers who are unfamiliar with FFmpeg, the name refers to a framework for editing multimedia content. This includes all types of media in nearly all formats available today and several that are no longer in use as well.

Essentially, FFmpeg is a command-line utility that works across all major OS platforms, including Windows, macOS, Linux, BSDs, Solaris, and so on. In short, you can run it on literally any computer regardless of the configuration, architecture, or build environment.

Now that we’ve got the description out of the way, let’s get into the ffmpeg split video function and the many ways in which a video file can be split to exact specifications, such as ffmpeg split video into frames, ffmpeg split video into parts, ffmpeg split video by size, and dozens of options like these.

Part 1: 7 Ways to Use the FFmpeg Split Video Function

As mentioned earlier, FFmpeg can be used on any computer. If you’re familiar with packaging software then you can directly download the original source code for the framework. If not, there are ready packages available for Linux, Windows, and Mac. You’ll find all of them in the FFmpeg download page here. Once you’ve installed the application on your computer, use Terminal, CMD, or any command-line interface to run the various commands. The 7 most frequently used ones are shown below:

Before digging into how to use FFmpeg, keep in mind the powerful command: ffmpeg -ss 00:00:05 -t 6 -i input.mp4 -vcodec copy -acodec copy output.mov.

  1. -ss means beginning time.

  2. -t is the length of final part

  3. -i is the input file, in the above case it’s a file called ‘input.mp4’

  4. -vcodec stands for the video codec to encode the output file. ‘copy’ means you’re using the same codec as the input file.

  5. -acodec is the audio codec.

  6. output.mp4 is the output file, you can rename it as you need.

You may also want to know: Rotate Videos using FFmpeg

1. FFmpeg Split Video into Frames

This command allows you to extract specific frames from a video, which are basically image files that make up the video. For example, if the video runs at 24 frames per second, it means there are 24 images displayed on your screen every second when the video is playing. This command can be used to split videos into frames and extract the individual frames. The command works as shown in the steps below:

1. Open Terminal (in Mac) and enter the following command to navigate to your video folder. It’s important that you always run ffmpeg commands in the folder where the source content is stored.

As an example, you can type cd ~/Videos followed by Enter.

2. The next command splits your video into frames and stores each one as a separate image thumbnail file.

ffmpeg -i video.mp4 thumb%04d.jpg -hide_banner

That’s it. You can now go to the same folder location and pick out the image you need.

2. FFmpeg Split Video by Size

This command lets you cut a larger video into a smaller one of a specific file size. It is useful when you have a lot of unwanted footage and only need a specific portion in a specific size for the purpose of uploading or sharing. Here’s what to do:

In Terminal or any command-line interface, enter this command:

./split-video.sh huge-video.mov 64000000 "-c:v libx264 -crf 23 -c:a copy -vf scale=960:-1"

The source code for the above command can be accessed here. In the command, the number 64000000 represents 64MB, which means your video will be split into chunks of 64MB each. This is only approximate. You can change that number to specify the size of chunks you need.

3. FFmpeg Split Video into Parts of Equal Duration

This command can be used to split a video into multiple parts of identical durations. This is useful for social media sites where specific video durations are required or preferred. You can use this command:

ffmpeg -i "input_video.MTS" -ss 164 -f segment -segment_time 120 -vcodec copy -reset_timestamps 1 -map 0:0 -an output_video%d.MTS

4. FFmpeg Split Video by Scene

This one is a little tricky and doesn’t always detect individual scenes in an accurate manner, but you can give it a go:

split.sh -d 0.5 -o /tmp/parts -f file.mp4

The script for this can be found here. As an alternative, you can use PySceneDetect by installing it with this command if you have Pip (the Python Package Manager) on your system:

pip install scenedetect[opencv,progress_bar]

Following this, you can use the scenedetect function to split the video:

scenedetect --input my_video.mp4 detect-content list-scenes split-video

5. FFmpeg Split Video by Time or Duration

You can also use the ffmpeg command to split a video into parts of varying durations. The command for this is shown below:

ffmpeg -ss 00:00:00 -t 00:50:00 -i largefile.mp4 -acodec copy \ -vcodec copy smallfile.mp4

The above command will split the video at 50 minutes from the beginning. You can change that as you like. Simply repeat the process for the remaining portion of the video to get multiple parts.

6. FFmpeg Split Video by Width

This function allows you to crop a video to a particular width to suit specific devices during playback. It is also helpful when you have unwanted elements in the edges of the shot. To split a video by width, use this command:

ffmpeg -i input.mp4 -filter:v "crop=iw*(5/10):ih*(5/10):iw:0" output.mp4

In the example above, the video will be cropped to half the width and half the height. To keep the same height, just change that parameter into 10/10 for the ih component. There are several variations of this command, but this should work just fine. You can also maintain the aspect ratio by using a :keep_aspect=1 parameter inside the quote marks in the example shown above. The command would then look like this:

ffmpeg -i input.mp4 -filter:v "crop=iw*(5/10):ih*(5/10):iw:0:keep_aspect=1" output.mp4

7. FFmpeg Split Video Horizontally

This is essentially the same cropping function but, instead of cropping it to a smaller width, you will be keeping the width the same and reducing the height of the video by 50%. Here are the commands with and without the aspect ratio component:

ffmpeg -i input.mp4 -filter:v "crop=iw*(5/10):ih*(5/10):iw:0" output.mp4

ffmpeg -i input.mp4 -filter:v "crop=iw*(5/10):ih*(5/10):iw:0:keep_aspect=1" output.mp4

Similar to cropping vertically, in this case, change the iw component’s value to 10/10 to keep the same height, and use the aspect ratio to created a cropped file with the same ratio as the source file.

Part 2: Tips to Split Videos Losslessly with FFmpeg

1. Lossless Split Video Command (keep first portion)

By default, FFmpeg will split videos and re-encode them, which can cause some amount of quality loss. To avoid this, you can use the copy codec for audio and video in the corresponding ffmpeg split video command. It will look something like this:

ffmpeg -i originalvideo.mp4 -ss 0:0:4 -t 0:1:10 -vcodec copy -acodec copy outputvideo.mp4

The command above will split it to a specific segment as defined by the timeline parameters. In this example, the split will start at 4 seconds and end at 1 minute and 10 seconds. You can change the parameters as you like, but the important thing is to use the copy codec, or else you may see a loss of quality.

2. Lossless Split Video Command (keep both portions)

A variation of this command can be used to save both portions after the video is split:

ffmpeg -i largefile.mp4 -t 00:50:00 -c -vcodec copy -acodec copy smallfile1.mp4 \ -ss 00:50:00 -c -vcodec copy -acodec copy smallfile2.mp4

You can also just use the -c copy parameter to copy audio and video from the original to the output, which will result in lossless quality.

3. Check the Quality of the Original File

One very important aspect that many users miss is the fact that their original source file needs to be high-quality. It’s a good idea to have 4K or a similar high resolution for your input file. If not, the poor quality from your source file will be copied to your output file and therefore have the same quality.

4. Use the Man FFmpeg Command to Learn More Video Split Functions

As a final tip, you can run the $ man ffmpeg command in Terminal to fetch the FFmpeg manual. This will show you a lot of advanced commands for the following actions:

ffmpeg split and join video

ffmpeg split flv video

ffmpeg split mp4 video

ffmpeg split video by chapter

ffmpeg split video by frame number

ffmpeg split video lossless

ffmpeg split video mp4

ffmpeg split video parts

ffmpeg split video scene detection

...and so on.

Part 3: An Easier Way to Split Video for Free [Without Quality Loss]

Filme is a premium video editor that is now free for use for any purpose, personal or commercial, check out the giveaway offer here >> As a robust tool with comprehensive edit, effects, audio, and other functions, it can be used to easily split a video or crop a video to exact specifications. Filme also allows you to merge videos after splitting them and use transitions to avoid abrupt scene jumps. The collection of audio tracks, transitions, filters, and other effects is quite impressive. Here’s the basic overview of features for splitting and cropping videos in Filme.

ffmpeg

    • Trim the ends of a video

    • Split a video into two or more parts

    • Crop and resize videos with pixel-level accuracy

    • Custom and preset ratios for cropping

    • Timeline zoom in/out feature for greater accuracy

Get 1-Month FREE License (Limited Time)

How to Split a Video in Filme

Here's the video tutorial for how to split a video with Filme

  1. To split a video, import the file or drag and drop it into the timeline in Filme.

  2. Move the playhead (the marker with the vertical line that shows the current play position) to where you want the split.

  3. ffmpeg

  4. Click the scissors icon (split video icon) to cut the video at that position.

One of the key features here is that you can zoom into and out of a timeline to position your playhead for a more accurate video split. There is a +/- and a slider on the top right-hand corner of the software window that allows you to control the zoom. This will not affect the video in any way but merely gives you better control over the playhead position.

Additional functions are also abundantly available, such as creating a video slideshow with the fast video mode, editing images, effects, editing text, and much more. It also features advanced tools like white balance, rotation, PiP, quality conversion, media merging, slow motion and fast motion speed control, and so on. In short, it’s the only video editor you’ll ever need again.

To get a free and unrestricted copy of Filme, simply head over to the product page and share it with your friends on Facebook and your Twitter followers. We’ll send you a license key absolutely free!