
How to trim a video and how to split a video into multiple files without re-encoding in Linux
July 19, 2024
Table of contents
1. How to do simple editing and splitting of videos into files without re-encoding
2. Download a program to trim videos without re-encoding. How to install LosslessCut
3. How to trim the beginning of a video in LosslessCut
4. How to trim the end of a video in LosslessCut
5. How to save a video fragment in LosslessCut
6. How to cut some parts from a video in LosslessCut
7. How to split a video into fragments
How to do simple editing and splitting of videos into files without re-encoding
You can trim a video (remove the beginning or end of a video), as well as cut a video fragment in absolutely any video editor – these are the most basic functions. But after this seemingly simple procedure, your video editor, when exporting the edited video (or its fragment), may begin to re-encode the video file.
And this may drag on significantly. In addition, since video files almost always use lossy formats, additional re-encoding will not improve the quality of your video, and may even worsen it.
Therefore, a obvious question arises: is there a program that will trim a video or cut out a fragment and be able to save it without re-encoding? There is such a program!
Download a program to trim videos without re-encoding. How to install LosslessCut
An excellent program that allows you to trim videos without re-encoding is LosslessCut.
In fact, LosslessCut has many other useful features, many of which allow you to perform actions on video without the need for re-encoding and, therefore, without loss of quality (lossless).
Official website of the program: https://github.com/mifi/lossless-cut
The easiest and most universal way to install LosslessCut is to download the portable version from the official website. To do this, go to https://github.com/mifi/lossless-cut/releases and download the LosslessCut-linux-x86_64.AppImage file for the latest release.
Note: The following executables are available for different Linux architectures:
- x64 tar.bz2
- x64 AppImage
- arm64 tar.bz2
- Raspberry Pi armv7l
Then unpack the archive.
To run a program, you must make the file executable. You can do this in the GUI:
Or on the command line, to do this, go to the directory with the program and run the command:
chmod u+x LosslessCut-linux-x86_64.AppImage
Now you can launch the program by double clicking.
If you want to remove LosslessCut, all you need to do is delete the file – the application is portable.
In distributions based on Arch Linux, you can install the program from the AUR, for example, using pikaur this can be done as follows:
pikaur -S losslesscut-bin
See also: Automatic installation and update of AUR packages
You can install LosslessCut from the app stores:
- Snap Store: https://snapcraft.io/losslesscut
- Flathub: https://flathub.org/apps/details/no.mifi.losslesscut
How to trim the beginning of a video in LosslessCut
Let's consider an example when you need to trim a fragment from the source video that is located at the very beginning.
1. Import (open) the video into LosslessCut. This can be done simply by dragging the file into the LosslessCut window.
2. Under the video window there is a time scale with which you can find the place you need in the video. Move the pointer to the beginning of the fragment you want to save.
3. Click the “Start current segment at current time” button.
4. Click the “Export” button.
5. Check your export settings (you can usually leave them unchanged).
6. Click the “Export” button again.
The following short video shows all the stages of trimming and exporting a video:
How to trim the end of a video in LosslessCut
Let's consider an example when you need to trim a fragment from the source video that is located at the very end.
1. Import (open) the video into LosslessCut. This can be done simply by dragging the file into the LosslessCut window.
2. Under the video window there is a time scale with which you can find the place you need in the video. Move the pointer to the end of the fragment you want to save.
3. Click the “End current segment at current time” button.
4. Click the “Export” button.
5. Check your export settings (you can usually leave them unchanged).
6. Click the “Export” button again.
How to save a video fragment in LosslessCut
Let's consider an example when you need to cut a fragment from the source video and save it.
1. Import (open) the video into LosslessCut. This can be done simply by dragging the file into the LosslessCut window.
2. Under the video window there is a time scale with which you can find the place you need in the video. Move the pointer to the beginning of the fragment you want to save.
3. Click the “Start current segment at current time” button.
4. Move the pointer to the end of the fragment you want to save.
5. Click the “End current segment at current time” button.
6. Click the “Export” button.
7. Check your export settings (you can usually leave them unchanged).
8. Click the “Export” button again.
How to cut some parts from a video in LosslessCut
Let's consider an example when you need to cut out several fragments from the source video, and combine the remaining parts and save them as one video file.
1. Import (open) the video into LosslessCut. This can be done simply by dragging the file into the LosslessCut window.
2. Under the video window there is a time scale with which you can find the place you need in the video. Move the pointer to the beginning of the fragment you want to delete.
3. Click the “End current segment at current time” button.
4. Move the pointer to the end of the fragment you want to delete.
5. Click the “Start the current segment at current time” button.
6. Move the pointer to the beginning of the next section you want to delete.
7. Click the “End current segment at current time” button.
8. Move the pointer to the end of the fragment you want to delete.
9. Click the “Start current segment at current time” button.
10. Repeat this operation until you have selected all the fragments to be deleted.
11. When you have finished deleting fragments, in the upper right corner, switch to the “Merge cuts” option.
12. Click the “Export+merge” button.
13. Check your export settings (you can usually leave them unchanged).
14. Click the “Export+merge” button again.
The following short video will show you how to cut some fragments from a video using LosslessCut.
How to split a video into fragments
Let's consider a situation where you need to split a video into several fragments. If desired, also cut out some parts.
1. Import (open) the video into LosslessCut. This can be done simply by dragging the file into the LosslessCut window.
2. Under the video window there is a time scale with which you can find the place you need in the video. Move the pointer to the point where you want to split the video file. That is, to the place that should become the end of the first video file and the beginning of the next video file.
3. Click the “Split segment at cursor” button.
4. Move the pointer to the point where you want to split the video file. That is, to the place that should become the end of the previous video file and the beginning of the next video file.
5. Click the “Split segment at cursor” button.
6. Continue doing these steps until you have split the video into the desired number of fragments.
7. If you wish, you can delete some fragments; to do this, click the “Remove segment...” button.
8. When you are done splitting the video into fragments, in the upper right corner, switch to the “Separated files” option.
12. Click the “Export” button.
13. Check your export settings (you can usually leave them unchanged).
14. Click the “Export” button again.
The following short video will show you how to split into several fragments in LosslessCut and save each fragment into a separate file:
Related articles:
- How to concatenate multiple videos into one file in Linux in GUI without re-encoding (HEVC and other video formats) (100%)
- How to enable 10-bit color depth on Linux (and whether to enable 30-bit color) (70%)
- Why Google Chrome web browser is gray when 10-bit color is enabled and how to fix it (70%)
- How to watch HDR videos on YouTube on Linux (70%)
- How to identify content with 10-bit color depth. How to check what color depth is used in a photo and video (70%)
- How to repair an LVM disk using fsck (RANDOM - 50%)