View Full Version : How to cut mkv (mp4) files without recompression
DavidXanatos
9th January 2010, 23:38
How to cut mkv (mp4) files without re compression.
I know that I can't cut at arbitrary points without recomression, but cutting at kay frames suffice my needs.
As I could do it with avi files and VirtualDub.
PS: as we are talking about cutting, how can I reconstruct a damaged avi index block so that I can cut again with VirtualDub, the build in rebuild seams to not be that perfect as than I cant skip between key frames
roozhou
10th January 2010, 08:31
Cutting mkv: ffmpeg, mkvtoolnix
Cutting mp4: ffmpeg, mp4box
nakTT
10th January 2010, 08:34
Cutting mkv: ffmpeg, mkvtoolnix
Cutting mp4: ffmpeg, mp4box
How about cutting and join? Let say I want to remove a few minutes in the middle of a video. Will the tools take care of my audio too? (no re-encode for audio too).
:thanks:
roozhou
10th January 2010, 09:22
@naKTT
Just cut and join
stax76
11th January 2010, 14:42
Cutting mkv: ffmpeg, mkvtoolnix
How does cutting work with mkvtoolnix (is there a switch for mkvmerge)?
MuLTiTaSK
11th January 2010, 15:20
@stax76
MKVMERGE (http://www.bunkus.org/videotools/mkvtoolnix/doc/mkvmerge.html)
File splitting and linking (more global options):
--split size:<d[k|m|g]> or shorter --split <d[k|m|g]>
--split duration:<HH:MM:SS.nnnnnnnnn|ns> or shorter --split <HH:MM:SS.nnnnnnnnn|ns>
--split timecodes:A[,B[,C...]]
Splits the output file after a given size or a given time. Please note that tracks can only be split right before a key frame. Due to buffering mkvmerge will split right before the next key frame after the split point has been reached. Therefore the split point may be a bit off from what the user has specified.
At the moment mkvmerge supports three different modes.
1. Splitting by size.
The parameter d may end with k, m or g to indicate that the size is in KB, MB or GB respectively. Otherwise a size in Bytes is assumed. After the current output file has reached this size limit a new one will be started. The size: prefix may be omitted for compatibility reasons.
2. Splitting after a duration.
The paramter must have the form HH:MM:SS.nnnnnnnnn for specifying the duration in up to nano-second precision or a number n followed by the letter ’s’ for the duration in seconds. "HH" is the number of hours, "MM" the number of minutes, "SS" the number of seconds and "nnnnnnnnn" the number of nanoseconds. Both the number of hours and the number of nanoseconds can be omitted. There can be up to nine digits after the decimal point. After the duration of the contents in the current output has reached this limit a new output file will be started. The duration: prefix may be omitted for compatibility reasons.
3. Splitting after specific timecodes.
The parameters A, B etc must all have the same format as the ones used for the duration (see above). The list of timecodes is separated by commas. After the input stream has reached the current split point’s timecode a new file is created. Then the next split point given in this list is used. The timecodes: prefix must not be omitted.
For this splitting mode the output filename is treated differently than for the normal operation. It may contain a printf like expression ’%d’ including an optional field width, e.g. ’%02d’. If it does then the current file number will be formatted appropriately and inserted at that point in the filename. If there is no such pattern then a pattern of ’-%03d’ is assumed right before the file’s extension: ’-o output.mkv’ would result in ’output-001.mkv’ and so on. If there’s no extension then ’-%03d’ will be appended to the name.
--split-max-files <n>
Create at most n files, even if the last file will be longer or larger than indicated by --split.
DavidXanatos
22nd January 2010, 19:29
Command line tools aren't what I need, I have to do a lot of cuts while reviewing the video.
Foofaraw
26th January 2010, 00:01
Command line tools aren't what I need, I have to do a lot of cuts while reviewing the video.
Don't use mp4 then, use mpg2
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.