Log in

View Full Version : mkvtoolnix/x264 muxing worries and problems


twist3d
22nd October 2005, 11:46
Hi!

I have encoded quite a few mpeg-4 clips and have always muxed them
successfully to matroska container. Now it seems impossible :confused:

Encoding with latest sharktooth's cli x264.exe (now b333e and tried also b327):
x264.exe --ref 3 --bitrate 1400 --bframes 3 --weightb --b-pyramid --me umh --mixed-refs --analyse all
--8x8dct --aq --pass 1 --progress --output movie.mp4 movie.avs
x264.exe --ref 3 --bitrate 1400 --bframes 3 --weightb --b-pyramid --me umh --mixed-refs --analyse all
--8x8dct --aq --pass 2 --progress --output movie.mp4 movie.avs
the resulting .mp4 file plays fine in media player classic using latest ffdshow (18.10.2005) and haali's splitter. Then onto muxing video, credits and .ac3-soundtrack to matroska container:
"C:\enk\mkvmerge.exe" -o "C:\enk\movie.mkv" -d 1 -A -S C:\enk\movie.mp4 -d 1 -A -S +C:\enk\kred.mp4
--sync 0:0 -a 0 -D -S "C:\enk\audio DELAY 0ms.ac3" --track-order 0:1,2:0 --append-to 1:1:0:0
gives error: The file no. 0 ('C:\enk\movie.mp4') does not contain a track with the ID 0, or that track is not to be copied. Therefore no track can be appended to it. The argument for '--append-to' was invalid.

Is the .mp4 b0rked or can I somehow write that ID 0 to the mp4 file with mp4box or similar tools? Thanks in advance :thanks:

bond
22nd October 2005, 12:13
the avc tracks in x264 .mp4 files are always with trackid 1, set the mkvmerge cmdl according to it or use the gui

twist3d
22nd October 2005, 12:23
Thanks for your quick reply, but actually the mkvmerge gui gives me that exact commandline (as i have been using the gui).
I drag the movie.mp4 in it, append the credits and add the .ac3-track :rolleyes:
What would be working commandline in my case so I can mux the files straight from the prompt?

I got the muxing to work by changing the track-order in cli to 1:1:0:1 but the output file is not playable :( gives a error code: Couldn't find SegmentInfo

Revgen
22nd October 2005, 17:53
I'm not quite sure, but I believe that MP4Box can take RAW x264 files and mux them into an .mp4 container.

Have you tried that?

stephanV
22nd October 2005, 18:01
"--append-to 1:1:0:1"

IIRC...

[edit] im slow...

use mkv output in x264 cli next time :p

twist3d
22nd October 2005, 18:23
This is really starting to hit my nerves. I tested muxing only the movie.mp4 and the .ac3 audio track and they work great together (as do credits.mp4 and .ac3 track). Now the problem is isolated to muxing the movie.mp4 and credits.mp4 together. I re-encoded the credits with same settings as the main movie (only with bitrate 100), mkvtoolnix exits now with a error log which consists of thousands of lines, example:
Packet 4521, timecode 1319175680, bref -107989504, fref -1
I used the most basic muxing with:
mkvmerge.exe -o test.mkv movie.mp4 +credits.mp4


yeah, I give up. I'll encode this crap again with .mkv output :D


[EDIT 2]
got it working finally with a workaround:
wrapped the both .mp4 files in .mkv-container seperately (mkvmerge -o movie.mkv movie.mp4) and then muxed the resulting .mkv files and ac3 track in avimuxgui. no re-encoding needed :devil:
[/EDIT 2]