View Full Version : x264 encoding of Quicktime files on Mac OS X
sheckylovejoy
14th June 2007, 00:47
Hi. I'm a professional video editor who is seeing more and more of my outputs geared for web, ipod and now AppleTV. For daily outputs for review by directors and producers, the Apple h264 codec and Apple Compressor are more than adequate, but for the final online master, I'd like to use x264, which I've been exposed to via Handbrake. Handbrake, however, only accepts MPEG input (VOB, MPEG2, etc.), whereas I'd like to input Quicktime files with one of Apple's Uncompressed 4:2:2 codecs.
I am on Mac OS X.4.9. G5 Quad, 6.5 GB RAM, 5 TB storage, Readeon X1900
I also have a PC (Athelon X2), but would prefer to do this on the Mac (sometimes the source files are VERY large -- uncompressed HD is a killer -- and network transfers take too long, even on Gigabit
I prefer a GUI, but can make my way with a CLI so long as the manual is clear. I like the Handbrake model, which has very common options in the GUI, but full access to the command line options of x264.
I've had very poor results with the x264 QT codec
In any event, from what I've read here and elsewhere, mencoder seems to be the best option, but please tell me if there's something else available more suitable
Anyway, I installed mencoder and x264 via instructions from here and elsewhere. Everything seemed to go smoothly (outside of some permissions errors at first) until I fired it up:
HappyDays:~ shecky$ mencoder -h
MEncoder dev-SVN-r23530-4.0.0 (C) 2000-2007 MPlayer Team
AltiVec found
CPU: PowerPC
Segmentation fault
I put my install log up here:
http://www.squeezeanickel.com/x264/mencoder_install_log.txt.zip
Thanks in advance
sheckylovejoy
Try this QuickTime Media Compressor components - http://www003.upp.so-net.ne.jp/mycometg3/x264Encoder.dmg
http://www003.upp.so-net.ne.jp/mycometg3/avc1Decoder.dmg
audyovydeo
15th June 2007, 09:28
I've had very poor results with the x264 QT codec
Hello
I assume the above is this codec :
https://developer.berlios.de/projects/x264qtcodec/
I don't have a Mac but I also try to make my encodes QuickTime-readable.
Have you tried using VLC for MacOS ? VLC gives you access to all x264 options through its GUI. I don't know what version of x264 the current VLC is using though, but it must be a relatively recent one (my guess is >= v635)
else use the most recent VLC 0.9.0 "nightly" beta.
cheers
audyovydeo
Blue_MiSfit
15th June 2007, 09:48
I've managed to get a pretty clean workflow for x264 in MOV or Quicktime compliant MP4. It involves Windows (because of AviSynth), which may mean that using whatever 4:2:2 codec you choose won't work, since QuickTime codecs on Windows are spotty.
I would dump your video out to something very standard, like the Animation codec, or possibly Sheer video, which is a pretty solid lossless codec that's not free, but is cheap.
Then you can use these Sheer MOVs as sources in Windows to feed AviSynth with the QTSource plugin, and do a nice clean downconversion to 4:2:0, avoiding chroma blocking. This will in turn feed x264.exe with uncompressed 4:2:0 (YV12) video in real-time, which is what it expects.
MeGUI has a nice x264 profile for QuickTime compliancy. It's funny to me how poorly done Apple's MPEG-4 stuff is. Their audio codecs don't support HE-AAC, their video codecs don't do MPEG-4 ASP, and their MPEG-4 AVC is minimalistic and unrefined at best! No wonder their HD trailers are so huge :D
I have done this same exact workflow, and you can even mount the Mac's hard drive on the PC across your gigabit ethernet, and use the QuickTime file from there as a source. That way you can avoid copying anything.
So to sum it up, export from FCP or whatever you're using into the Sheer codec, or possibly the Animation codec, or something else you have on both Windows and OS X. Then make an AviSynth script like this (assuming progressive video, and your mac mounted to Z on the PC):
Loadplugin("X:\Plugins\QTSource.dll")
QTInput("Z:\video\sheer.mov")
ConvertToYV12()
Then, open that AviSynth script in MeGUI, select the QuickTime x264 profile (assuming you want QuickTime to be able to decode the result), select a bitrate, and make sure to use two pass encoding and bada-bing, you've got a very nice x264 generated MP4, h264, or MKV, depending on your output settings :)
Mux that with whatever audio you want, and you're good to go.
~MiSfit
sheckylovejoy
17th June 2007, 09:43
sheckylovejoy
Try this QuickTime Media Compressor components - http://www003.upp.so-net.ne.jp/mycometg3/x264Encoder.dmg
http://www003.upp.so-net.ne.jp/mycometg3/avc1Decoder.dmg
This looks like exactly what I need. When did this come out? It looks far superior to the other QT component
sheckylovejoy
17th June 2007, 09:46
Hello
I assume the above is this codec :
https://developer.berlios.de/projects/x264qtcodec/
I don't have a Mac but I also try to make my encodes QuickTime-readable.
Have you tried using VLC for MacOS ? VLC gives you access to all x264 options through its GUI. I don't know what version of x264 the current VLC is using though, but it must be a relatively recent one (my guess is >= v635)
Yes, I find the results with that QT component to be inferior to Apple's codec. Until I started using Handbrake, I couldn't understand what all the fuss was about with x264.
I will try VLC. Don't know why I didn't think of that.
sheckylovejoy
17th June 2007, 09:49
I've managed to get a pretty clean workflow for x264 in MOV or Quicktime compliant MP4. It involves Windows (because of AviSynth), which may mean that using whatever 4:2:2 codec you choose won't work, since QuickTime codecs on Windows are spotty.
Like I said, I'm trying to skin this cat on a Mac first, as a 100 min HD movie, even in Sheer codec (which I do own), is too big to be transferring over the gigabit e-net.
sheckylovejoy
17th June 2007, 18:23
Have you tried using VLC for MacOS ? VLC gives you access to all x264 options through its GUI.
cheers
audyovydeo
I don't see any x264 option is the "Streaming/Transcoding Wizard" in VLC
GUI Mac OS X. Am I doing this wrong?
PuzZLeR
17th June 2007, 20:53
Ok, this may not be the optimal solution, but something that WILL work.
Take these source files and dump them into a DvD author package. Don't even bother with menus or burning, just create a VIDEO_TS folder on your hard drive, then load that into HandBrake.
Yeah, it's lossy somewhat, but I never said it was an optimal solution. However, since it's a VIDEO_TS folder that you'll end up deleting after conversion, you may as well encode to these VOB files at the highest bitrate possible to preserve most of the visual quality.
I too love HandBrake here on Windows and take this extra step myself.
Then again, my stuff is SD content so it may not apply to you. Anyway, just a shot here in case it's something you didn't think about.
As well, since you have a Mac, you may want to look into ffmpegX, which may be what you need. Us PC users can only dream and drool over such an app.
sheckylovejoy
17th June 2007, 23:24
Ok, this may not be the optimal solution, but something that WILL work.
Take these source files and dump them into a DvD author package. Don't even bother with menus or burning, just create a VIDEO_TS folder on your hard drive, then load that into HandBrake.
As well, since you have a Mac, you may want to look into ffmpegX, which may be what you need. Us PC users can only dream and drool over such an app.
Not optimal, as you say. QT->MPEG2->AVC.
I put in a feature request on the handbrake forum to add QT input, but I'm not hopeful.
ffmpegX is getting there, but not quire ready for primetime with it's x264 implementation for what I need here. It is an awesome all-in-one GUI, as you say
Blue_MiSfit
17th June 2007, 23:37
I'm not suggesting copying it over the network. I'm suggesting outputting the project as Sheer, keeping it on the mac, but connecting to the mac through the network, and reading straight from the mac.
~MiSfit
sheckylovejoy
17th June 2007, 23:46
I'm not suggesting copying it over the network. I'm suggesting outputting the project as Sheer, keeping it on the mac, but connecting to the mac through the network, and reading straight from the mac.
~MiSfit
Ooooo, now that has possibilities. I'm waiting on an RMA'd PSU on the Windows box right now, but when I'm back up I will give that a try, thanks.
PuzZLeR
18th June 2007, 00:42
I put in a feature request on the handbrake forum to add QT input, but I'm not hopeful.
I see you did here:
http://handbrake.m0k.org/forum/viewtopic.php?t=1977
So did I actually:
http://handbrake.m0k.org/forum/viewtopic.php?t=1798
Yeah, reason to not be hopeful I agree.
I would think that changing this is changing the very philosophy of HandBrake itself I believe, so I wouldn't hold my breath on it. If we want HandBrake to do what we want with our files, we have to accept the lossier solution.
Even though we both adore HandBrake and x264, we're both out of luck on this particular feature my friend. I hope you solve your problem some way or another at any rate.
sheckylovejoy
When did this come out?
It is updated on a regular basis. The last sync core to x264 SVN-655. http://www003.upp.so-net.ne.jp/mycometg3/
MilSF
4th January 2008, 23:15
sheckylovejoy
It is updated on a regular basis. The last sync core to x264 SVN-655. http://www003.upp.so-net.ne.jp/mycometg3/
Kinda a dead thread, but wanted to mention that this QT plugin is now up to SVN-714. It's more "complete" than the berlioz.de plug-in, and a bit more straight forward than the VLC interface. I've included a few screencaps for reference. It's also the only plugin I've seen that will actually let you set the colr atom (see colr.png). For those who don't speak fluent ffmpeg, the flags tab includes tooltips for each option (see flags.png)
-MDG
Blue_MiSfit
6th January 2008, 11:13
coooool. I like that somebody actually did this!
Finally a good free h.264 codec for quicktime!
MilSF
7th January 2008, 02:12
The only caveat I've found (and I let the dev know) is you can't use frame reordering with with hinted tracks if you are using DSS/QTSS. The hinted video track gets truncated after a few seconds. I think it's just an issue with his implementation as others on the QTSS mailing list seem to be able to use frame reordering and x264 (via ffmpeg).
MilSF
7th February 2008, 18:03
The Quicktime component I have screen caps for above (http://www003.upp.so-net.ne.jp/mycometg3/) has been updated today:
Notes from his page:
Fix conflict with some Apple export components. Improve playback-load for B-Pyramid. Add save/load buttons. Extend limit of some parameters. Sync core to x264 SVN-736 and ffmpeg SVN-11870.
I'm still having issues creating hint tracks, even using RTP payload. I was hoping not to have to compile mp4box (sigh) but it looks like that's in my near future.
cacepi
7th February 2008, 20:00
I'm still having issues creating hint tracks, even using RTP payload. I was hoping not to have to compile mp4box (sigh) but it looks like that's in my near future.
Here, you can have mine (http://www.filesend.net/download.php?f=31aa90826d207c0a35f6c0b770a9078f) (UB).
MySchizoBuddy
8th February 2008, 00:16
Here, you can have mine (http://www.filesend.net/download.php?f=31aa90826d207c0a35f6c0b770a9078f) (UB).
did you compile it yourself, like compile the entire gpac suite.
if yes can you also compile x264 with mp4 support. My x264 compile is just plain vanilla x264, with no avi or mp4 support
cacepi
8th February 2008, 01:30
if yes can you also compile x264 with mp4 support. My x264 compile is just plain vanilla x264, with no avi or mp4 support
No problem: here you go (http://www.filesend.net/download.php?f=18e4039622ce5e577870f7dccd07df83). Vanilla 736 build, Univeral. They're 32-bit only, as I can't get gpac to compile 64-bit on Intel, but at least both are profiled.
Enjoy!
MySchizoBuddy
9th February 2008, 02:23
No problem: here you go (http://www.filesend.net/download.php?f=18e4039622ce5e577870f7dccd07df83). Vanilla 736 build, Univeral. They're 32-bit only, as I can't get gpac to compile 64-bit on Intel, but at least both are profiled.
Enjoy!
i can't seem to PM you, you prolly disabled it,
So can you compile one with avi support as well, So i can transcode avi files.
one more thing can explain how you got gpac 32bit to compile, what changes did you make to ./configure
thanks, sorry for hijacking this thread, I'm sure the mods are going to be pissed.
cacepi
10th February 2008, 01:05
can you compile one with avi support as well, So i can transcode avi files.
No, as avi input support in x264 is win32 only.
As for GPAC, src/utils/os_net.c has no typedef for 'u_long', so you have to change them to unsigned longs. (Which is what it should have been all along, as u_long isn't valid C without a proper typedef.)
MySchizoBuddy
10th February 2008, 20:33
ok lets take this over at gpac thread.
http://forum.doom9.org/showthread.php?p=1098684#post1098684
MilSF
1st October 2008, 05:36
Normally I wouldn't revive this thread just to post that there was an update, but I've seen a few threads about OSX lately, and this update has Psy RDO/Trellis available. Forgive the screenshots, but it's easier to do that than list all the changes in the last several months. For those interested, the developer includes the source code too. The values displayed are what the developer put for the Default "Tuned" settings on my machine.
From version log:
Sync core to x264 git-992 and ffmpeg SVN-15442
URL: http://www003.upp.so-net.ne.jp/mycometg3/
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.