Log in

View Full Version : AVC in AVI vs. Mp4 wrapper?


absinthe
2nd March 2005, 20:48
I used Nero Recode for the first time recently for AVC compression, which of course output an Mp4 file.

I decided to give the open-source x264 codec a shot, so I installed and created a short sample file using the same procedures I use to create XviDs (i.e. I did it with VirtualDub). VirtualDub of course puts out an AVI file.

I can't play back my file, basically. I've installed ffdshow, but I think I read somewhere in the forum about an installer flaw that doesn't register the codec.

Regardless, my question is: do AVC files have to be in an MP4 file ... or can they be in an AVI?

-abs

bond
2nd March 2005, 20:52
Originally posted by absinthe
Regardless, my question is: do AVC files have to be in an MP4 file ... or can they be in an AVI?an avc stream can be in any container which is capable of handling the stream :)

eg .avi cant handle arbitrary coding orders of avc :D

absinthe
2nd March 2005, 21:22
Ok, thanks :)

So now my question(s) is (are):

-What do I use for a front end in order to output AVC in an MP4 wrapper? (I don't use AutoGK or other one-click tools).

-I did see a tutorial that mentioned "MP4UI" for multiplexing. Can I just create the video through VirtualDub (into an AVI), and then use MP4UI to import the video from the AVI?

-Can I have an AVC Mp4 without any audio?

-Am I right about ffdshow not being registered? I prefer to watch everything in Media Player Classic.

-Lastly, as a matter of curiosity, can Nero Showtime play back open-source x264 files?

Sorry to revert to newb status ....

-abs

mezzanine
2nd March 2005, 21:32
Originally posted by absinthe
Ok, thanks :)

So now my question(s) is (are):

-What do I use for a front end in order to output AVC in an MP4 wrapper? (I don't use AutoGK or other one-click tools).

-I did see a tutorial that mentioned "MP4UI" for multiplexing. Can I just create the video through VirtualDub (into an AVI), and then use MP4UI to import the video from the AVI?

-Can I have an AVC Mp4 without any audio?

-Am I right about ffdshow not being registered? I prefer to watch everything in Media Player Classic.

-Lastly, as a matter of curiosity, can Nero Showtime play back open-source x264 files?

Sorry to revert to newb status ....

-abs

-If you plan to backup dvd's you can always try my autoAC GUI, very easy to use. http://forum.doom9.org/showthread.php?s=&threadid=90732
-If you use virtualdub and avi you have to convert the avi into a raw stream first to mux it into an MP4.
-Yes you can have an AVC MP4 without audio.
-In FFDSHOW you must configure it to decode h264 video streams(make sure you have the latest build first).
-Yes Nero Showtime can play open-source x264 files. But you can also use mplayer or Osmo4.

bond
2nd March 2005, 21:45
mp4ui cant handle avc!

mezzanine
2nd March 2005, 22:41
Use mp4muxer for AVC.
http://forum.doom9.org/showthread.php?s=&threadid=89803

absinthe
3rd March 2005, 02:01
Ok, so I've grabbed mp4muxer and its needed tools, but I still can't create anything playable. I'm inputting mp3 audio and an AVI file containing AVC that was output by VirtualDub. I assume the output file is this "tmpf4.mp4," but for some reason the proggie also outputs the files "dummysub.srt," "tmpf3.h264," "tmpf5.xvid," and "vdummy.mp4.," all of which appear to be basically empty or dummy files.

I can't play the file in MPC, Osmo, or Nero Showtime. ffdshow is installed, but I don't see anywhere in its config where I can set it up for mp4/AVC decoding.

Here's the log from mp4muxer:
LogWindow - Status
1] "C:\WINDOWS\system32\mp4creator.exe" -c "D:\\dummy.aac" "D:\\vdummy.mp4"
Dummy MP4 -> D:\\vdummy.mp4 generiert
skipping aac extraction (1) - no mp4 input!
skipping aac extraction (2) - no mp4 input!
2] "C:\WINDOWS\system32\avi2raw.exe" -v "D:\h264test.avi" "D:\\tmpf3.h264"
3] "C:\WINDOWS\system32\avi2raw.exe" -e=8 -v "D:\h264test.avi" "D:\\tmpf5.xvid"
skipping h264 extraction - no mp4 input! <- This doesn't look right!
skipping mp4box aac -> mp4 migration. - no aac converted tempfile found...
4] "C:\Program Files\GPAC\MP4Box.exe" -add "D:\x264.mp3" "D:\\vdummy.mp4" -out "D:\\tmpf4.mp4"
skipping aac -> mp4 conversion
skipping -> mp4 conversion
h264/xvid processing...
5] "C:\WINDOWS\system32\mp4creator.exe" -c "D:\\tmpf3.h264" -rate 25 "D:\\tmpf4.mp4"
6] "C:\WINDOWS\system32\mp4creator.exe" -c "D:\\tmpf5.xvid" -rate 25 "D:\\tmpf4.mp4"
7] "C:\WINDOWS\system32\mp4creator.exe" -c "D:\h264test.avi" -rate 25 "D:\\tmpf4.mp4"
Keine Untertitelspur 1 gefunden...Generiere Dummy-SRT
dummy.srt generiert.
using Dummy Subtitle File.
skipping also Sub 2 File. No Subs added.
8] "C:\Program Files\GPAC\MP4Box.exe" -add "D:\\dummysub.srt" "D:\\tmpf4.mp4" -out "D:\\CompleteVideo.mp4"
9] "C:\Program Files\GPAC\MP4Box.exe" -optimize "D:\\CompleteVideo.mp4"
Löschen der Tempfiles erfolgreich.
Fertig!
I'm still trying to figure out what I can use to do nothing but encode video using the x264 codec, besides VirtualDub that is.

-abs

absinthe
3rd March 2005, 04:39
Also, why does the command line indicate "rate 25?" My video was 29.97.

-abs

ivan_alias
3rd March 2005, 10:30
Ok, so I've grabbed mp4muxer and its needed tools, but I still can't create anything playable. I'm inputting mp3 audio and an AVI file containing AVC that was output by VirtualDub. I assume the output file is this "tmpf4.mp4," but for some reason the proggie also outputs the files "dummysub.srt," "tmpf3.h264," "tmpf5.xvid," and "vdummy.mp4.," all of which appear to be basically empty or dummy files.

There are lots of ways to do this actually!

A simple way is to use mencoder and MeGui from Doom9

here (http://forum.doom9.org/showthread.php?s=&threadid=87567&perpage=40&pagenumber=6)

That will output in avi for now, although mp4 support is planned I believe.

Also, have you tried Gknot? The recent betas support x264. (again in avi)

Your method in Virtualdub should also work just fine - it sounds like playback is the problem here.

To play it back you just need a recent version of ffdshow that has been configured to decode h264. (its just an option in the properties of the decoder) then you should be ableto play it in media player classic.

Alternatively have you tried a recent build of videolan for playback?
Or perhaps mplayer, that will also playback x264, most likely ffplay will too.

Videolan builds (http://vthr.via.ecp.fr/~videolan/)

(and even possibly for transcoding/encoding if its fixed now.. I've not checked)

Stick with it!

Ivan

JoeBG
3rd March 2005, 14:01
Originally posted by absinthe
Also, why does the command line indicate "rate 25?" My video was 29.97.

-abs

So mp4muxer will not work for you, sorry for this :(

Doom9
3rd March 2005, 14:25
That will output in avi for now, although mp4 support is planned I believe.
Actually, MP4 output is already possible.. it just doesn't seem to work for everybody (obviously it works on my box or I'd have never released it). The next build which contains tons of improvements, is days away now. Hopefully, all the MP4 problems will be gone by then.

twist3d
3rd March 2005, 14:48
isn't "ac3-in-mp4" impossible (at least by the specs?)
/me jumps to the video mp4 bandwagon when hd-dvd/blu-ray hit the streets :)

absinthe
3rd March 2005, 15:08
So is MeGui something I can use to feed in an AviSynth script, config the codec, and output in an Mp4?

I really don't like 1-clickish tools. I gave a quick look at AutoAC, but it doesn't seem to allow enough configuration. I.e., I tried a DVD of TV episodes. AutoAC just asks for the IFO file, so I pointed it to that, and it seemed to indicate it was only 43 minutes long. But that's just one of the episodes on the disc (they're all in one titleset).

-abs

stephanV
3rd March 2005, 15:41
Originally posted by twist3d
isn't "ac3-in-mp4" impossible (at least by the specs?)

It is not impossible, but not very convenient either...


/me jumps to the video mp4 bandwagon when hd-dvd/blu-ray hit the streets :)
Is the MP4-container gonna be used for them?

Doom9
3rd March 2005, 15:58
So is MeGui something I can use to feed in an AviSynth script, config the codec, and output in an Mp4? Exactly. RAW output and AVI output is also supported. In the future, AAC encoding (and muxing in MP4) will also be supported. You can access all x264 options, pretty much all the XviD options and a good number of the lavc mpeg-4 options and can configure the rest by changing the autogenerated commandline.

And you can have your own profiles for video and audio encoding (as many as you like.. just select input, output, load profile and you're set to go), and there's a flexible queueing system like you know it from VDub (with imho some improvements over it like a more accurate start/end time, indication of the average FPS and codec and encoding mode for each job).

mezzanine
3rd March 2005, 16:09
Originally posted by absinthe
So is MeGui something I can use to feed in an AviSynth script, config the codec, and output in an Mp4?

I really don't like 1-clickish tools. I gave a quick look at AutoAC, but it doesn't seem to allow enough configuration. I.e., I tried a DVD of TV episodes. AutoAC just asks for the IFO file, so I pointed it to that, and it seemed to indicate it was only 43 minutes long. But that's just one of the episodes on the disc (they're all in one titleset).

-abs

If you have discs with episodes in one titleset you can always use dvdshrink to split them and then AutoAC. I know that's not a smart way but it's the only one right now.

absinthe
4th March 2005, 02:35
Ok, I was able to create a short, 1-minute sample mp4 that did in fact play in MPC. Odd, though, that MPC said was it 5 min 27 sec long, when it fact it was only 1 min 10 sec long.

Anyway, that was just video. Now I guess I need a way to mux in audio, until MeGui can do that. Do I need to learn command lines for mp4creator??

-abs

absinthe
4th March 2005, 05:22
Ok, this is taking a great deal of playing around ... but anyway, I've managed to encode with x264 via MeGUI. I had to play around with the mp4creator command line, but I was able to mux audio into the file.

I'm not sure the mp4 guide here at doom9 is accurate insofar as the letter c in the command line doesn't seem to work; I had to replace it with "create" ... ala
mp4creator -create=myaudio.mp3 -H -I rate=29.97 meGuiOutput.mp4Encoding was slooooooooooow. I'd like to give a whole movie a try but I'm afraid it would take days. And I haven't even started to play with any of the parameters yet. What settings to use? 2-pass? CQ? 2 B-frames?

There just has to be a better reference to the command lines somewhere. There's so much else to be done. What if, for instance, I wanted to strip the audio OUT of the file, or the video, or mux in other items, etc.? ...

-abs

Doom9
4th March 2005, 08:37
launching mp4creator without parameters will give you a list of what you can do ;) And with reasonable settings (15 reference frames is NOT! reasonable.. if you look at the codec comparison ateme suggested 3 ref frames and would've fared much worse if they went for insane reference frame settings), x264's speed is quite okay on a decent box (>3GHz is decent these days ;) It should be around real-time on my box, so 4h for a 2h movie.

absinthe
4th March 2005, 20:07
Well, I'm definitely going to have to hurry along with that next upgrade, cuz my Athlon 1600 XP took about an hour to do 2 passes on a 2-and-a-half minute sample file! Whoa! I thought I'd read that AVC compression was faster. I'm sure that was in reference to the Nero product, but I've used that too and it took quite some time to encode a whole 2-hour movie. I'd say at least 50% longer than XviD.

Anyway, as a test I've ripped the trailer from the DVD of one of my favorite movies, the 'Mothman Prophecies.' It has a lot of dark colors, is progressive and anamorphic, and even has a 6-channel soundtrack. I haven't examined the output that closely yet, but the skin tones in it are definitely blue!

I've reencoded the AC3 to AAC with BeLight, and now my query is: how to mux the AAC in with the video. The procedure I outlined above (with mp3) won't work as BeSweet outputs AAC in an Mp4 container, but Mp4creator won't accept mp4 as an input type. It wants an *.aac file.

How can I strip the AAC out of the MP4 container? I've looked at the mp4creator command list, but I don't see anything about it. There really oughta be a better reference ...

Thanks!

-abs

Doom9
4th March 2005, 22:51
I haven't examined the output that closely yet, but the skin tones in it are definitely blue! Am I correct in assuming that you used MeGUI/mencoder for this particular test? And am I also correct that your DGIndex version is lower than 1.2.1 beta2?

how to mux the AAC in with the video. The procedure I outlined above (with mp3) won't work as BeSweet outputs AAC in an Mp4 container, but Mp4creator won't accept mp4 as an input type. It wants an *.aac file.
Actually, it works just fine. You just need to do the video muxing and specify that audio mp4 file as the output.. that way you get the video track added to the mp4 file. That part, I admit, is not very straightforward as the commandline options don't really give you a clue as to what happens if the mp4 file already exists. But, come to think of it, it is part of my MP4 guide ;)

How can I strip the AAC out of the MP4 container?Actually, not a smart move especially if your audio is HE AAC. Outside the MP4 container, you'll lose some of the HE flagging and certain decoders might thinks its LC AAC and thus not decode it properly. But if you insist, running mp4creator without parameters gives you the solution:

-extract=<track-id> Extract a track
So all you need is to know which track the audio is. And, on the same screen where you get the extract option, you also get this:
-list List tracks in mp4 file

so that makes it "mp4creator -list audio.mp4", then "mp4creator -extract=x". I suppose being the only audio track the track ID would always be 1 but it can't hurt checking (I checked one of my audio MP4s created by BeSweet and there it's definitely track 1).

Now since I got all this info from doing what I suggested earlier (I have not used mp4creator since I wrote my MP4 guide (and that was years ago - so I don't really know more about it than you), and my lingering suspicion that your blueish output is due to not using the DGIndex version that is mentioned as being required in the MeGUI readme file, could it be that maybe you just didn't try hard enough? :devil:

absinthe
5th March 2005, 00:49
I'm busted on the DGIndex version (I'm at 1.3 b2).

I'm still scratching my head on this muxing thing. I can't mux the video into the audio for the same reason: the video (as output by Mencoder) is already in an MP4. Mp4creator says it will only accept the following file types as input. *.263, *.aac, *.amr, *.mp3, *.divx, *.mp4v, *.m4v, *.cmp, and *.xvidTo summarize:
-both AAC audio and AVC video are already in MP4 wrappers
-mp4creator doesn't seem to take mp4 as input

I can only conclude that either the audio or the video must be removed from its wrapper. I have managed to extract the video, which is automatically renamed as *.264, but mp4creator won't accept that as input (only *.263).

You can in fact instruct mp4creator to name the output file to your liking, like this: mp4creator -extract=1 myfile.mp4 nameItThis.m4v But the resultant file will not mux in properly, either.

I do see an option in BeLight to "mux into existing mp4 video files," and even though BeSweet ends the operation in an error (if I point to my already existing video.mp4 file for output), in fact the audio and video do seem to come out muxed (!) ... but I still suspect that's not right.

-abs

Doom9
5th March 2005, 02:53
Mp4creator says it will only accept the following file types as input.And what makes you believe that line, especially when there's a bunch of thread in this very forum, and on this very first page that say otherwise (for instance my mp4creator rambling here: http://forum.doom9.org/showthread.php?s=&threadid=90544 - with a title like that it must strike your attention even if you do not use the search engine). mp4creator's line about accepted input is BS. It accepts .264 just fine, in fact it's one of two allowable input types for AVC content.

Also, MP4 is a container, not a wrapper.

I have managed to extract the video, which is automatically renamed as *.264, but mp4creator won't accept that as input (only *.263). Wrong as stated above. In fact, I strongly recommend that you revisit the forum rules, especially rule1 which I hold dear to my heart. Next time the answer is right in front of your eyes you'll have to face the consequences of your own negligence.

mp4creator -extract=1 myfile.mp4 nameItThis.m4v

But the resultant file will not mux in properly, either.That's once again an issue that you can find everything about in the thread I linked above.

I do see an option in BeLight to "mux into existing mp4 video files,That's a Nero AAC encoder option and thus a subject for the audio forum. But, why on earth did you create a video MP4 if you're going to work with audio? The process with video and audio is AC3 -> MP4, AVS -> RAW (with .m4v for mpeg-4 asp and .264 for mpeg-4 avc), then add the RAW to the MP4.

If the input is AAC not in the MP4 container, you can either first put the audio there, then add video, or the other way round. In order to make the process streamlined, MeGUI always does the former (well, the development build does but you need to compile that on your own since it's not ready for general usage yet).

absinthe
5th March 2005, 14:07
I think a lot of my confusion has stemmed from the use of the -I and -H options in your MP4 guide. Well ... mostly just the -H. The "hint track" doesn't seem to be necessary at all in my case (there isn't one in my MP4 AAC/AVC movie created by Nero Recode), except perhaps with Mp3 audio. In fact using "-H" seems to be what causes most of my problems. It seems to work ok if I specify a track number (i.e. "-H=3"), but that is simply ignored because there's no hint track in the resulting file.

In short, if I just forget about "-H," everthing seems to work normally and as you would logically expect (and as you've been trying ardently to tell me). I can extract the video and simply rename the file with a ".264" extension, and then mux it into the AAC with a simple "mp4creator -create=myrawfile.264 -I -rate=23.976 -optimize myAACaudio.mp4"

Mp4creator's only complaint with doing this is that it cannot make the file "ISMA compliant" beacuse it contains an "avc1 track." I suppose hints are for streaming, so that makes sense.

But the file plays just great in every app I've tried.

Sorry, but it's been frustrating. I tried this every way from Sunday most of the day yesterday. I went to bed, got up early this morning, walked over to the computer, and actually made it work on the first try.

Sometimes you just need to sleep on it :cool:

Thanks,

-abs

JoeBG
5th March 2005, 20:08
@ absinthe

First of of all a big excuse to you. mp4 muxer was really not able to solve your problems. But now it is, we keep on trying our very best.

- add: support for NTSC: you can now choose the framerate you want
- bugfix: Input 6 was not stable. Now you can add: raw streams (*.m4v, h264, what you want) and avi and mp4 video streams from Nero or MeGUI.

New version is a beta (build 32675), so please test. You can get it with all needed tools on: http://mp4muxer.movie2digital.com/

absinthe
5th March 2005, 20:40
Originally posted by JoeBG
New version is a beta (build 32675), so please test. You can get it with all needed tools on: http://mp4muxer.movie2digital.com/ Thanks, JoeBG! Truth be told, I'm just sort of screwing around with x264 as I've been a big fan of XviD. I was impressed with the results of AVC in doom9's codec shootout, so I gave Nero's a try. It looked and sounded good, but lacked any real control over the process. In fact, I could not even get Nero to "recode" movie files on my hard drive, no matter what I did. It would only do it from the DVD drive (it might've done it from an image mounted on a virtual drive ... not sure I tried that).

Ultimately, I want to be able to watch backups on TV. Obviously, my Philips DVP-642 player isn't going to play back AVC, but I'm planning on putting together an Xbox Media Center fairly soon so maybe I'll get some use out of x264 and mp4muxer.

I'll give 'er a try :)

Thanks!

-abs

Doom9
5th March 2005, 20:52
the xbox doesn't have the cpu resources to play avc content

JoeBG
6th March 2005, 08:55
Originally posted by Doom9
the xbox doesn't have the cpu resources to play avc content

I have a Xbox and I can say, that you can play AVC - but without sound :D
It works with mp3 and with aac stereo, but with stutterings.

absinthe
6th March 2005, 13:57
Bummer that. They have like P3's, right? Though I have read that they're CPU-upgradeable.

Maybe TV-out directly from the computer would be an option.

-abs

JoeBG
6th March 2005, 14:11
Originally posted by absinthe
Bummer that. They have like P3's, right? Though I have read that they're CPU-upgradeable.

Maybe TV-out directly from the computer would be an option.

-abs

You have to buy this box here (http://www.friendtech.com/) and AVC works on Xbox

Sharktooth
6th March 2005, 15:13
the xbox can play AVC but you have to disable all the heavy options that will slow the playback down and use LC AAC or mp3 for audio.
Using a lower resolution may be also a good idea.
Btw a CPU mod will do the trick :)