PDA

View Full Version : mkvmerge - The codec's private data does not match


Selur
14th September 2007, 20:09
here's the problem:

I got two mkv(avc,mp3) files which I want to append using mkvmerge or avimux gui.
(you can grab the files here and here)

According to avinaptic (see here and here) the x264 settings to create the files are identical (just other releases were used). (I also tried without audio, which didn't help either; audio should be encoded the same way to)

When I try to append the files mkvmerge gives me the following warning:
Warning: The track number 1 from the file '...Video2.mkv' can probably not be appended correctly to the track number 1 from the file '...Video1.mkv': The codec's private data does not match (lengths: 41 and 40). Please make sure that the resulting file plays correctly the whole time. The author of this program will probably not give support for playback issues with the resulting file.

The resulting file has the correct length audio plays fine, but the video only play up to the end of Video1, after that video is frozen.

So, here's my question:

1. how can I change the 'codec's private data' that they match and the files can be merged?
2. it is possible to merge x264 encodes that were encoded with differend revisions,as long as the features used are the same, is it?


Hope someone can shed some ligh to solve this problem and yes I used google and the forum search but didn't find an a solution, but since I'm human I might have overlooked it, so don't flame me if I did. ;)

Thx to all who try to help. :)

Cu Selur

Ps.: x264 settings used were: x264.exe --crf 20 --level 5.1 --keyint 240 --min-keyint 24 --ref 5 --mixed-refs --no-fast-pskip --bframes 3 --b-pyramid --b-rdo --bime --weightb --direct temporal --filter 1,1 --subme 7 --analyse all --8x8dct --vbv-maxrate 25000 --qcomp 1 --me umh --threads auto --thread-input --progress --no-psnr --no-ssim

Kurtnoise
15th September 2007, 09:13
2. it is possible to merge x264 encodes that were encoded with differend revisions,as long as the features used are the same, is it?
merge both avc streams into a single mp4 and then mux it into a new mkv file...:)

Selur
15th September 2007, 09:54
1. demuxed both streams with mkvextract
2. started yamb 2.0.0.8 -> Editing -> 'Click to join supported files'
3. added the both files via drag&drop and set the framerate of both files, selected an output name and Yamb merged the files (filesize fits)
-> yamb doesn't append the files, it muxes them parallel (same goes for yamb 1.6)

Seems like yamb(mp4box) too doesn't seem to like the files,.. :(

Cu Selur

Ps.: same happens when I try to mux them separatly in an mp4 shella nd then try to merge.

Kurtnoise
15th September 2007, 10:27
the fact is : the avc samples differ in the settings (1 byte though)...:) That's why to create a mp4, you need to force the concatenation :

MP4Box -force-cat -add input1.h264:fps=25.000 -cat input2.h264:fps=25.000 output.mp4

A recent MP4Box is of course needed...

Force-cat is not included into Yamb for the moment.

Selur
15th September 2007, 10:32
works fine thanks :)

Any idea what's causing this 1byte difference?

Kurtnoise
15th September 2007, 10:38
no idea...

Selur
16th September 2007, 02:23
Not what I hoped for but no biggy, since the forced concatenation worked. :D

Cu Selur

bond
16th September 2007, 12:42
Any idea what's causing this 1byte difference?run h264_parse from mpeg4ip over both raw streams and check where the sps/pps are different

please note that force-cat is dangerous when used with streams where the sps/pps differ a lot

Selur
16th September 2007, 13:15
only difference I spot is:

Video1:
timing_info_present_flag: 1
num_units_in_tick: 10427
time_scale: 500000
which delivers a timing of: 47,952047952047952047952047952048

versus

Video2:
timing_info_present_flag: 1
num_units_in_tick: 1001
time_scale: 48000
whicht delivers a timing of:
47,952431188261244845113647261916

=> Any clue what is causing the difference of "0,00038323621329279716159930987" and is there a way to avoid it?

Cu Selur

Ps.: Removed infos about each frame from the output of h264_parse and attached it. :)

bond
16th September 2007, 13:22
either the two input files before encoding used different framerates or the muxer set it differently for both

in the end i think its ok to use force-cat for this

Selur
16th September 2007, 13:29
must be the original Framerate of the inputs, since I remuxed both files with a framerate of 25 for the videostream,.. :)