Log in

View Full Version : split mp4 file like with mkvmerge


franketto
17th July 2014, 08:19
I have a mp4 file and I want to split it in several files based on frames position.

With mkvmerge I can write the cut frames like:
12566,34567, 37899 etc
but it outputs mkv files.

Is there a GUI that works similar for mp4 output?

I used ffmpeg CLI, but it wants to input the start and end point and also in the format 00:00:00.xx: more time consuming than mkvmerge...
Mp4box idem.

tebasuna51
17th July 2014, 08:51
- You can't split mp4 (or mkv) at exact frames (or time) because the cut must be at keyframes (not at P or B video frames).

- There are YAMB (http://yamb.unite-video.com/download.html) (a GUI for Mp4Box) and you can try also AviDemux (http://fixounet.free.fr/avidemux/download.html).

Selur
17th July 2014, 09:50
MP4Box based tools will probably not help, since mp4box itself is rather limited regarding cutting (see: http://gpac.wp.mines-telecom.fr/mp4box/mp4box-documentation/ under 'File Splitting and Concatenation') so cutting multiple sections would require multiple mp4box calls, which is why all the GUIs I can think of atm. to not support multiple cuts either.

AviDemux is probably the best choice, but afaik it doesn't support a cut list, you would have to select the frames manually.
(Start AviDemux and then scene by scene select the content you don't want and remove it, at the end set output format to "Mkv Muxer" then save the new file.)

regarding using ffmpeg: http://superuser.com/questions/681885/how-can-i-remove-multiple-segments-from-a-video-using-ffmpeg

franketto
17th July 2014, 10:48
I know it can't be exact frames (the same goes about start-end seconds: it approximates at keyframes ), but what I want is a simple approach like mkvmerge.
i.e you input some frames, comma separated and then it cuts all the parts in several mkv.
I find easier inserting 37456 vs 00:24:58.6

Instead with ffmpeg you must insert the start point in seconds.frames format and also the end point.

So, my question is:
(apart GUI that automatize the cli command), is it possible with some cli exe using the frames format like mkvmerge does, instead of start-end seconds format to obtain mp4 files?
I think it would be very useful having some GUI for mp4 similar to mkvmergeGui to cut video based on frames point cuts all in one step (even not with frame precision).

Avidemux works, but you must make all manual: CLI or GUI is more automatic and faster.

Selur
17th July 2014, 17:38
Avidemux also has a CLI version, but no clue if it supports cutting, that aside I haven't heard of any tool which does exactly what you want and I doubt that there is one atm.

hello_hello
20th July 2014, 10:36
Video To Video Converter (http://www.videohelp.com/tools/Video-to-Video-Converter) has a video splitter under the Tools menu. It won't let you specify a frame number (I don't think) but you can specify an exact time (the keyframe splitting limitation would still apply). It works with lots of different containers. There's also a "commercial remover" which does a similar thing. Unlike MKVMergeGUI (which I use regularly) both the splitter and commercial remover provide a preview.

I don't use Video To Video Converter much for encoding myself, but for "odd" muxing and editing jobs etc, I find it very handy. It's pretty good at remuxing from one container to another too.

There's a link to a portable version on the page I linked to which you can just download, unzip, and run. No installation required.

jones1913
20th July 2014, 12:11
@franketto

You can try this (assuming you are using windows):

http://forum.gleitz.info/showthread.php?46424-MP4-tool-GUI-f%FCr-MP4Box-und-L-SMASH

It supports cutting on a comma separated list of time indices in seconds or HH:MM:SS:nnn format (but not frames).
This is achieved by multiple mp4box calls.

The function can be found in "Split"-Tab -> "by time" -> "Timestamps"

franketto
20th July 2014, 12:38
@hello_hello
I tryed your suggestion of VideoToVideo, but it hasn't a good preview at the moment: it would be far better if similar to avidemux, skipping to I-frames and so precisely trimming. Anyway it could be useful for other presets conversions.

@jones1913
Thank you for that Mp4Box Gui: it's the most similar to mkvmerge approach.
At this point a combo of avidemux to get the correct I-frames in HH:MM:SS:nnn + your MP4GUI comma separated, do the job!

EDIT:
I tried the procedure and it works very good.
BUT avidemux has a bug in displaying time: it shows the ms (.nnn) with 80ms more than the correct position, so if the I-frames displayed shows .560, you must convert it to .480 if you want to make the split work perfect! In every case this is a problem of avidemux, not of the splitting tool...

manolito
7th January 2020, 03:14
VidCutter 6 is an FFmpeg based GUI for Windows. It has an option to do frame accurate cuts, but this does not always work. For cutting at key frames it very reliable.

If you need frame accuracy then the source file should be MP4 (works better than MKV), and it also helps to use the current FFmpeg version instead of the integrated FFmpeg version.

Development seems to have stopped a while ago...

videoh
7th January 2020, 03:14
@blackshady

Necroposting to spam crap is frowned upon here. Since you obviously don't care, I've reported you for spam.

manolito
7th January 2020, 03:17
@blackshady

Necroposting to spam crap is frowned upon here. Since you obviously don't care, I've reported you for spam.

Says the person who regularly spams this forum advertising his own commercial software... :scared:

videoh
7th January 2020, 04:46
Another triggered snowflake. So easy!

DGMPGDec, DGSplit, DGHDRtoSDR, Cube, etc., are very famous and free. Much of my work is open-source. Others such as jdobbs also have paid versions. It's only lowlifes like you that prevent all my stuff from being free. I'm an important contributor here. Get over it!

hello_hello
8th January 2020, 16:22
Another triggered snowflake. So easy!

DGMPGDec, DGSplit, DGHDRtoSDR, Cube, etc., are very famous and free. Much of my work is open-source. Others such as jdobbs also have paid versions. It's only lowlifes like you that prevent all my stuff from being free. I'm an important contributor here. Get over it!

Not that I don't appreciate your software, but I've got to ask, how does manolito prevent all your stuff from being free?