Log in

View Full Version : AVC/H.264 into .MP4 muxing with MP4Creator


bond
27th August 2004, 22:07
anyone already tried muxing h.264 streams into .mp4 with the mp4creator tool from mpeg4ip? from what i saw in the latest sources there has been some h.264 support added, but atm i cant try it out myself whether it works already

from what bill may told me i think it only supports raw .264 input, but i am not sure about it, would be great if someone could compile the latest sources and make some tests, for example playing the resulting files with the nero or sorenson (mainconcept?) dshow filters

bond
31st August 2004, 23:42
noone? according to bill may it should already create spec compliant avc-in-mp4 files

ak
1st September 2004, 16:04
Yeah, I tried, resulting mp4 won't play in mp4player (maybe it just indicates that my system is somewhat b0rked atm).
With DS it builds graph, but then crashes on playback.
Mp4creator indeed can only dig 'raw' .h264 and needs fps to be specified in cmdline.

bond
1st September 2004, 18:01
Originally posted by ak
With DS it builds graph, but then crashes on playback.what filters did you use for playback? the ones from nero? the 3ivx ones dont handle h.264 atm

ak
1st September 2004, 20:27
No it was 3ivx + ffdshow, I'll try with nero next time.

bond
1st September 2004, 20:57
you might also want to try the videolan player (latest nightly build) for testing the files (doesnt handle b-frames tough)

ak
1st September 2004, 21:53
Oops, actually it was Nero parser + ffdshow. Nero own video decoder opens ActiveMovie window and then has this to say: http://4nykey.nm.ru/pics/nero.png

Forgot to mention, vlc plays these files more or less w/o probs.

bond
2nd September 2004, 17:57
Originally posted by ak
Oops, actually it was Nero parser + ffdshow. Nero own video decoder opens ActiveMovie window and then has this to say: http://4nykey.nm.ru/pics/nero.pngthats indeed very interesting!!!

i get the same message when i try to play .mp4 files muxed with videolan by using the nero filters. i always thought that this is videolans fault, but now that mp4creator show the same results i think it might also be the nero parser....


btw: as you say it it seems that its possible now to connect ffdshow to the nero parser, till now this wasnt the case

Forgot to mention, vlc plays these files more or less w/o probs. what does "more or less" mean?

ak
2nd September 2004, 19:43
Doesn't matter, it appears to be x264 or lavc issue, stuff encoded with stock x264 encoder is screwed when played with vlc or mplayer, while mencoder encodes (which uses the same x264 lib) are ok.

Kurtnoise
8th December 2004, 16:05
Isn't maybe the right place to ask that but Celtic_Druid could you update the mpeg4ipTools from your site ?? thanks. ;)

There is a new one :

Mpeg4ip release 1.2 contains: Added 3GP, .mov support to mp4v2 Added ffmpeg decoder support (MPEG-2, H.264, MPEG-4, Sorenson, AMR) Added H.264 support to mp4v2, mp4creator, player, mpeg2t Added --disable-xvid flag to bootstrap Better checking for compile flags in configure Fixes for gcc 3.4 Made mp4info work with most .mov files Changed player plugin format to pass what media we're looking from (MP4 FILE, MPEG FILE, RTP, etc). Fixed 5.1 downconvert to stereo in player Mac OSX support for player player support for 1:1 aspect ratio Added AMR and H.263(rfc2429) hinters and RTP plugins player support for H.263 and AMR through ffmpeg Updated some of UCL RTP library 1.2.16 changes Rewrote player audio renderer for long term sync Fixes for player rtp base class for long term sync Allow player to handle timestamp discrepancies. Removed libmpeg3, added mpeg program stream reader code Multi-output mp4live from Cesar Gonzalez

gotaserena
8th December 2004, 16:57
A quick compile of mp4creator version 1.2 for the impatient:

grap it here (http://s17.yousendit.com/d.aspx?id=19ADD84E8E583B8F0BBF8CE93202DAB8)

bond
9th December 2004, 01:39
thanks gotaserena!

anyone having success playing these files with the new nero filters (or other players)? i tried it with vlc and enviviotv, but both didnt work (but i think enviviotv is also not really spec compliant)

btw to mux avc/h.264 streams into .mp4 by using mp4creator use the following commandline:
mp4creator60.exe -c raw-avc-stream.h264 -rate 25 avc.mp4-rate defines the input stream framerate (necessary to set, otherwise it wouldnt work)
-c defines the input stream (afaik mp4creator only supports importing of raw avc streams till now. i tried it with both the .264 and .h264 extension, made no difference)

neo75903
9th December 2004, 01:46
@gotaserena:
off topic, but about mp4creator, are those muxing issues resolved in this version?
mp4creator tend to create files which are not playable in Quicktime without 3ivx. See related tool as mp4ui.

gotaserena
9th December 2004, 12:22
@bond: I've been decoding the stream with the moonlight splitter and ffdshow and it works. Sort of. I imagine the code is very new and not so optimised yet. So a 640x512 video gobbles up all my cpu power. What makes me suspect the code is that the same behaviour shows up with mplayer. I've got to grab Nero and start playing with it, but I did not so far.

But I did forget to tell everyone to use avi2raw in the h.264 stream before muxing it to .mp4.

@neo75903: the muxing problems are, as far as I could tell, gone since version 1.1.17. About H.264 QT compatibility, frankly I haven't toyed around yet. But it makes me think that, if mp4ui can make a QT compliant stream, it should be just a matter of selecting the right switches of mp4creator. Another thing to keep in mind is that, if QT requires ISMA compliance, then we're out of luck until the soon-to-be-released ISMA 2.0 with H.264 and HE-AAC specs is implemented in mpeg4ip.

neo75903
9th December 2004, 13:50
Originally posted by gotaserena
@bond: But it makes me think that, if mp4ui can make a QT compliant stream, it should be just a matter of selecting the right switches of mp4creator.

That was mp4ui problem, it didnt created streams QT could read properly because it was based on earlier versions of mp4creator.
I will try this later on.

bond
9th December 2004, 23:16
Originally posted by gotaserena
So a 640x512 video gobbles up all my cpu power. What makes me suspect the code is that the same behaviour shows up with mplayer. I've got to grab Nero and start playing with it, but I did not so far.huh, that sounds not good at all :/
especially that nero doesnt handle it (i doubt that mplayer supports avc-in-mp4 already, as ffmpeg to my knowledge also doesnt do it), also i am not sure whether moonlights splitter is already stable

But I did forget to tell everyone to use avi2raw in the h.264 stream before muxing it to .mp4.why that? or do you simply mean avc-in-avi files?

About H.264 QT compatibility, frankly I haven't toyed around yet. But it makes me think that, if mp4ui can make a QT compliant stream, it should be just a matter of selecting the right switches of mp4creator. Another thing to keep in mind is that, if QT requires ISMA compliance, then we're out of luck until the soon-to-be-released ISMA 2.0 with H.264 and HE-AAC specs is implemented in mpeg4ip.qt is a very poor tool, related to .mp4
1) it doesnt support avc-in-mp4
2) it only supports simple profile mpeg-4 streams in .mp4 (so no qpel, gmc or b-frames), also qt will not handle even a simple profile video stream if it is signalled as advanced simple in .mp4!
3) qt doesnt handle mp3-in-mp4

make sure that all this is avoided before thinking that other tools are to be blamed if a file doesnt work in qt!
to my knowledge mp4ui/mp4creator .mp4 files should work in qt

ak
9th December 2004, 23:47
Originally posted by bond
i doubt that mplayer supports avc-in-mp4 already, as ffmpeg to my knowledge also doesnt do it
Well, it does support it for quite some time, in fact, I think, before anything else (publically available that is).

neo75903
9th December 2004, 23:54
@bond:
QT support for mp4 is idd very poor, therefor i am looking forward to the next version which provides a wider support for this format including h264.
The reason i am so on QT is becoz its true streaming capability. At 1500kbps, which thx to XVID always is undersized anyway, with Simple Profile@level 3,the quality is as much i hoped for.
I caint find another free solution for my current Darwin/QT combination.
And it has to be said, if it works even the greatest dummy at home can watch my movies :)

mp4creator60 created files are still a problem in QT and sometimes even in media player. Audio muxed files are not synchroon with the picture.

bond
10th December 2004, 00:15
Originally posted by ak
Well, it does support it for quite some time, in fact, I think, before anything else (publically available that is).wow, didnt know that :)
do you know who wrote the code for it? (afaik its not supported in ffmpeg till now?)

Originally posted by neo75903
QT support for mp4 is idd very poor, therefor i am looking forward to the next version which provides a wider support for this format including h264.lets hope so :)

And it has to be said, if it works even the greatest dummy at home can watch my movies :)thats indeed a big upside of qt
afaik streaming should also be supported by the freely available .mp4 filters from dicas in directshow (as darwin pretty much is THE mpeg-4 streaming solution, i am pretty sure they will work together)
realplayer also should have native support for simple-profile .mp4 files, but i am not so sure about it whether streaming works

mp4creator60 created files are still a problem in QT and sometimes even in media player. Audio muxed files are not synchroon with the picture.hm, thats bad, you might want to have a look at mp4box, which should be much more reliable (i dont know any existing bugs in it for example) :)

ak
10th December 2004, 00:51
Originally posted by bond
wow, didnt know that :)
do you know who wrote the code for it? (afaik its not supported in ffmpeg till now?)
I don't, but you can always check cvs logs ( http://www1.mplayerhq.hu/cgi-bin/cvsweb.cgi/main/libmpdemux/demux_mov.c?sortby=date )

bond
10th December 2004, 01:12
thanks, seems as if "rtognimp" is to blame :D

hubereevez
16th December 2004, 20:00
Hi,

sorry, but I'm a little bit lost....... I did already read posts about avc.....

1) Nero recode do not produce mp4 compliant file ? right ?

2) When creating h264 avc, there is no final tool capable to mux it with he-aac audio. But I did lol, or is it not compliant ? Did try with mp4UI, seems to produce a valid mp4 file (readable iwth mpc).

3) Adding subs or chapter seems to be more difficult to make a valid avc+he-aac .mp4 file. Srt , sub ? ssa ?

Could someone clear things up ?

thanks to bond, I did try muxers on the Faq page. But still lost about mp4creator (cmd tool on rarewaves ?), mpeg4ip (03/2004 !!).

Thanks

Hubert

neo75903
16th December 2004, 21:53
I would not mux with mp4creator as i have to many playback issues with other players. MPC is a robust player and can virtual play anything if there is a DirectShow filter for it. So dont rely to much on it.
I use videolan and Quicktime as my reference player.
- Videolan coz it is written as the standard provides.
- Quicktime coz it is a mainstream player, important for distribution.

mp4box has my preference as it files are playable in most of the players.

I dont have Nero so caint say about this. And as for MP4UI, which suffers from the same probs as mp4creaotor as it is based on it.

Do a search on this forum and you find lots of info about mp4box.

hubereevez
16th December 2004, 23:26
Hi,

Videolan coz it is written as the standard provides.

Plays choppy with latest h264 avc from nero

mp4box has my preference

I already red this (http://forum.doom9.org/showthread.php?s=&threadid=84830&highlight=mp4box). Just wonder which tools is mp4 compliant and avc proof. Moreover it's strange to dl a tool from 05/2004 (rarewares : w$ compiled) when we speak about h264 avc, nope ?

thanks

hubert

neo75903
17th December 2004, 01:12
you got a point there. I am not doing interested in h264 yet and older tools works fine with AVC.
You reminds me back then trying to get AVC done.

bond
17th December 2004, 21:59
Originally posted by hubereevez
1) Nero recode do not produce mp4 compliant file ? right ?no, it should produce compliant files

2) When creating h264 avc, there is no final tool capable to mux it with he-aac audio. But I did lol, or is it not compliant ? Did try with mp4UI, seems to produce a valid mp4 file (readable iwth mpc).try muxing the avc stream first into .mp4 (or simply take the one outputted by nero digital) and than try to mux the aac-he stream into this .mp4 with mp4box (by using -add)
make sure to have a backup file of your avc .mp4 files somewhere ;)

3) Adding subs or chapter seems to be more difficult to make a valid avc+he-aac .mp4 file. Srt , sub ? ssa ?mpeg-4 defines its own subtitle format (not .srt, not .ssa aso...). you can add such subtitle streams to .mp4 with the latest mp4box (some weeks old, the one on rarewares is outdated, use forum search to find new compiles)
the other possibility would be to place the dvd subtitle stream (aka vobsub) into .mp4. only nero recode2 using the nero directshow muxer can do this till now

hope this helps :)

hubereevez
19th December 2004, 22:46
It did help :)
Thanks

[Nero] should produce compliant files
i red that it could be not compliant due to specific subtitle format and/or chapter.....

I'm working on adding subs with mp4 creator, what about chapters ? Should I add them with this bif files ?

thanks

edit : forgot the pat about chapters in the faq :( sorry. Will not try ahead's method.......

bond
21st December 2004, 17:44
Originally posted by hubereevez
i red that it could be not compliant due to specific subtitle format and/or chapter...note that neros files dont break the mpeg-4 standard.
still normally the mpeg-4 standard defines the storage of subtitles via the mpeg-4 timed text format. which i would suggest to use (such files can be created with mp4box by importing .srt subs)

I'm working on adding subs with mp4 creator, what about chapters ? Should I add them with this bif files ?no, i would try setting the chapters by muxing the file with the nero dshow muxer (and afterwards add the subs with mp4box to that file)

bond
28th December 2004, 21:58
ok i now tested the interoperability with mp4creator the following way:
1) created an avc-in-avi file with x264 (mencoder) by using the default settings (cabac, loop, no b-frames)
2) extracted the raw avc stream with mpeg4ips avi2raw tool
3) imported the raw avc stream to .mp4 with mpeg4ips mp4creator

and the resulting file plays fine with
- nero .mp4 parser and avc decoder
- moonlight .mp4 splitter and avc decoder (seeking seems to be buggy or at least very cpu consuming)
- videolan
- mplayer

so without b-frames, mp4creator seems to be pretty usable already :)


when doing the same with a sample using 2 b-frames in a row:
- with moonlight i get choppy playback
- with videolan and mplayer (which dont handle decoding b-frames with cabac!) i get "jumpy" playback (picture jumping back/forwards in small steps)
- with the nero filters i get exactly the same effect as with mplayer/videolan!

bond
1st January 2005, 23:05
hum seems as if mp4creator drops a few frames when importing from raw to .mp4 (4 frames in my recent test), still the files are played fine

bond
3rd January 2005, 15:50
maybe someone is interested in/or will be intersted in it in the future:
importing raw avc to .mp4 with mp4creator will remove the headers (00 00 00 01), and the sequence and picture headers (SPS and PPS (Sequence Parameter Set and Picture Parameter Set)).
So it might be possible for the mp4 file to be smaller than the raw stream, but for very large sequences.

mp4creator -extract will only write the sequence and picture headers at the beginning of the stream, not before each I picture like a lot of the encoders do (and as its allowed by the mpeg-4 avc specs).

Originally posted by bond
hum seems as if mp4creator drops a few frames when importing from raw to .mp4 (4 frames in my recent test), still the files are played fine this has been fixed as described here (https://sourceforge.net/forum/message.php?msg_id=2920792)

bond
18th January 2005, 16:28
b-frame support should be working now in mp4creator. would be great if someone could make a new compile :)

celtic_druid
18th January 2005, 16:58
Did that earlier. It is currently being mirrored, could take awhile though.

bond
18th January 2005, 18:22
thanks! :)

i tried now a 2 b-frames sample created with x264 and it plays fine with
- moonlight splitter and moonlight decoder
- nero parser and ffdshow decoder (somehow the nero decoder doesnt connect anymore to the parser even with nero created files :( )
- mplayer

behaviour didnt change with videolan, but i assume thats because vlc doesnt use latest ffmpeg decoder, able to handle b-frames

JoeBG
18th January 2005, 18:33
Originally posted by bond
thanks! :)

i tried now a 2 b-frames sample created with x264 and it plays fine with
- moonlight splitter and moonlight decoder
- nero parser and ffdshow decoder (somehow the nero decoder doesnt connect anymore to the parser even with nero created files :( )
- mplayer

behaviour didnt change with videolan, but i assume thats because vlc doesnt use latest ffmpeg decoder, able to handle b-frames

Where did you get the new mpeg4iptools? I really canīt find a mirror. :( Or did you mean you testet a AVI? AVIīs look very nice with 2 b-frames in mplayerc or mplayer.

bond
18th January 2005, 18:47
i tested .mp4

the mirrors will have it soon :)

RadicalEd
18th January 2005, 23:34
Great news :D

JoeBG
19th January 2005, 06:10
Originally posted by bond
the mirrors will have it soon :)

No luck until now :( There is only one mirror with mpeg4iptools, last update 13. January :scared:

opsis81
19th January 2005, 10:26
http://4nykey.nm.ru/misc/mpeg4ip.7z

JoeBG
19th January 2005, 11:02
Thanks a lot :)

bond
20th February 2005, 00:56
version 1.2.6 is out and fixes a problem when importing avc streams which use so called SEI messages (as used by ateme/nero and moonlight)
of course b-frames importing works correctly too already for some time...

the only problem i am aware of atm is that mp4creator doesnt write the necessary "ctts" atom when importing avc streams which use reordered frames (produceable with mainconcept's encoder, but hardly exist)

cheers :)

bond
24th April 2005, 14:58
version 1.2.18 is out and fixes some issues with ctts writing for multiple avc b-frames, including reordered frames/b-references/b-pyramid and multiple sliced b-frames

thx to fenrir for that :)