Log in

View Full Version : MP4Box: Trying to concatenate multiple MP4 files


Attack
4th October 2011, 07:21
I've been handed a ton of mp4 files recorded on some camera to turn into a dvd. They merge just fine using "-cat". They're info all looks pretty identical to this (used mediainfo).
General
Complete name : D:\Users\Matthew\Desktop\new-vid\SDV_0387.MP4
Format : MPEG-4
Format profile : JVT
Codec ID : avc1
File size : 13.8 MiB
Duration : 17s 17ms
Overall bit rate : 6 819 Kbps
Encoded date : UTC 2003-01-31 16:06:00
Tagged date : UTC 2003-01-31 16:06:00

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : Baseline@L3.0
Format settings, CABAC : No
Format settings, ReFrames : 1 frame
Format settings, GOP : M=1, N=15
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 17s 17ms
Bit rate mode : Variable
Bit rate : 6 649 Kbps
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 3:2
Frame rate mode : Constant
Frame rate : 29.970 fps
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.642
Stream size : 13.5 MiB (98%)
Language : English
Encoded date : UTC 2003-01-31 16:06:00
Tagged date : UTC 2003-01-31 16:06:00

Audio
ID : 2
Format : AAC
Format/Info : Advanced Audio Codec
Format profile : LC
Codec ID : 40
Duration : 16s 939ms
Bit rate mode : Constant
Bit rate : 128 Kbps
Channel(s) : 2 channels
Channel positions : Front: L R
Sampling rate : 24.0 KHz
Compression mode : Lossy
Stream size : 256 KiB (2%)
Language : English
Encoded date : UTC 2003-01-31 16:06:00
Tagged date : UTC 2003-01-31 16:06:00

My problem is I need to insert a short (one second) black frame in between each video as they do not blend well into each other. I also need just a short intro. So I wrote something in avisynth, pretty simple stuff, used one of the videos to create the other frames, so I thought that would match it up.
Used x264. Tried to join, but I end up with two streams. Insert blank audio, end up with two streams as well. Removed the audio from both, still end up with two streams.
General
Complete name : D:\Users\Matthew\Desktop\new-vid\intro.mp4
Format : MPEG-4
Format profile : JVT
Codec ID : avc1
File size : 255 KiB
Duration : 6s 5ms
Overall bit rate : 348 Kbps
Encoded date : UTC 2011-10-03 01:23:51
Tagged date : UTC 2011-10-03 01:23:51

Video
ID : 1
Format : AVC
Format/Info : Advanced Video Codec
Format profile : High@L3.0
Format settings, CABAC : Yes
Format settings, ReFrames : 3 frames
Codec ID : avc1
Codec ID/Info : Advanced Video Coding
Duration : 6s 5ms
Bit rate : 25.8 Kbps
Maximum bit rate : 115 Kbps
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 3:2
Frame rate mode : Constant
Frame rate : 29.970 fps
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Bits/(Pixel*Frame) : 0.002
Stream size : 18.9 KiB (7%)
Writing library : x264 core 78 r1302 6169a3f
Encoding settings : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.0:0.0 / mixed_ref=1
/ me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=3 / nr=0 / decimate=1 / mbaff=0
/ constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=1 / wpredb=1 / keyint=250 / keyint_min=25 / scenecut=40
/ rc_lookahead=40 / rc=crf / mbtree=1 / crf=24.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.40 / aq=1:1.00
Encoded date : UTC 2011-10-03 01:23:51
Tagged date : UTC 2011-10-04 01:27:31Obviously something here is causing incompatibilities. Now I could recode everything, but I'd really prefer not to, so I don't do another step before converting it to a dvd.
Anyone able to tell me what I need to do with x264 to get it to fit with the other video?

Attack
7th October 2011, 08:33
If someone knows the answer, I'd be interested in hearing it. For now I've gone the long route. Few scripts to join ten or so at a time, then another avs script to join the resulting files and then that got sent through favc.

sneaker_ger
7th October 2011, 12:19
I don't even understand your problem, nor do I understand what you have tried so far. First you speak about using "mp4box -cat", then suddenly "scripts"/"avs", then x264 (which doesn't have any cat abilities) while you seem to aim for a DVD (FAVC) as the end result - and I have no idea what you mean by "two streams".

From the things I've seen so far: you might need to create a silent AAC track for your intro and black inserts, so all files match in all aspects. Then you can cat either through AviSynth, mp4box or mkvmerge. (My experiences are better with mkvmerge, less buggy than mp4box).
Post all your scripts, command lines, steps taken, error messages etc. - then someone might be able to help you.

Stanislav Mikhailenko
15th October 2011, 18:28
You could try to use SolveigMM Video Splitter 2.4 Beta (http://www.solveigmm.com/download/SolveigMM_Video_Splitter_2_4_Beta.exe) It supports MP4 files splitting and joining without reencoding.

First you need to make "one second black frame file" (e.g. from the original video) using trimming function of the Splitter. Sample instructions are here: How to Edit AVI Files (http://www.solveigmm.com/en/howto/how-to-split-avi-file-with-video-splitter/).

Then use joining function of the Splitter to catenate files inserting "one second black frame file" between video files. Sample instructions are here: How to join AVI files (http://www.solveigmm.com/en/howto/how-to-join-avi-files-with-video-splitter/)

Any problems can be posted to forum's branch Beta Testing - Video Splitter 2.4 Beta - MP4, AVCHD smart editing, joining (http://www.solveigmm.com/forum/index.php?topic=3197.0).

CruNcher
16th October 2011, 01:14
Stanislav huh why 2.4 and not 2.5 which is the latest and even official ?
So .mp4 support didn't made it yet into 2.5 ?

Tough i guess you guys waiting to productize it yet as another feature version :P
http://www.solveigmm.com/en/products/comparison/

Stanislav Mikhailenko
16th October 2011, 17:35
Stanislav huh why 2.4 and not 2.5 which is the latest and even official ?
So .mp4 support didn't made it yet into 2.5 ?

Tough i guess you guys waiting to productize it yet as another feature version :P
http://www.solveigmm.com/en/products/comparison/

Latest official Release is 2.5 - but there is no MP4 support yet. We are working on it. 2.4 version is latest Beta that works with MP4 files.