View Full Version : REAL Ultimate Guide to x264 and QuickTime!!!
Randall
11th November 2005, 00:16
Here is a guide I have compiled for a successful encodes of x264 that will work on QuickTime 7. A lot of people on these boards don't (and shouldn't if they don't need to) care about QuickTime functionality for their H.264/AVC encodes. But if you do care, here is a detailed step-by-step guide for a successful H.264 encode for QT. This guide is for Windows, but the x264 command lines can be used with Mac OS X just as well.
Before we get started, you should know that QuickTime is fussy when it comes to x264 playback. First of all QT doesn't support anything above Main Profile, meaning that it's built in decoder WILL support multipass, max 2 B-Frames, B-References, Adaptive Quant, multiple slices, CABAC, etc. Essentially everything in the Main Profile settings with some exceptions.
QuickTime WILL NOT support 8x8 dct and intra prediction, b-pyramids, lossless encoding, etc. As well as anything from the High Profile.
That said, you can still get an excellent looking encode if you follow this guide. This guide is assuming that you have a Full Screen (4:3) DVD vob file that is formatted in NTSC (29.970 FPS) and is fully Progressive Scan.
Weapons and Gear:
DVD Decrypter (http://www.doom9.org/Soft21/Rippers/SetupDVDDecrypter_3.5.4.0.exe) (get .VOB files from DVD)
DGIndex (http://neuron2.net/dgmpgdec/dgmpgdec.html) (for .d2v project file and .AC3 dolby audio de-muxer)
BeSweet (http://www.doom9.org/Soft21/Audio/BeSweetv1.5b31.zip) (audio encoding)
Nero 7 (http://www.nero.com/nero7/eng/) (Aac.dll and aacenc32.dll) or faac for ACC audio encoding
AVIsynth (http://www.doom9.org/Soft21/SupportUtils/Avisynth_256.exe) (frame server for almost unlimited ways of editing and processing your video)
x264 Full package (http://forum.doom9.org/showthread.php?t=89979) (for encoding H.264/AVC video) Sharktooth's latest build also comes with the x264 stripped down version of the MeGUI front end
MeGUI (http://forum.doom9.org/showthread.php?t=96032) (Encoding front end that will help you automate the encoding process and edit Command Line parameters. Full Version)
MP4Box (http://www.aziendeassociate.it/cd//gpac/dev/MP4Box.7z) (tool for muxing audio and video with MPEG-4 compliant container)
Now let's begin the 7 (6) simple steps to making a sweet encode that will be playable in QuickTime 7.0.3.
1) Rip the .vob(s) to your hard drive with DVD Decrypter
2) Use DGIndex to make a .d2v project file. Select your .vob file(s) you have, open with DGIndex, press F4, save your .d2v file and you will also get a de-muxed AC3 audio file.
3) Create an AVIsynth script to serve up to x264. if you have some of the extra plugins for AVIsynth, you can certainly use those as well. Here is my example for a NTSC 29.97 FPS Progressive Scan Video this format is ideal, we don't need to do anything except resize and clean:
# LOAD THE PLUGINS
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrainSSE3.dll")
# VIDEO SOURCE
mpeg2source("C:\VIDEO_TS\test.d2v")
# CROP THE IMAGE
crop(42,0,636,480)
# RESIZE (SHARP) FULLSCREEN SOURCE
LanczosResize(512,384)
# CLEAN THE PICTURE
RemoveGrain(mode=1) Here is my example for a NTSC 29.97 FPS Teleclined Video (we use Telecide filter to pull down the frame rate to 23.976 FPS, so be aware of the frame rate change) This will remove the Teleclined mice teeth artifacts that were left behind (common on The Simpson’s as well as the Seinfeld DVDs, and many many other 'made for TV' programs):# LOAD THE PLUGINS
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\decomb.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrainSSE3.dll")
# VIDEO SOURCE
mpeg2source("C:\VIDEO_TS\test.d2v")
# INVERSE TELECLINE OPTIONS
Telecide(guide=1).Decimate()
# CROP THE IMAGE
crop(42,0,636,480)
# RESIZE (SHARP) FULLSCREEN SOURCE
LanczosResize(512,384)
# CLEAN THE PICTURE
RemoveGrain(mode=1) Here is my example for a NTSC 29.97 FPS Interlaced Video Some DVDs never even bother to deinterlace the source, relying on your Progressive Scan DVD players to do the dirty work for you. Unfortunately we can't use a hardware deinterlacer, but TDeint and BlendBob are some fine filters that will do it for us.:# LOAD THE PLUGINS
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\DGDecode.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\TDeint.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\BlendBob.dll")
LoadPlugin("C:\Program Files\AviSynth 2.5\plugins\RemoveGrainSSE3.dll")
# VIDEO SOURCE
mpeg2source("C:\VIDEO_TS\test.d2v")
# DEINTERLACE OPTIONS
TDeint(mode=1,order=1,mtnmode=1)
BlendBob()
# CROP THE IMAGE
crop(42,0,636,480)
# RESIZE TO FULLSCREEN 4:3 ASPECT RATIO
LanczosResize(512,384)
# CLEAN THE PICTURE
RemoveGrain(mode=1)All of these avisynth filters can be downloaded at http://www.avisynth.org/warpenterprises/ if you don't have them. Make sure you give them the proper path when you LoadPlugin("Path to your plug-in here"). Now we save one of these three options as an avisynth filter file named template.avs or whatever you would like. Make sure that you change the filenames and paths used to the correct ones, or avisynth will b0rk when you try to start encoding.
4) Go back and encode the audio now. take the .AC3 dolby de-muxed audio file that was created back in step 2, and transcode it using BeSweet. In my example I use the Nero HE-AAC profile, so you will need to copy Aac.dll and aacenc32.dll from the C:\Program Files\Common Files\Ahead\AudioPlugins\ directory into your BeSweet directory. If you would like to use the Nero AAC Encoder completely independent of Nero 7, then you will also need to add the NeroIPP.dll to your BeSweet directory. That file should be located in the C:\Program Files\Common Files\Ahead\Lib\ directory. The command line that I use for AAC encoding is:
BeSweet.exe -core( -input "test 2_0ch 192Kbps DELAY 0ms.ac3" -output "test T01 2_0ch 192Kbps.m4a" -logfile "test T01 2_0ch 192Kbps DELAY 0ms.log" ) -azid( -n1 -s stereo -c normal -L -3db ) -bsn( -2ch -vbr_streaming -codecquality_high -aacprofile_he ) -ota( -d 0 -g max )
You can also use the full version of MeGUI as a front end to this BeSweet command line. I recommend using MeGUI, as it's a bit easier to achieve the same results. You can download the latest version on this thread MeGUI (http://forum.doom9.org/showthread.php?t=96032) .
5) Here is where we set up MeGUI to give ourselves a nice looking x264 video encode in an mp4 container. This part is key, as I have had some problems with certain settings for x264 (as far as QuickTime playback is concerned). I like to use 3-pass encoding, using slow RDO (level 6) to give the best possible looking rip we can make that is still playable in QT. I would post the exact settings that you should use here, but it is up to you on what settings you prefer. Remember that QuickTime is extremely picky on which x264 commands you can actually use out of the Main Profile. You cannot use b-pyramid in QuickTime! Here are my x264 command lines, so that you can make a batch file out of them if you wish. These settings are tested and proven to be 100% QuickTime compatible. About these settings: (pass 1 writes a stats file, pass 3 is also known as Nth pass, which will read the current stats file, and re-write the stats file upon completion of the pass, as well as output to the video file. The pass-2, also known as FINAL pass, will read the stats file and output to your final video .mp4 file. Pass-2 will not update the stats file, so make sure that pass-2 is only used on a final pass!) This is confusing, as the actual order of the passes will go as 1, 3, 2. (First, Nth, Final). To avoid confusion (too late :p) you could use the "--pass 3" option for your Nth and your final passes (1, 3, 3). This practice is used in MeGUI under 'Automated 3-Pass' settings. So don't panic if you never see "--pass 2" in your command line when using MeGUI's Automated 3-Pass.
x264.exe --pass 1 --bitrate 839 --stats "test.stats" --bframes 2 --subme 6 --analyse p8x8,b8x8,i4x4,p4x4 --me esa --progress --no-psnr --output NUL "template.avs"
x264.exe --pass 3 --bitrate 839 --stats "test.stats" --bframes 2 --subme 6 --analyse p8x8,b8x8,i4x4,p4x4 --me esa --progress --no-psnr --output "test.mp4" "template.avs"
x264.exe --pass 2 --bitrate 839 --stats "test.stats" --bframes 2 --subme 6 --analyse p8x8,b8x8,i4x4,p4x4 --me esa --progress --no-psnr --output "test.mp4" "template.avs"
6) *NOTE* I have given you an example of 3-pass encoding, which takes a very long time, and some people may not have the patience to wait for it. In my opinion, waiting once for a quality video encode that you can enjoy again and again is always worth it. That said, you can do 2-pass encoding if you wish, simply by removing the second line in my x264 command file. 3-pass encoding is going to take a long time to complete, but it will definitely be worth the wait. Crack open a beer and watch the game, then come back when encoding is complete.
7) Finally! the last step is multiplexing the audio and video feeds together. MP4Box by default likes to mux at an assumed frame rate of 25 fps. We're gonna have to tell it otherwise in our case (NTSC 29.970 FPS). If you used a Teleclined or an Interlaced source that has been decimated, then your source is now 23.97 FPS, so make the appropriate changes to this next command. Here is the command line for muxing the audio and video feeds together on a Progressive source!
MP4Box.exe -fps 29.970 -add "test.mp4" -add "test.m4a" "final_video.mp4"
Congratulations, if all went well you should have a usable video encode playable in QuickTime 7. Now that's what I call REAL Ultimate Power!!!! I hope that this guide has helped you make QuickTime compatible H.264/AVC MPEG-4 files. I wish that the steps to take will be more automated in the future (less command line stuff). MeGUI is shaping up to be a solid front end to encoding that will help to do just that. Thanks to everyone who worked on these excellent encoding tools, and thanks to the help of all the other people on this forum who helped me with this. And thanks to Doom9.net - The definitive DVD backup resource. *NOTE* I have tested up to 2 B-Frames successfully in QuickTime 7.0.3, I am not certain if you can do more B-Frames then that, but I know that you can do at least that many. Also, for some reason, the mp4 output from x264 won't play (nothing displayed on screen) until you mux it with the audio using MP4Box. I would guess that this is yet another QT bug.
*UPDATE* Despite Sharktooth's strong dislike for QuickTime, he was kind enough to supply us with some useful presets that can be used in MeGUI for full QuickTime compatibility. While the preset settings are 100% compatible with QuickTime, you are not limited to using just those. Remember that you can use up to 2 b-frames, multipass and exhaustive searches in QuickTime too, like my command line examples above. You can find Sharktooth's x264 MeGUI presets available for download here (http://forum.doom9.org/showthread.php?t=101813).
Q and A:.
Q: Why is everyone so obsessed about getting their video to work in QuickTime?
A: QuickTime is the ultimate paradox. On the one hand QuickTime doesn't give a crap, but on the other hand, QuickTime can be very careful and precise.
Q: I heard that QuickTime totally sucks. What's Apple's problem?
A: Whoever told you that is a total liar. Just like other media players, QuickTime can suck OR be totally awesome.
ChronoCross
11th November 2005, 00:52
# Video source project file
mpeg2source("C:\VIDEO_TS\test.d2v")
# Convert the colorspace from RGB to YV12
ConvertToYV12()
umm it already comes out of DGdecode in YV12 so the conversion is not needed. it'll just be a slowdown to the script.
Randall
11th November 2005, 03:08
Ah thanks. I had never used that step before, but somebody recommended it to me, as the x264 encoder works with YV12 internally.
Also a note to everyone interrested: The problem I was having with inconsistant successful encoding using x264 for QT would only show up when I used RAW format for the video. Since I have switched to using MP4 container as the standard output for the video, I have had 100% success with all of my encodings. As long as you use Main Profile, your encode should work with QuickTime after muxing your MPEG-4 video and AAC audio together with MP4Box.
Sirber
11th November 2005, 03:26
I had some problem with YUV2 sources... best keep it. If the source doesn't need convertion Avisynth will not do it.
Randall
11th November 2005, 03:41
Ok then back in it goes. Better safe then sorry I guess. This is the script that I have had success with, so we'll stick with it.
foxyshadis
11th November 2005, 04:02
A conversion to the same colorspace is a nop, according to ian; the only slowdown is a function call or two. ;)
Randall
11th November 2005, 04:18
foxyshadis: sweet Avatar. what show/OVA is that?
ChronoCross
11th November 2005, 04:44
A conversion to the same colorspace is a nop, according to ian; the only slowdown is a function call or two. ;)
when encoding with x264 every little bit of speed loss is devistating. lol.
Randall
11th November 2005, 04:47
lol alright I'll take them out again. speed is pretty valuable.
foxyshadis
11th November 2005, 05:38
We're talking on the order of less than .0000001 fps drop, especially since it will be required for any sources (via avi or ds) not in YV12...
(It's belldandy from OMG, from an artbook. =D)
I almost forgot, the other thing it probably needs is a quick ivtc/deinterlacer, commented out by default, if it's going to be a reference for newbies. (Telecide and KernelDeint are good for a basic script like this.) Thanks for figuring out all the options quicktime can decode.
berrinam
11th November 2005, 05:43
Wouldn't it be a fair bit easier to use MeGUI full version? It will manage steps 2-7 for you, and even add some level of automation if desired.
Kurtnoise
11th November 2005, 06:56
And why not using BeLight for audio transcoding and Yamb for muxing ?
:D
bond
11th November 2005, 10:47
x264.exe --pass 1 --bitrate 839 --stats "test.stats" --bframes 2 --subme 1 --analyse none --me dia --progress --no-psnr --output NUL "template.avs"
x264.exe --pass 2 --bitrate 839 --stats "test.stats" --bframes 2 --subme 6 --analyse p8x8,b8x8,i4x4,p4x4 --me esa --progress --no-psnr --output "test.mp4" "template.avs"
x264.exe --pass 3 --bitrate 839 --stats "test.stats" --bframes 2 --subme 6 --analyse p8x8,b8x8,i4x4,p4x4 --me esa --progress --no-psnr --output "test.mp4" "template.avs"
you are handling the 3 pass commands wrongly! what you are doing here is a 2pass with one pass done for nothing
the failure here is that --pass 2 doesnt stand for "2nd pass", but for "last pass", which means it doesnt update the .log file (x264 uses by default the .log extension for the stats and not .stats)
--pass 3 updates the .log file tough
so the order has to be that way:
--pass 1
--pass 3
--pass 2
MP4Box.exe -fps 29.970 -add "test.mp4" -fps 29.970 -add "test.m4a" "final_video.mp4"audio has no framerate! you dont need to set -fps 29.97 twice, only once for the video
stephanV
11th November 2005, 11:07
4) Go back and encode the audio now. take the .AC3 dolby de-muxed audio file that was created back in step 2, and transcode it useing BeSweet. In my example I use the Nero HE-AAC profile, so you will need to copy Aac.dll and aacenc32.dll from the C:\Program Files\Common Files\Ahead\AudioPlugins\ directory into your BeSweet directory.
I thought QuickTime didn't support HE-AAC (?), so using it would be pretty pointless then.
audio has no framerate!
Technically speaking it does (most compressed formats anyway), but it doesn't hold any relation to the video framerate.
bond
11th November 2005, 11:16
Technically speaking it does (most compressed formats anyway), but it doesn't hold any relation to the video framerate.well the thing is you cant influence audio playback speed in mp4box (by -fps)
Doom9
11th November 2005, 12:53
And why not using BeLight for audio transcoding and Yamb for muxing ?Well, with MeGUI you can have everything automated..
Sirber
11th November 2005, 13:11
Well, with MeGUI you can have everything automated..
And why not using BeLight for audio transcoding and Yamb for muxing ?
:DYou guys remember me my old days when I was trying to push my RealAnime :D
Randall
11th November 2005, 14:56
you are handling the 3 pass commands wrongly! what you are doing here is a 2pass with one pass done for nothing
the failure here is that --pass 2 doesnt stand for "2nd pass", but for "last pass", which means it doesnt update the .log file (x264 uses by default the .log extension for the stats and not .stats)
--pass 3 updates the .log file tough
so the order has to be that way:
--pass 1
--pass 3
--pass 2
audio has no framerate! you dont need to set -fps 29.97 twice, only once for the video
Are you sure? On automated 3 pass it gave it to me in that order, (the 1-2-3 order that makes sense) so I set it up manually because Sharktooth said there was a problem with the "turbo" option on 3-pass etc. etc. So you're saying to me that the third pass should go second, and again output to NUL and only write to (the same) logfile?? :confused:
Randall
11th November 2005, 15:03
I thought QuickTime didn't support HE-AAC (?), so using it would be pretty pointless then.
Technically speaking it does (most compressed formats anyway), but it doesn't hold any relation to the video framerate.
The audio in HE-AAC plays back in QuickTime, although it doesn't recognise it as HE. It thinks that it's LC. So you're losing quality in that sense (no SBR) but I can't tell the difference. It's not like it was dolby 5.1 digital surround sound to begin with. (it was just a 2.1 stereo cartoon). That said, full support for SBR is coming soon. :)
And why not using BeLight for audio transcoding and Yamb for muxing ?
:DThose are sweet front-ends. I should have pumped them in my tutorial.
Wouldn't it be a fair bit easier to use MeGUI full version? It will manage steps 2-7 for you, and even add some level of automation if desired.I didn't realize that the full version of MeGUI gives you all that functionallity. Can it transcode the AC3 track to Nero Digital AAC, and mux the Audio and Video via MP4Box?
stephanV
11th November 2005, 15:03
Are you sure? On automated 3 pass it gave it to me in that order, (the 1-2-3 order that makes sense) so I set it up manually because Sharktooth said there was a problem with the "turbo" option on 3-pass etc. etc. So you're saying to me that the third pass should go second, and again output to NUL and only write to (the same) logfile??
Yes, you can check x264 command line options as reference. --pass 2 is last pass, and --pass 3 is nth pass.
bond
11th November 2005, 15:06
lemme quote myself again
the failure here is that --pass 2 doesnt stand for "2nd pass", but for "last pass", which means it doesnt update the .log file (x264 uses by default the .log extension for the stats and not .stats)
--pass 3 updates the .log file toughand the x264 help:
-p, --pass <1|2|3> Enable multipass ratecontrol:
- 1: First pass, creates stats file
- 2: Last pass, does not overwrite stats file
- 3: Nth pass, overwrites stats fileand the x264 mencoder help:
Three pass encoding
x264 offers the ability to make an arbitrary number of consecutive passes. If you specify pass=1 on the first pass, then use pass=3 on a subsequent pass, the subsequent pass will both read the statistics from the previous pass, and write its own statistics.
Randall
11th November 2005, 15:12
Yes, you can check x264 command line options as reference. --pass 2 is last pass, and --pass 3 is nth pass.
D'oh!! that is confusing as hell. so I shouldn't be outputting to the actual video stream until pass-2, that being the final pass. My encode should look like (correct me if i'm wrong please):
x264.exe --pass 1 --bitrate 839 --stats "test.stats" --bframes 2 --subme 1 --analyse none --me dia --progress --no-psnr --output NUL "template.avs"
x264.exe --pass 3 --bitrate 839 --stats "test.stats" --bframes 2 --subme 6 --analyse p8x8,b8x8,i4x4,p4x4 --me esa --progress --no-psnr --output NUL "template.avs"
x264.exe --pass 2 --bitrate 839 --stats "test.stats" --bframes 2 --subme 6 --analyse p8x8,b8x8,i4x4,p4x4 --me esa --progress --no-psnr --output "test.mp4" "template.avs"
I am a little confused with this, as --subme 6 and --analyse p8x8,b8x8,i4x4,p4x4 may not be entirely useful unless I am writing to the actual video output. :confused:
Randall
11th November 2005, 15:21
I think I get what you're saying. 3 comes before 2, but pass-3 can still write to the video output, becaue it doesn't matter, it will be overwritten anyway. The logfile that gets updated is the key. So i reads the video.stats file, then writes it's own video.stats.temp file, then upon completion of the pass, it overwrites the old video.stats with the newer video.stats.temp file it created.
MeGUI implements automated 3-pass in an incorrect way if this is the case!! A VERY incorrect way. That is a major bug that should be mentioned upon release.
bond
11th November 2005, 15:24
D'oh!! that is confusing as hell. so I shouldn't be outputting to the actual video stream until pass-2, that being the final pass. My encode should look like (correct me if i'm wrong please):yep
you can actually also output a .mp4 already in --pass 3 (which would be the same .mp4 you would get with a 2pass encode)
I am a little confused with this, as --subme 6 and --analyse p8x8,b8x8,i4x4,p4x4 may not be entirely useful unless I am writing to the actual video output. :confused: i cant help you with this fastfirstpass thingie as i never tested it and i dunno what you can disable without loosing too much quality and what not and when
as a rule of thumb you should have the same settings in all passes, the rest needs to be tested
Randall
11th November 2005, 15:27
Thank you so much for your help bond. I will update my tutorial immeadately to avoid further confusion on the subject. After all, the x264 settings were the most important part of my tutorial. Thanks agian.
bond
11th November 2005, 15:34
no problem, apart from that i would not recommend using 3pass, because
1) two passes should be enough for getting a good bitrate distribution
2) x264's quality is already very good on 2 passes
3) x264 is already slow enough on 2 passes, no need for another third imho
Randall
11th November 2005, 15:50
Just To add to that, I just checked my logfile for MeGUI. Apparently MeGUI makes both pass-2 and pass-3 register in the command line as pass #3. Meaning that pass = 2 never comes up. Does this also defeat the purpose of the three pass, becuase it is re-writing the stats file? (Or maybe it doesn't matter, because pass N is still reading from the stats file before it writes to it)
bond
11th November 2005, 15:55
--pass 1
--pass 3
--pass 3
is also ok
the difference between --pass 3 and --pass 2 is only that one updates the log file and the other doesnt
hpn
11th November 2005, 21:29
--pass 1
--pass 3
--pass 3
is also ok
Very useful thread indead. Actually we don't need "--pass 2" even if we run a 2pass encode only, so IMHO the best choice for a 2pass encode is
--pass 1
--pass 3
and not
--pass 1
--pass 2
because if we decide that we want another pass (to maximize quality or get closer to the target bitrate) we just run --pass 3 again. The only 2 good things about --pass 2 are that (1) it doesn't generate and write another log file to the disk, so it saves some CPU cycles and the encoding will be 0.1% faster or so, which is absolutely negligible, and (2) because it keeps the log file for analysis (only makes sense if you are either a developer or some very curious user). Remind me if you know another reason for using --pass 2 at all.
Also it would be nice if instead of
--pass <1 | 2 | 3>
we had
--pass <first | last | next> (or --pass <first | next | last> )
which is more user friendly and unambiguous. But such a change although I guess easy to implement in x264 CLI, would also require changes in all related tools (mencoder, MeGUI, RealAnime etc).
berrinam
11th November 2005, 21:43
I didn't realize that the full version of MeGUI gives you all that functionallity. Can it transcode the AC3 track to Nero Digital AAC, and mux the Audio and Video via MP4Box?
Yes, it can.
Randall
11th November 2005, 21:54
Thanks for the tips guys.
@berrinam: I will try the full version of MeGUI next :)
I will update this guide with using MeGUI full version after I use it successfully. The main goal was to supply people with encoding options that will work without a doubt in the fussy QT, and I think I achieved that. I have also learned some very important lessons about multipass encoding with x264 thanks to bond and others on this thread :)
foxyshadis
12th November 2005, 10:47
But such a change although I guess easy to implement in x264 CLI, would also require changes in all related tools (mencoder, MeGUI, RealAnime etc).
x264 can accept the old values (maybe with a "depreciated" warning) and translate them to the new on the fly, so old tools can catch up.
Both sound sensible to me, although I will admit that using 2/3 to mean something other than 2nd/3rd pass is just asking for confusion. Hmm.
smok3
14th November 2005, 08:55
The problem I was having with inconsistant successful encoding using x264 for QT would only show up when I used RAW format for the video.
damn, that was the problem? i kinda suspected it is something 'trivial' thought...
--analyse p8x8,b8x8,i4x4,p4x4 isnt that the same as --analyze all ?
btw, my bat file was updated according to this thread and it seems pretty 'stable' at the moment.
Randall
14th November 2005, 18:33
The problem I was having with inconsistant successful encoding using x264 for QT would only show up when I used RAW format for the video.
damn, that was the problem? i kinda suspected it is something 'trivial' thought...
--analyse p8x8,b8x8,i4x4,p4x4 isnt that the same as --analyze all ?
btw, my bat file was updated according to this thread and it seems pretty 'stable' at the moment.
Umm I could be wrong, but if you have it set for main profile then that might be fine, but I assume 'all' to include 8x8 Intra Search (i8x8) and that is bad!! That will kill your QT compatibility in a big way. Somebody could correct me here if I'm wrong, because I am not positive if --analyse all specifies everything like it would imply. I specified exactly the options that we wanted, just to avoid any possibility of that confusion.
BTW I would love to recommend your bat file to everyone here if you could post an updated version on this thread that would be sweet. Thanks for your help with QT compatibility smok3! :)
smok3
14th November 2005, 21:42
hehe, well it is not recommended for everybody, it is targeted for avi -> x264/faac in mp4
(there is now an easy option to patch it to a button in total commander as well, also i did quite a lot of testing and it appears to work well.)
link to a post which links to a guide which links to that bat file:
http://forum.doom9.org/showthread.php?t=102186
short guide for x264_.bat would be:
-------------------------------------------
- edit template.avs to your liking
- edit x264_.bat (x264 & faac command lines) to your liking
run with two parameters, like:
x264_ c:\path\to\input.avi d:\path\to\template.avs
- optional edit x264_tcm.bat and apply to total commander via button or menu.
sunilraman
15th November 2005, 05:09
hmm. some challenges with latest MeGUI x264 build from the forums. perhaps it is because i fiddled with Qmin settings? :( nice playback in VLC though and thanks for this guide.
Randall
15th November 2005, 21:37
No problem sunilraman. I'm glad the guide was able to help you. I am not sure what Qmin settings can work in QT, as I didn't test a full range of those. I would keep it at 10 or whatever the default setting is. Perhaps higher settings are ok, because I read a review somewhere on how to encode for the iPod with baseline, and saw that they used a Qmin value of 20 or so.
Also, I will post some template.avs files later on that work with interlaced material, and teleclined material... because my template.avs only showed what to do with progressive source (the easiest kind to work with).
sunilraman
16th November 2005, 12:01
heh. cool. i figured out my problem is using iTunesEncoder to do the AAC encoding. i will post my workaround here later tonight. yup and i figured out telecide(1) and assume frames thingy :o :cool:
edit:
i find that if i extract out the video track using
mp4box -single "1" index001.mp4
(extracting out of the video only mp4 output of x264)
quicktime then likes the mp4. then i can use qt7pro (ouch) to mux in the audio ("add to movie") command
sunilraman
17th November 2005, 08:11
sweet. i am getting the hang of x264 now, it really is excellent and delivers quality which can be fine-tuned quite well. high profile custom quant matrices would be the icing on the cake :D especially if it cleans up the shadow detail issues. but as we are dealing with qt7 here, i think using apple-style "multipass honing"* technique may deliver what i need.
*i believe apple qt7pro h.264 multipass encoding uses recursive passes which progressively reduce the bitrate target or somethin. i believe this is why the apple qt7pro encoder is so slow on multipass encoding, why it never tells you exactly how many passes it does, and how qt7pro encoder is able to avoid too much blockiness ocurring in shadow detail areas (or areas where the hues are near each other on the color wheel).... hmmm of course, i could be off base here, so feel free if you know anything 'bout this.
i'm trying a 4-pass batch encode as follows, just to play with a "multipass recursive honing style". i can't use custom quant matrices because i am aiming for qt7 playback compatibility at this stage... here it is below... (in each pass i increase the subme level and qpmax, and decrease the target bitrate)
"c:\program files\x264\x264.exe" --pass 1 --bitrate 3800 --stats "index000.stats" --subme 3 --bframes 2 --weightb --trellis 2 --analyse p8x8,b8x8,i4x4,p4x4 --qpmin 22 --qpmax 28 --qpstep 1 --me umh --progress --no-psnr --output NUL "C:\Temp\index000.avs"
"c:\program files\x264\x264.exe" --pass 3 --bitrate 3200 --stats "index000.stats" --subme 4 --bframes 2 --weightb --trellis 2 --analyse p8x8,b8x8,i4x4,p4x4 --qpmin 22 --qpmax 32 --qpstep 1 --me umh --progress --no-psnr --output "C:\Temp\index000.mp4" "C:\Temp\index000.avs"
"c:\program files\x264\x264.exe" --pass 3 --bitrate 2800 --stats "index000.stats" --subme 5 --bframes 2 --weightb --trellis 2 --analyse p8x8,b8x8,i4x4,p4x4 --qpmin 22 --qpmax 36 --qpstep 1 --me umh --progress --no-psnr --output "C:\Temp\index000.mp4" "C:\Temp\index000.avs"
"c:\program files\x264\x264.exe" --pass 2 --bitrate 2200 --stats "index000.stats" --subme 6 --bframes 2 --weightb --trellis 2 --analyse p8x8,b8x8,i4x4,p4x4 --qpmin 22 --qpmax 38 --qpstep 1 --me umh --progress --no-psnr --output "C:\Temp\index000.mp4" "C:\Temp\index000.avs"
edit: here's a multipass batch that results in a nice 2200kbps file of 640x256 which scales really well when playing back on 1280x1024 monitors, also nice film grain, grit and organic feel. average of 2-4fps in total with all 5 passes taken into account:
"c:\program files\x264\x264.exe" --pass 1 --bitrate 3800 --stats "index000.stats" --subme 2 --bframes 2 --weightb --trellis 2 --analyse p8x8,b8x8,i4x4,p4x4 --qpmin 5 --qpmax 28 --qpstep 1 --me umh --progress --no-psnr --output NUL "C:\Temp\index000.avs"
"c:\program files\x264\x264.exe" --pass 3 --bitrate 3600 --stats "index000.stats" --subme 3 --bframes 2 --weightb --trellis 2 --analyse p8x8,b8x8,i4x4,p4x4 --qpmin 6 --qpmax 32 --qpstep 1 --me umh --progress --no-psnr --output "C:\Temp\index000.mp4" "C:\Temp\index000.avs"
"c:\program files\x264\x264.exe" --pass 3 --bitrate 3200 --stats "index000.stats" --subme 4 --bframes 2 --weightb --trellis 2 --analyse p8x8,b8x8,i4x4,p4x4 --qpmin 7 --qpmax 34 --qpstep 1 --me umh --progress --no-psnr --output "C:\Temp\index000.mp4" "C:\Temp\index000.avs"
"c:\program files\x264\x264.exe" --pass 3 --bitrate 2800 --stats "index000.stats" --subme 5 --bframes 2 --weightb --trellis 2 --analyse p8x8,b8x8,i4x4,p4x4 --qpmin 9 --qpmax 36 --qpstep 1 --me umh --progress --no-psnr --output "C:\Temp\index000.mp4" "C:\Temp\index000.avs"
"c:\program files\x264\x264.exe" --pass 2 --bitrate 2200 --stats "index000.stats" --subme 6 --bframes 2 --weightb --trellis 2 --analyse p8x8,b8x8,i4x4,p4x4 --qpmin 12 --qpmax 42 --qpstep 1 --me umh --progress --no-psnr --output "C:\Temp\index000.mp4" "C:\Temp\index000.avs"
leban
17th November 2005, 09:38
Thanks for this guide. I could not get it to work anyway. This is the errors I get:
x264 --pass 2 --bitrate 839 --bframes 2 --subme 6 --analyse p8x8,b8x8,i4x4,p4x4 --me esa --progress --no-psnr --output test-1711.mp4 klo5-6-f25-Ip.yuv 720x480
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
mp4 [info]: initial delay 1 (scale 25)
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264 [error]: More input frames than in the 1st pass
x264: encoder/ratecontrol.c:467: x264_ratecontrol_start: Assertion `frame >= 0 && frame < rc->num_entries' failed.
Aborted
I am running this on a Linux box with x264 core:37 svn-336. Should I try to upgrade the version from svn?
With --pass 1 I am able to proceed but the result is still without an image.
My input is raw yuv made from jpg-images with jpeg2yuv and I am trying to figure out if this is yuv2 or something else.
Sharktooth
17th November 2005, 10:24
check the stats file.
cast42
18th November 2005, 13:01
Hi,
I used this guide with succes to encode for Quicktime 7. Because I'm started from PAL video I used -fps 25 for the MP4box.exe command. The result is looking awesome in the quicktime and mpc players. Thanks for this great guide. However, my 60GB video Ipod is refusing to play it. Videos encoded using Quictime 7 Pro do work fine. Has anybody an idea how to change/adapt this guide for video on the iPod ? On the Apple pages, following information is stated:
H.264 video: up to 768 Kbps, 320 x 240, 30 frames per sec., Baseline Profile up to Level 1.3 with AAC-LC up to 160 Kbps, 48 Khz, stereo audio in .m4v, .mp4 and .mov file formats
The audio I've muxed in was compressed with Nero 7 (not the BeSweet procedure). and is MPEG-4 Main@L2 (AAC LC) at 96Kbps.
This is the info of the x264 generated video using MP4Box 0.4.0:
[prompt$ D:/bin/MP4Box.exe -info video.mp4
* Movie Info *
Timescale 600 - Duration 00:02:44.880
Fragmented File no - 1 track(s)
File Brand avc1 - version 0
File has root IOD
Scene PL 0xff - Graphics PL 0xff - OD PL 0xff
Visual PL: AVC/H264 Profile (0x15)
Audio PL: No audio capability required (0xff)
No streams included in root OD
Track # 1 Info - TrackID 1 - TimeScale 25 - Duration 00:02:44.880
Media Info: Language "und" - Type "vide" - Sub Type "avc1" - 4122 samples
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 320 x 240
Self-synchronized
After muxing using:
mp4box.exe -fps 25 -add "video.mp4" -add "audio.mp4" result.mp4
I get:
[prompt]$ D:/bin/MP4Box.exe -info result.mp4
* Movie Info *
Timescale 600 - Duration 00:02:44.895
Fragmented File no - 4 track(s)
File Brand isom - version 1
File has root IOD
Scene PL 0xff - Graphics PL 0xff - OD PL 0xff
Visual PL: Advanced Simple Profile @ Level 3 (0xf3)
Audio PL: AAC Profile @ Level 2 (0x29)
Track # 1 Info - TrackID 2 - TimeScale 32000 - Duration 00:02:44.896
Media Info: Language "und" - Type "soun" - Sub Type "mp4a" - 5153 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40
MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 32000
Synchronized on stream 4
Track # 2 Info - TrackID 3 - TimeScale 24000 - Duration 00:02:44.880
Media Info: Language "und" - Type "soun" - Sub Type "mp4a" - 6870 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x69
MPEG-2.5 Audio - 2 Channel(s) - SampleRate 0 - Layer 2
Synchronized on stream 4
Track # 3 Info - TrackID 4 - TimeScale 1000 - Duration 00:02:44.895
Track is present in Root OD
Media Info: Language "und" - Type "odsm" - Sub Type "mp4s" - 1 samples
MPEG-4 Config: ObjectDescriptor Stream - ObjectTypeIndication 0x01
Self-synchronized
Track # 4 Info - TrackID 5 - TimeScale 1000 - Duration 00:02:44.895
Track is present in Root OD
Media Info: Language "und" - Type "sdsm" - Sub Type "mp4s" - 1 samples
MPEG-4 Config: SceneDescription Stream - ObjectTypeIndication 0x02
Synchronized on stream 4
Is Advanced Simple Profile @ Level 3 (0xf3) as reported by MP4box covered by the "Baseline Profile up to Level 1.3" spec from Apple ??
A movide generated by Quicktime 7 Pro export to ipod reports this:
[prompt]$ D:/bin/MP4Box.exe -info withQT7ExportToIpod.m4v
* Movie Info *
Timescale 600 - Duration 00:05:02.246
Fragmented File no - 2 track(s)
File Brand M4V - version 1
File has no MPEG4 IOD/OD
Track # 1 Info - TrackID 1 - TimeScale 44100 - Duration 00:05:02.254
Media Info: Language "eng" - Type "soun" - Sub Type "mp4a" - 13017 samples
MPEG-4 Config: Audio Stream - ObjectTypeIndication 0x40
MPEG-4 Audio AAC LC - 2 Channel(s) - SampleRate 44100
Self-synchronized
Track # 2 Info - TrackID 2 - TimeScale 600 - Duration 00:05:02.246
Media Info: Language "eng" - Type "vide" - Sub Type "avc1" - 7093 samples
MPEG-4 Config: Visual Stream - ObjectTypeIndication 0x21
AVC/H264 Video - Visual Size 320 x 200
Synchronized on stream 1
Help me getting video on the Ipod!
Thx
Sharktooth
18th November 2005, 13:08
iPod and quicktime are different. donwload x264-psp from x264.nl and follow the instructions.
Randall
20th November 2005, 22:51
hi cast42. Definately go with Sharktooth's recomendation, the x264-psp profile is excatly what you need for iPod compatible encoding. This guide was for QT compatibility, and iPod is a little different. For starters, the video size must be no bigger then 320 x 240 30 frames per sec. etc. And I believe that only the baseline profile will work with it. Also, my audio encoding profile won't work on iPod either. You'll need to use AAC LC encoding instead of the AAC HE. Finally, you must keep the bitrate down to 768 Kbps or lower. if you're doing ABR or VBR it's a good idea to keep it around 700 Kbps, because if I understand correctly, for iPod encoding you cannot be above 768 Kbps at any given moment.
smok3
21st November 2005, 11:09
framerate for ipod must be always 30fps?
Randall
22nd November 2005, 03:29
framerate for ipod must be always 30fps?
No, that's just the maximum framerate that you can use. Sorry for the confusion. ;)
cast42
22nd November 2005, 10:13
Hi,
Randall is right. 30fps is the maximum. Video generated from 25fps PAL play on Ipod:
Here an example of mp4info dump:
Track Type Info
1 audio MPEG-4 AAC LC, 47.693 secs, 128 kbps, 44100 Hz
2 video H264 Baseline@1.3, 48.360 secs, 579 kbps, 320x240 @ 25.000000 fp
s
To be more precise here an excerpt from an QT Pro generated .m4v with mp4dump:
The majorbrand is M4V
De video is:
type avc1
reserved1 = <6 bytes> 00 00 00 00 00 00
dataReferenceIndex = 1 (0x0001)
reserved2 = <16 bytes> 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
width = 320 (0x0140)
height = 240 (0x00f0)
reserved3 = <14 bytes> 00 48 00 00 00 48 00 00 00 00 00 00 00 01
compressorName =
reserved4 = <4 bytes> 00 18 ff ff
type avcC
configurationVersion = 1 (0x01)
AVCProfileIndication = 66 (0x42)
profile_compatibility = 224 (0xe0)
AVCLevelIndication = 13 (0x0d)
reserved = 63 (0x3f) <6 bits>
lengthSizeMinusOne = 3 (0x3) <2 bits>
reserved1 = 7 (0x7) <3 bits>
numOfSequenceParameterSets = 1 (0x01) <5 bits>
<table entries suppressed>
numOfPictureParameterSets = 1 (0x01)
<table entries suppressed>
leban
23rd November 2005, 08:51
No success here. Still the same results, Quicktime plays the file but does not show picture. There is no sound track.
If some one wants to check this out, the stats files, the source and result are here: http://gandalf.lasipalatsi.net/testit/kimmotesti/
the command I am using is:
x264 --pass 1 --bitrate 839 --bframes 2 --subme 6 --analyse p8x8,b8x8,i4x4,p4x4 --me esa --progress --stats 1711.stats --no-psnr --output test-1711.mp4 klo5-6-f25-Ip.yuv 720x480
And this looks ok:
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
mp4 [info]: initial delay 1 (scale 25)
x264 [info]: slice I:86 Avg QP:50.47 size: 12103
x264 [info]: slice P:234 Avg QP:50.74 size: 7480
x264 [info]: mb I I16..4: 85.8% 0.0% 14.2%
x264 [info]: mb P I16..4: 78.5% 0.0% 4.4% P16..4: 15.1% 0.7% 0.2% 0.0% 0.0% skip: 1.0%
x264 [info]: kb/s:1744.6
encoded 320 frames, 1.06 fps, 1744.97 kb/s
Should I run the .mp4 thru mp4box even though I don't have sound?
smok3
23rd November 2005, 10:03
leban,
1. deleted, nm.
2. yes, you have to remux the file using mp4box.
here is my lil guide if it is of some use:
http://somestuff.org/x264_qt/h264_in_quicktime7.html
(including the very sexy win bat file)
akupenguin
23rd November 2005, 16:51
If some one wants to check this out, the stats files, the source and result are here: http://gandalf.lasipalatsi.net/testit/kimmotesti/
Those results do not look ok. 78% intra in P-frames? QP50 and still twice the requested bitrate?
Cause: your source is 640x480, not 720x480. And it's yuv4mpeg, not raw yuv.
mencoder -ovc copy -of rawvideo klo5-6-f25-Ip.y4m -o klo5-6-f25-Ip.yuv
leban
24th November 2005, 15:12
Cause: your source is 640x480, not 720x480. And it's yuv4mpeg, not raw yuv.
mencoder -ovc copy -of rawvideo klo5-6-f25-Ip.y4m -o klo5-6-f25-Ip.yuv
You are rirght about that size. I tried it again with the right size. still nothing. How did you figure out that it is yuv4mpeg?
It is made with: jpeg2yuv -b 0 -f 25 -I p -j webcam_%07d.jpg
But that could be the cause for the persistent problem.
Randall
29th November 2005, 15:57
Another thing, if you find that when you mux your audio and video with MP4Box QuickTime doesn't display the picture at all (no white box either) then try muxing again. I rarely run into this problem, but when I do, a second attempt at muxing solves it. Appears to be a completely random occurance.
GarfBond
1st December 2005, 08:57
OK, I'm having some terrible luck with Quicktime and x264 all of a sudden. x264 380, QT7 pro, latest versions of megui and profiles, as well as mp4box.
Here's the log from megui
Next job job1-1 is a video job. encoder commandline:
"C:\Program Files\x264\x264.exe" --pass 1 --bitrate 1208 --stats "H:\INC0NNS1\boundin.stats" --bframes 2 --subme 1 --b-rdo --analyse none --me dia --progress --no-psnr --output NUL "H:\INC0NNS1\boundin.avs"
successfully set up video encoder and callbacks for job job1-1
----------------------------------------------------------------------------------------------------------
Log for job job1-1
avis [info]: 704x368 @ 23.98 fps (6764 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
x264 [info]: slice I:58 Avg QP:20.78 size: 33740
x264 [info]: slice P:3360 Avg QP:22.07 size: 9008
x264 [info]: slice B:3346 Avg QP:24.30 size: 2842
x264 [info]: mb I I16..4: 37.8% 0.0% 62.2%
x264 [info]: mb P I16..4: 13.2% 0.0% 0.0% P16..4: 44.0% 0.0% 0.0% 0.0% 0.0% skip:42.8%
x264 [info]: mb B I16..4: 1.5% 0.0% 0.0% B16..8: 16.9% 0.0% 0.0% direct:10.1% skip:71.5%
x264 [info]: final ratefactor: 22.85
x264 [info]: kb/s:1183.4
Actual bitrate after encoding without container overhead: 1183.46
----------------------------------------------------------------------------------------------------------
job job1-1 has been processed. This job is linked to the next job: job1-2
Next job job1-2 is a video job. encoder commandline:
"C:\Program Files\x264\x264.exe" --pass 2 --bitrate 1208 --stats "H:\INC0NNS1\boundin.stats" --bframes 2 --subme 6 --b-rdo --analyse p8x8,b8x8,i4x4,p4x4 --progress --no-psnr --output "H:\INC0NNS1\boundin.264" "H:\INC0NNS1\boundin.avs"
successfully set up video encoder and callbacks for job job1-2
----------------------------------------------------------------------------------------------------------
Log for job job1-2
avis [info]: 704x368 @ 23.98 fps (6764 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
x264 [info]: slice I:58 Avg QP:19.81 size: 34766
x264 [info]: slice P:3360 Avg QP:21.12 size: 8968
x264 [info]: slice B:3346 Avg QP:23.11 size: 3099
x264 [info]: mb I I16..4: 41.4% 0.0% 58.6%
x264 [info]: mb P I16..4: 6.5% 0.0% 7.9% P16..4: 23.5% 9.5% 6.4% 1.0% 0.6% skip:44.6%
x264 [info]: mb B I16..4: 0.8% 0.0% 1.9% B16..8: 29.0% 2.4% 4.1% direct: 1.4% skip:60.3%
x264 [info]: kb/s:1205.7
Actual bitrate after encoding without container overhead: 1205.79
desired video bitrate of this job: 1208 kbit/s - obtained video bitrate: 1205.79234305855 kbit/s
----------------------------------------------------------------------------------------------------------
I muxed it using the latest version of MP4box and YAMB.
If you want to look at the end result, here it is: http://albert.stealthgenius.com/stuff/boundin.mp4. It'll be up in about 20 minutes after this post.
Any advice would be greatly appreciated.
Randall
1st December 2005, 14:12
You've been White Screen Of Deathed! WSOD sux0rs. Well, I would try it again without the --b-rdo RD based mode decision for B-frames QuickTime gets fussy about B frames. I don't believe you can have any more then 2 B-frames max. (QT Pro's own encoder only supports 1 B frame max, but I know that it's decoder can handle 2. May I suggest"x264.exe" --pass 1 --bitrate 1208 --stats "H:\INC0NNS1\boundin.stats" --bframes 2 --subme 1 --analyse none --me esa --progress --no-psnr --output NUL "H:\INC0NNS1\boundin.avs"
"x264.exe" --pass 2 --bitrate 1208 --stats "H:\INC0NNS1\boundin.stats" --bframes 2 --subme 6 --analyse p8x8,b8x8,i4x4,p4x4 --me esa --progress --no-psnr --output "H:\INC0NNS1\boundin.mp4" "H:\INC0NNS1\boundin.avs"
I know for a fact that QT works without --b-rdo and without --me dia. I'm not sure if either of those 2 settings are causing your WSOD problem, but those 2 settings jump out at me as a possible suspect. Try my command line and see what happens. Also, I have had trouble with the latest version of MP4Box, but it is not a White Screen Of Death problem, so I don't think MP4Box is your problem here, most likely it's your x264 settings. Try encoding to an actual mp4 container rather then a raw file. I have had more success this way.
Sharktooth
1st December 2005, 14:43
both brdo and diamond search do not influence decoding in any way
Randall
1st December 2005, 15:39
both brdo and diamond search do not influence decoding in any way
Thanks for letting us know. Ok so I'm out of ideas as to why GarfBond's encode failed to render picture in QT then.
@GarfBond: Stick with Sharktooth's CE QuickTime profile and everything should be fine. It's in the sticky threads somewhere, and you need 7-zip to extract it.
Thanks for that profile Sharktooth. :goodpost:
Sharktooth
1st December 2005, 19:26
maybe it's a matter of bitrate variance?
i really dont know. it works for some users and it doesnt for others...
akupenguin
1st December 2005, 21:34
Umm I could be wrong, but if you have it set for main profile then that might be fine, but I assume 'all' to include 8x8 Intra Search (i8x8) and that is bad!! That will kill your QT compatibility in a big way. Somebody could correct me here if I'm wrong, because I am not positive if --analyse all specifies everything like it would imply. I specified exactly the options that we wanted, just to avoid any possibility of that confusion.
--analyse all includes i8x8 if and only if --8x8dct is also specified. (It's not a question of profile; cqm will also set high profile, but won't enable i8x8.)
Randall
1st December 2005, 22:12
Thanks for the info akupenguin. --analyse all == --analyse p8x8,b8x8,i4x4,p4x4
but typing --analyse p8x8,b8x8,i4x4,p4x4 makes me feel good inside. That way I know exactly what the hell it is doing.
GarfBond
2nd December 2005, 05:06
Part of my problem is that I've been using Sharktooth's CE-Quicktime profile :(
Today I just tried it outputting to .MP4 instead of a raw AVC file, but that was a no-go. Simply viewing the resulting MP4 file in QT results in no video at all (not even a white box of doom). After muxing it with the AAC file the video still isn't playing and the audio continues to work just fine.
Probably the most frustrating part is that everything plays in MPC just fine and dandy while QT sits there looking dumb. Anyone got any ideas?
Sharktooth
2nd December 2005, 10:41
GarfBond, can you please try the CE-Baseline profile and see il QT can "eat" it?
Randall
2nd December 2005, 12:38
Part of my problem is that I've been using Sharktooth's CE-Quicktime profile :(
Today I just tried it outputting to .MP4 instead of a raw AVC file, but that was a no-go. Simply viewing the resulting MP4 file in QT results in no video at all (not even a white box of doom). After muxing it with the AAC file the video still isn't playing and the audio continues to work just fine.
Probably the most frustrating part is that everything plays in MPC just fine and dandy while QT sits there looking dumb. Anyone got any ideas?
yeah. I am positive that Sharktooth's QT profile works. I use it all the time. If you get no white box on your video only mp4 file, then it could be an MP4Box issue. I couldn't get the latest version of MP4Box working with QT, so I'm using an older version. Try version 0.4.1-DEV. That is the version I have. send me your email addy and I will mail it too you. It's 100kb too big to attach in the forum. (note: all of my successful QT encodes do not display any video at all on the video only stream. only after i mux it with the audio do I see any picture. I know it sounds weird.)
Sharktooth
2nd December 2005, 13:25
QT is pricky even when parsing MP4s...
bond
2nd December 2005, 15:05
did anyone actually already try to contact some apple devs and point them to all this mess so they get an idea that its time to fix their stuff?
Sharktooth
2nd December 2005, 15:47
did anyone actually already try to contact some apple devs and point them to all this mess so they get an idea that its time to fix their stuff?
You know better than me apple devs doesnt have ears for listening to users...
Randall
2nd December 2005, 16:18
You know better than me apple devs doesnt have ears for listening to users... Amen to that. I sent a bug report to them months ago about the ability to put a comment tag on an mpeg4 file in iTunes that's long enough (number of characters in comment field) to cause a buffer overflow and crash QuickTime if you open that file in QT. Always reproducable.
No fix for this yet. I'm sure it would be a matter of changing the size of one array or something extremely easy to fix. God forbid they actually fix it.
bond
2nd December 2005, 16:19
You know better than me apple devs doesnt have ears for listening to users...not totally true
i, at the beginning of qt7, sent a bug report about qt7 to some apple maillist dealing with that and i got a response from a dev, but he basically didnt understand what i was saying aka ignoring my bug reports
anyways, this means they are reading the stuff the users report at least :D
Sharktooth
2nd December 2005, 16:21
that's what i said... they dont "want" to listen... and if they do, they do it the quicktime way (b0rked).
GarfBond
3rd December 2005, 05:23
Where are you guys sending these bug reports btw?
As for CE-Baseline, I did try that once and it also failed, which does sound pretty suspicious. Judging from one post, do you guys think that it's an MP4Box issue?
Sharktooth
3rd December 2005, 14:32
maybe. update to the very latest mp4box.
a b0rked mp4box version caused me some problems with VLC also...
bond
3rd December 2005, 16:11
before i blame mp4box to be wrong, i would definitely blame quicktime :D
Randall
3rd December 2005, 16:21
before i blame mp4box to be wrong, i would definitely blame quicktime :D
Actually the latest version of MP4Box was the version that was giving me grief. I couldn't get any of my encodes that I knew should be QT compatable to run. The version of MP4Box that I use that always works is GPAC version 0.4.1-DEV. I would post it here if the file wasn't too big. I'm hesitent to blame MP4Box for any QT problems, but it is a little suspicous.
bond
3rd December 2005, 17:00
Actually the latest version of MP4Box was the version that was giving me grief. I couldn't get any of my encodes that I knew should be QT compatable to run. The version of MP4Box that I use that always works is GPAC version 0.4.1-DEV. I would post it here if the file wasn't too big. I'm hesitent to blame MP4Box for any QT problems, but it is a little suspicous.what does "i couldnt get it to run" mean?
i muxed an apple encoded avc stream with latest mp4box to .mp4 and it played as always: totally crappily :D
Randall
3rd December 2005, 17:08
I coudn't get it to run means that I got no picture box, not even the white screen of death!
>> i muxed an apple encoded avc stream with latest mp4box to .mp4 and it played as always: totally crappily :D <<
You say that jokingly, but even x264 at its Main profile is a superior result then XviD at highest settings. (Using the same bitrate of course).
bond
3rd December 2005, 17:12
> i muxed an apple encoded avc stream with latest mp4box to .mp4 and it played as always: totally crappily :D <<
You say that jokingly, but even x264 at its Main profile is a superior result then XviD at highest settings. (Using the same bitrate of course).i said that to show you that latest mp4box has no problems with qt here
so your problem might not be caused by mp4box, but by using incompatible settings of any kind
Randall
3rd December 2005, 17:15
i said that to show you that latest mp4box has no problems with qt here
so your problem might not be caused by mp4box, but by using incompatible settings of any kind
I find that case unlikely, as when I reverted to a previous version of MP4Box and tried to mux the same two steams again, it worked on QuickTime. Plus I was using the CE QuickTime Settings provided by Sharktooth.
SenorKaffee
4th December 2005, 13:36
I downloaded the last build from the thread and encoded a short piece of video with the CE-Quicktime setting. QT7 plays the video, but shows no output. There is no error message, but there is no video either.
AVISource("E:\Bastelkram Auslagerung\1npe06_extrakt.avi")
ConvertToYV12
Next job job1-1 is a video job. encoder commandline:
"x264.exe" --pass 1 --bitrate 1000 --stats "E:\Bastelkram Auslagerung\test.stats" --bframes 2 --subme 1 --analyse none --me dia --threads 2 --progress --no-psnr --output NUL "E:\Bastelkram Auslagerung\test.avs"
successfully set up video encoder and callbacks for job job1-1
----------------------------------------------------------------------------------------------------------
Log for job job1-1
avis [info]: 640x480 @ 25.00 fps (331 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
x264 [info]: slice I:3 Avg QP:21.67 size: 35310
x264 [info]: slice P:161 Avg QP:26.31 size: 9400
x264 [info]: slice B:167 Avg QP:26.68 size: 2326
x264 [info]: mb I I16..4: 30.3% 0.0% 69.7%
x264 [info]: mb P I16..4: 24.9% 0.0% 0.0% P16..4: 54.6% 0.0% 0.0% 0.0% 0.0% skip:20.5%
x264 [info]: mb B I16..4: 1.6% 0.0% 0.0% B16..8: 29.4% 0.0% 0.0% direct: 6.0% skip:63.1%
x264 [info]: final ratefactor: 26.73
x264 [info]: kb/s:1213.2
Actual bitrate after encoding without container overhead: 1214.55
----------------------------------------------------------------------------------------------------------
job job1-1 has been processed. This job is linked to the next job: job1-2
Next job job1-2 is a video job. encoder commandline:
"x264.exe" --pass 2 --bitrate 1000 --stats "E:\Bastelkram Auslagerung\test.stats" --bframes 2 --subme 6 --b-rdo --analyse p8x8,b8x8,i4x4,p4x4 --threads 2 --progress --no-psnr --output "E:\Bastelkram Auslagerung\1npe06_qtprofile.mp4" "E:\Bastelkram Auslagerung\test.avs"
successfully set up video encoder and callbacks for job job1-2
----------------------------------------------------------------------------------------------------------
Log for job job1-2
avis [info]: 640x480 @ 25.00 fps (331 frames)
x264 [info]: using cpu capabilities MMX MMXEXT SSE SSE2
mp4 [info]: initial delay 1 (scale 25)
x264 [info]: slice I:3 Avg QP:23.33 size: 27521
x264 [info]: slice P:161 Avg QP:26.41 size: 7673
x264 [info]: slice B:167 Avg QP:27.53 size: 2066
x264 [info]: mb I I16..4: 33.4% 0.0% 66.6%
x264 [info]: mb P I16..4: 13.1% 0.0% 13.3% P16..4: 35.2% 8.1% 3.0% 0.2% 0.1% skip:27.0%
x264 [info]: mb B I16..4: 0.8% 0.0% 1.4% B16..8: 45.3% 1.2% 2.0% direct: 0.8% skip:48.5%
x264 [info]: kb/s:1004.9
Actual bitrate after encoding without container overhead: 1006.27
desired video bitrate of this job: 1000 kbit/s - obtained video bitrate: 1008.85135951662 kbit/s
----------------------------------------------------------------------------------------------------------
Source: http://www.fullmetalpantsu.de/diverses/1npe06_extrakt.avi
Output: http://www.fullmetalpantsu.de/diverses/1npe06_qtprofile.mp4
VLC Media Player has no problems, of course, but for once I want to encode a video that can be played on this player. ^^
Randall
4th December 2005, 16:25
Yes that is because you may need a previous build of MP4Box. Send me your email and I will mail it to you, because it's too large to post on this thread.
bond
4th December 2005, 16:54
the "not showing of video" after encoding with x264 to mp4 is caused by a bug in x264 signalling the video stream to be not present in the mp4, which leads to that qt doesnt display it
superdump already made a fix for this which is available here (http://www.swains.plus.com/x264/patches/x264_mp4_trackenabledflag.0.diff), so this will be fixed soon
remuxing such a x264 mp4 file with mp4box fixes this problem only when you are demuxing the stream to raw and than remuxing to .mp4
when doing a mp4 -> mp4 conversion with mp4box the "stream not present" flag doesnt get changed in recent cvs (with older ones it was done)
bond
4th December 2005, 22:15
the "not showing of video" after encoding with x264 to mp4 is caused by a bug in x264 signalling the video stream to be not present in the mp4, which leads to that qt doesnt display it
superdump already made a fix for this which is available here (http://www.swains.plus.com/x264/patches/x264_mp4_trackenabledflag.0.diff), so this will be fixed soon
remuxing such a x264 mp4 file with mp4box fixes this problem only when you are demuxing the stream to raw and than remuxing to .mp4
when doing a mp4 -> mp4 conversion with mp4box the "stream not present" flag doesnt get changed in recent cvs (with older ones it was done)ok r382 fixes this bug
Randall
4th December 2005, 22:47
great news! thanks bond.
Randall
5th December 2005, 02:40
I have updated the guide to include some homade filter scripts for Teleclined and Interlaced NTSC 29.97 FPS fullscreen formats for those of you that are interrested. They can be found on the first post of this thread. Enjoy. :cool:
SenorKaffee
5th December 2005, 10:13
Exported to RAW and muxed in MP4 again with YAMB - the video shows in QT7 now, I´m so happy. ^^
Doom9
5th December 2005, 11:36
*NOTE* there currently is a bug in MeGUI that will not properly encode automated 3-pass when turbo is checked off. To be certain you get a good encode, make sure that "turbo" is UNchecked, and set up each of the 3 passes seperately.That's not true. There never was any problem in fact, only people thinking there was one because the commandline preview didn't return what they thought it should. That has been changed now and the preview shows the results of the last pass. But turbo has always worked fine for many revisions before this thread was first created.
Randall
5th December 2005, 12:16
Exported to RAW and muxed in MP4 again with YAMB - the video shows in QT7 now, I´m so happy. ^^
That's not true. There never was any problem in fact, only people thinking there was one because the commandline preview didn't return what they thought it should. That has been changed now and the preview shows the results of the last pass. But turbo has always worked fine for many revisions before this thread was first created.
Good news all around. :)
lordreign
6th December 2005, 02:55
I dont know if anyone else has experienced this (and its more to do with the container than x264 but still relevant) but celtic's latest mp4box build (28/11 I think) doesnt seem to spit out mp4 files that quicktime likes (using YAMB). They give the usual no video quicktime window when u try to run them. When I use an older version of mp4box (0.4.1Dev to be exact) the mp4's are read fine by quicktime. Just wanted to share my thoughts. :)
bond
6th December 2005, 11:17
I dont know if anyone else has experienced this (and its more to do with the container than x264 but still relevant) but celtic's latest mp4box build (28/11 I think) doesnt seem to spit out mp4 files that quicktime likes (using YAMB). They give the usual no video quicktime window when u try to run them. When I use an older version of mp4box (0.4.1Dev to be exact) the mp4's are read fine by quicktime. Just wanted to share my thoughts. :)remuxing such a x264 mp4 file with mp4box fixes this problem only when you are demuxing the stream to raw and than remuxing to .mp4
when doing a mp4 -> mp4 conversion with mp4box the "stream not present" flag doesnt get changed in recent cvs (with older ones it was done)but as mentioned this bug has been fixed in x264 already, so when encoding with r382 and up you wont get any problems with qt7
Randall
6th December 2005, 12:42
I dont know if anyone else has experienced this (and its more to do with the container than x264 but still relevant) but celtic's latest mp4box build (28/11 I think) doesnt seem to spit out mp4 files that quicktime likes (using YAMB). They give the usual no video quicktime window when u try to run them. When I use an older version of mp4box (0.4.1Dev to be exact) the mp4's are read fine by quicktime. Just wanted to share my thoughts. :)
Thank you. This seems to have been falling on deaf ears around here. The latest version of MP4Box is b0rked. Regardless of the latest version of x264 r382 fixing an issue in the way the H.264 stream info is rendered.
bond
6th December 2005, 12:49
The latest version of MP4Box is b0rked. no, its not borked
if someone sets the "dont show video" flag in a .mp4 and than you remux it to another .mp4 the flag should still be set (its not mp4box to decide what settings to keep and what not)
Randall
6th December 2005, 12:52
So then the mp4box 0.4.1Dev is b0rked? Because something allowed the "don't show video" flag to be unset, and according to what I know, it was not x264 before version r382.
bond
6th December 2005, 13:24
every new version is atm labelled as "0.4.1Dev"
the old version you were using simply rewrote the mp4 file, new versions dont do that anymore
its a matter of taste what you prefer, but imho its ok if you have the same settings in the output mp4 that also were in the input mp4
Randall
6th December 2005, 14:06
So if I switch to the latest version of MP4Box and the latest release of x264, then this issue is resolved, and I won't have to "rewrite" the mp4 file?
bond
6th December 2005, 14:44
yes :)
Randall
7th December 2005, 19:10
This is great. I sent Apple a bug report for QuickTime, and apparently they don't understand what I'm talking about, because they need me to send them a "sample" MPEG-4 file that causes the crash. They don't seem to get that every MPEG-4 file known to man can cause this crash.
I was about to post the email to this forum, but I realized that since I submitted the bug report, it is under a non-disclosure agreement.
The basic jist of it is that you can write an MPEG-4 comment tag (using Apple software) that is long enough to cause QuickTime 7 to crash when playing that particular MPEG-4 file, and selecting Selecting: Window > Show Movie Info (just press Ctrl+I)
GarfBond
10th December 2005, 21:48
This is great. I sent Apple a bug report for QuickTime, and apparently they don't understand what I'm talking about, because they need me to send them a "sample" MPEG-4 file that causes the crash. They don't seem to get that every MPEG-4 file known to man can cause this crash.
I was about to post the email to this forum, but I realized that since I submitted the bug report, it is under a non-disclosure agreement.
The basic jist of it is that you can write an MPEG-4 comment tag (using Apple software) that is long enough to cause QuickTime 7 to crash when playing that particular MPEG-4 file, and selecting Selecting: Window > Show Movie Info (just press Ctrl+I)
I'm assuming you sent it through ADC? I think the best thing to do would just be to comply and send them some small file where you made the change, and casually point out that the giant comment tag is what causes it. Remember there's probably quite a few idiotic bug reports coming through the public methods :)
Randall
11th December 2005, 06:05
I'm assuming you sent it through ADC? I think the best thing to do would just be to comply and send them some small file where you made the change, and casually point out that the giant comment tag is what causes it. Remember there's probably quite a few idiotic bug reports coming through the public methods :)
Yup I sent it though ADC. I guess I will attach a "small" sample encode with a borked comment field.
MySchizoBuddy
17th September 2006, 02:43
Quicktime is the only webplayer for the H.264 codec. and as such a very important format. Not caring for it will be quite stupid. MeGUI should have a one click encode to quicktime format like handbrake does.
If u guys are not going to care about quicktime then the web will be run over by VC1 and flash. and i'm sure u guys don't want that now do you.
foxyshadis
17th September 2006, 03:46
VLC, Windows Media Player (with ffdshow or another codec), and MPlayer can all play AVC on a web page, though MPlayer's flakey about working as a plugin.
And MeGUI does have a Quicktime profile, accessible from One-click; what do you mean?
Besides, flash already won the short-file web format war and wmv won the streaming war years ago. AVC will only ever be a niche (like trailers and full videos now) unless one of the majors picks it up.
Sharktooth
18th September 2006, 12:52
Apple did it but their MPEG codecs implementation is really poor.
popper
25th September 2006, 05:47
VLC, Windows Media Player (with ffdshow or another codec), and MPlayer can all play AVC on a web page, though MPlayer's flakey about working as a plugin.
And MeGUI does have a Quicktime profile, accessible from One-click; what do you mean?
Besides, flash already won the short-file web format war and wmv won the streaming war years ago. AVC will only ever be a niche (like trailers and full videos now) unless one of the majors picks it up.
i think the key words there is 'years ago' as for being a niche in the future ,that depends on many things not least the fact AVC is now becomeing THE encoder CODEC to use.
http://www.newvideobusiness.com/content/view/74/26/1/0/
"
Mission accomplished: AVC encoding halves bit rates
Feature: Encoder vendors predicted that advanced codecs would halve real-time video bit rates compared to MPEG-2. That is exactly what has happened but, as John Moulding reports, VC-1 has been left in the shadows.
This feature can also be found in the September issue of New Video Technology magazine. This is an extended version with more detail on deployments and the continuing role of MPEG-2. "
"
VC-1 IS SIDELINED FOR REAL-TIME BROADCASTING
DUAL-CODEC APPROACH AT TIER-1 TELCOS
CONTINUING ROLE FOR MPEG-2 -- EVEN ON IPTV
IPTV MPEG-2/AVC MIGRATIONS
SATELLITE ADOPTS AVC FOR HDTV
CABLE HAS LESS NEED FOR ADVANCED CODING
ADVANCED COMPRESSION ON DIGITAL TERRESTRIAL
DTT REMAINS LARGELY MPEG-2
AVC HALVING BIT RATES
SWEET SPOT FOR HDTV IS 6-7.5Mbps
IPTV NEEDS TWO SIMULTANEOUS HD STREAMS
SATELLITE PUTS A PREMIUM ON PICTURE QUALITY
HDTV COULD BE POSSIBLE "IN 3-3.5Mbps"
HDTV BECOMING THE NEW STANDARD-DEFINITION?
TANDBERG TELEVISION'S NEW COMPRESSION ENGINE
TIER-1 QUALITY HDTV ONTO DENSE TELCO PLATFORMS
FOUR HD, FOUR SD AND FOUR PIP FROM 1RU
HARMONIC'S NEW SD AND HD ENCODING PLATFORMS
FOUR CHANNELS OF HDTV FROM 1RU
HARMONIC MOVES AWAY FROM MPEG-2/AVC PLATFORMS
"STILL A NEED FOR MPEG-2/AVC PLATFORMS"
DEBATE ABOUT IMPORTANCE OF DENSITY
BUT NEAR-CONSENSUS ABOUT VC-1
KEY DEPLOYMENTS: WHO USES WHO?
SCOPUS FINALISING HD PLATFORM"
"ICE3 is being used on the new EN8030 AVC standard-definition encoder and the EN8090 AVC HD/SD encoder. Effectively, these are the next-generation to the current EN5930 (SD) and EN5990 (HD) encoders for AVC but besides better bit rate reduction, they also deliver more outputs. The EN8090, for example, will take a single HD input and generate a full-resolution HDTV channel, a secondary version of that main channel in full standard-definition, and a third ‘micro’ channel for use in PiP, mosaic and multi-view applications"
also if people and new media like the new so called UK political webTV
http://18doughtystreet.typepad.com/home/2006/09/18doughtystreet_1.html#comments
'18DoughtyStreet - the home of anti-establishment TV'
can be convinced and educated to the future benefits DVB-C/T/S and DVB-H(2) http://www.newvideobusiness.com/content/view/77/26/ then AVC will be far more viable that the past tinkering and defeatest thinking or perhaps not , its all about the profit margins after all.
of course we appear to be still waiting for the tools to easly put several AVC encodes into/and edit a TS stream and the advancement of VLC and its like to again easly manipulate these ts channels for the new age personal video tv station rather like the video blog but way better quality and content that anyone can run in low bitrate AVC over their 512k upstream if they want.
MySchizoBuddy
25th September 2006, 07:04
VLC, Windows Media Player (with ffdshow or another codec), and MPlayer can all play AVC on a web page, though MPlayer's flakey about working as a plugin.
And MeGUI does have a Quicktime profile, accessible from One-click; what do you mean?
Besides, flash already won the short-file web format war and wmv won the streaming war years ago. AVC will only ever be a niche (like trailers and full videos now) unless one of the majors picks it up.
the masses don't have vlc neither mplayer. and i doubt they know how to enable wmp to play H.264 files. So far Quicktime is the only major player that does it out of the box. Not to forget that when u install iTunes u get quicktime with it as well. considering how popular iPods are, u can be assured that quicktimes market share is gaining.
With google partnerning with Apple for Apple iTV, u can be assured Google will support H.264 plus flash (VP6). Google already does support H.264 with their iPod versions. Plus youtube will also provide H.264 files in the future.
foxyshadis
25th September 2006, 07:49
It's not that hard to place a link under the video "Doesn't play? Click here!" You know, the same way Real, Quicktime, and flash have distributed themselves for the last decade. That's how QT got to be so common in the first place!
You want to design for quicktime, no one's going to stop you, but I was correcting the misconception that there are no other choices for browser-integrated streaming players.
Google's had AVC and VP6 for a year now, so "will support" is a little late on the mark.
popper, only the very last article you quote has anything to do with the web at all, which is what I was talking about. I wasn't denying that AVC is rapidly becoming terrestrial and satellite broadcasters' format of choice, or that it'll be a competitor on HD discs. (Although AVC requiring half the bitrate of VC-1 is every bit as much bullshit as the old claims of WMA sounding better at half the bitrate than MP3. At best full-bore high profile AVC has a 20% gain on VC-1, and with the limits imposed by broadcasters and HD-DVD/Bluray it's more like 5-10%.)
Kurtnoise
25th September 2006, 09:00
I think that CorePlayerX should be a great alternative to QuickTime regarding web players...Just wait & see. :)
popper
25th September 2006, 18:34
(Although AVC requiring half the bitrate of VC-1 is every bit as much bullshit as the old claims of WMA sounding better at half the bitrate than MP3.
sorry you lost me, i wasnt having a go, just trying to point out that AVC is far bigger today as the CORPs bring out turn key hardware AVC encoder options with multi res/br realtime options (that could be fed directly into the future so called webTV etc).
it appears that they were saying AVC is half the bitrate of Mpeg2 not VC-1, and that as you know is easly true.
just like people now have extreamly easy access to the mpeg2 ts DVB streams, it will become just as easy for users to also get access to the new AVC ts content as time passes, and hence why the easy software is really key to AVC being used from the end users POV.
JaggerMech
30th September 2006, 09:57
A noob question for converting Telecined video (>95% Film):
I've use 'ForceFilm' (in DGIndex), is it better use 'Telecide+Decimate' (In AviSynth) ?
foxyshadis
30th September 2006, 13:04
If it reports as less than 95% or so film, then yes. Otherwise no.
JaggerMech
1st October 2006, 09:18
If it reports as less than 95% or so film, then yes. Otherwise no.
So I think the guide at first page must be updated. It doesn't apply for NTSC with Film more than 95%...
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.