View Full Version : How do i mux a raw AVC stream into MP4?
tomos
16th September 2006, 16:23
i've read the HowTo Edit H264/AVC TS Streams (http://forum.doom9.org/showthread.php?t=114361) thread a little further down the page since i want to get a h.264 transport stream into an mkv file.
i've ran it through mplayer and have a 264 file. the prob now, is i cant get it to an mp4 file.
i've tried mp4box like this:
mp4box -add c:\clip.264 -new d:\clip.mp4
i get this error
error importing. Bitstream not compliant
i've tried with the MP4 muxer in MEGUI and this is what the log says:
Cannot find H264 start code
(BitStream Not Compliant)
Error importing C:\clip.264: BitStream Not Compliant
to begin with, i thought the TS itself may be damaged as i couldnt get video - only audio when playing. downloading the latest haali splitter sorted that out but i still cant get it muxed to an mp4 file
can anyone help?
SeeMoreDigital
16th September 2006, 18:31
I use YAMB to mux raw MPEG-4 AVC streams into MP4 ;)
bond
16th September 2006, 18:44
:readrule: :search:
tomos
16th September 2006, 19:21
I use YAMB to mux raw MPEG-4 AVC streams into MP4 ;)
thanks for that see more.., unfortunately, i had a similar error Cannot find H264 start code - Muxing failed.
will keep the GUI tho, :)
Bond, i did search, e.g mux avc mp4 etc etc. never got anything useful
Eeknay
17th September 2006, 12:45
I assume you're trying on a BBC stream or some sort of 1080i h264 file... mp4creator is supposedly the only method that works at this time. I haven't tried myself.
bond
17th September 2006, 13:34
once again:
1) every video stream has to start with a keyframe.
2) those avc ts captures dont start with keyframes as the capture process simply starts anywhere in the stream
3) mp4box and mp4creator need to be fed with a stream that starts with a keyframe. just because mp4creator doesnt give you an error message, like mp4box, when you feed it with a stream not starting with a keyframe doesnt mean it writes a 100% correct file (yeah, mp4creator writes a slightly borked mp4 file on those captures as there is still garbage at the start of the file). or to say it in a different way: there is a reason why mp4box gives you the error
therefore you need to remove everything from your avc stream that is before the first keyframe. this can be done with
1) a hexeditor (nothing for newbies) or, more easier
2) by demuxing the avc stream from .ts to .264 with _mencoder_ (not mplayer or ffmpeg or anything else), as mencoder removes all the garbage before the first keyframe
3) by only capturing starting with a keyframe (afaik there is no such tool _yet_)
SeeMoreDigital
17th September 2006, 14:31
Just to let some of you guys know, Kurtnoise13's latest build of MP4Box (0.4.3 - Dated 2006-08-28) works very well at muxing and de-muxing MPEG-2 and MPEG-4 AVC streams placed within TS....
Cheers
tomos
17th September 2006, 17:36
thanks all. got this going with avc2avi
bond
17th September 2006, 17:38
thanks all. got this going with avc2aviavi is not mp4 ;)
tomos
17th September 2006, 17:49
yeah i know, but i couldnt get it going yesterday into an mp4 container no matter what.
grabbed the newer mp4box that seemore... mentioned and will grab mencoder that you mentioned bond, just in case - for next time
Eeknay
18th September 2006, 10:00
3) mp4box and mp4creator need to be fed with a stream that starts with a keyframe.
Doh. Never tried with a keyframe edited file... you're right, works fine now with MP4Box.
:stupid:
MacGyver2k
8th October 2006, 13:19
hi,
me and a friend have done a quick tool which removes the garbage before the first keyframe for h.264 raw streams.
the files work nice with mp4box in the latest version.
although it does only work with files smaller 4gb, if bigger mp4box counts over 100/100 when importing. the file is playable in VLC but slows down and speeds up during playback and i wasn't able ro repair it.
if someone is interested i can upload it.
~
mac
bond
8th October 2006, 19:41
yeah, that would be nice!
MacGyver2k
8th October 2006, 19:57
ok
here it is.
syntax is: mtk.exe <src-file> <dest-file> [cellsize MB]
default cellsize is 1MB, i made the fastest results with 20-30MB on my machine.
hope it works for you - i tried it with 3 recordings which gave me the imprting error before.
:edit:
found a bug with big files, should be fixed now
~
mac
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.