[PATCH] High quality AAC encoder on Mac OS X

Archive of historical development discussions
Discussions / Development has moved to GitHub
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
nightstrm
Veteran User
Posts: 1887
Joined: Fri Mar 23, 2007 5:43 am

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by nightstrm »

Does this patch have new functionality, or simply an update so it compiles cleanly against SVN head?

As always, thanks for maintaining this... I love the output of CoreAudio @ AAC 256.
User avatar
Ritsuka
HandBrake Team
Posts: 1650
Joined: Fri Jan 12, 2007 11:29 am

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by Ritsuka »

Nothing new.
But the encoder has been improved in quicktime 7.6.
iiro
Posts: 11
Joined: Mon Apr 28, 2008 5:03 pm

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by iiro »

I successfully patched the revision 2166 and made a test video with Coreaudio Dolby Pro Logic II @320 KB/s, DRC 1.25. The sound works fine in iTunes but crashes Quicktime — still, I guess it's the bug that makes QT crash on all new HB encodes.

Great work with this!
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by jzietman »

The iTunes aac patch no longer works with current svn (I assume that the extensive build system upgrades are the perpetrators). Any chance of an update? I tried going through and doing it manually but I got stuck in the mac xcode project file...

Thanks in advance!
nightstrm
Veteran User
Posts: 1887
Joined: Fri Mar 23, 2007 5:43 am

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by nightstrm »

I second this request. :D
cvk_b
Veteran User
Posts: 527
Joined: Sun Mar 18, 2007 2:11 am

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by cvk_b »

I think there's good reason to let the dust settle on the new build system first.
User avatar
Ritsuka
HandBrake Team
Posts: 1650
Joined: Fri Jan 12, 2007 11:29 am

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by Ritsuka »

Actually the only needs that need to be redone is to add the audiotoolbox.framework in the xcode project.
But my macbook pro video card is broken and I don't have xcode and friends installed anywhere so I can't post any updated patch right now.
refulgentis
Bright Spark User
Posts: 342
Joined: Mon Apr 14, 2008 5:08 am

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by refulgentis »

as per Ritsuka's instructions, this should work (and worksforme): http://pastie.org/406891

I didn't bother doing a fresh checkout of SVN to double check, if someone can please post after they test to confirm this works that would be great
EDIT: i'm getting better with SVN and realized a few rms and an svn up would be the same as a fresh checkout -- I can confirm this works now
nightstrm
Veteran User
Posts: 1887
Joined: Fri Mar 23, 2007 5:43 am

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by nightstrm »

Thanks refulgentis and Ritsuka!
eisa01
Posts: 1
Joined: Wed Mar 04, 2009 8:00 pm

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by eisa01 »

Strange, I couldn't get it to work. Tried on r2220, and I managed to compile it fine without the patch...

I think this is the error I get:

Code: Select all

Ld /usr/local/src/hbtrunk/build/HandBrake.app/Contents/MacOS/HandBrake normal i386
    mkdir /usr/local/src/hbtrunk/build/HandBrake.app/Contents/MacOS
    cd /usr/local/src/hbtrunk/macosx
    setenv MACOSX_DEPLOYMENT_TARGET 10.5
    /Developer/usr/bin/g++-4.0 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/usr/local/src/hbtrunk/build -F/usr/local/src/hbtrunk/build -F/usr/local/src/hbtrunk/macosx -F/usr/local/src/hbtrunk/macosx -filelist /usr/local/src/hbtrunk/build/macosx/HandBrake.build/Objects-normal/i386/HandBrake.LinkFileList -mmacosx-version-min=10.5 /usr/local/src/hbtrunk/build/libhb/libhb.a /usr/local/src/hbtrunk/build/contrib/lib/libmp4v2.a /usr/local/src/hbtrunk/build/contrib/lib/liba52.a /usr/local/src/hbtrunk/build/contrib/lib/libavformat.a /usr/local/src/hbtrunk/build/contrib/lib/libavcodec.a /usr/local/src/hbtrunk/build/contrib/lib/libavutil.a /usr/local/src/hbtrunk/build/contrib/lib/libdvdread.a /usr/local/src/hbtrunk/build/contrib/lib/libfaac.a /usr/local/src/hbtrunk/build/contrib/lib/libmp3lame.a /usr/local/src/hbtrunk/build/contrib/lib/libmpeg2.a /usr/local/src/hbtrunk/build/contrib/lib/libvorbis.a /usr/local/src/hbtrunk/build/contrib/lib/libvorbisenc.a /usr/local/src/hbtrunk/build/contrib/lib/libogg.a /usr/local/src/hbtrunk/build/contrib/lib/libsamplerate.a /usr/local/src/hbtrunk/build/contrib/lib/libx264.a /usr/local/src/hbtrunk/build/contrib/lib/libxvidcore.a /usr/local/src/hbtrunk/build/contrib/lib/libdca.a /usr/local/src/hbtrunk/build/contrib/lib/libmkv.a /usr/local/src/hbtrunk/build/contrib/lib/libswscale.a /usr/local/src/hbtrunk/build/contrib/lib/libtheora.a /usr/local/src/hbtrunk/build/contrib/lib/libfaad.a -lbz2 -lz -framework Cocoa -framework Quartz -framework QTKit -framework OpenGL -framework IOKit -lz -framework Growl -framework Sparkle -framework AudioToolbox -o /usr/local/src/hbtrunk/build/HandBrake.app/Contents/MacOS/HandBrake
Undefined symbols:
  "_hb_encca_aac", referenced from:
      _hb_encca_aac$non_lazy_ptr in libhb.a(hb.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status

PBXCp /usr/local/src/hbtrunk/build/HandBrake.app/Contents/Frameworks/Growl.framework Growl.framework
    mkdir /usr/local/src/hbtrunk/build/HandBrake.app/Contents/Frameworks
    cd /usr/local/src/hbtrunk/macosx
    /Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude CVS -exclude .svn -strip-debug-symbols -resolve-src-symlinks /usr/local/src/hbtrunk/macosx/Growl.framework /usr/local/src/hbtrunk/build/HandBrake.app/Contents/Frameworks

PBXCp /usr/local/src/hbtrunk/build/HandBrake.app/Contents/Frameworks/Sparkle.framework Sparkle.framework
    cd /usr/local/src/hbtrunk/macosx
    /Developer/Library/PrivateFrameworks/DevToolsCore.framework/Resources/pbxcp -exclude .DS_Store -exclude CVS -exclude .svn -strip-debug-symbols -resolve-src-symlinks /usr/local/src/hbtrunk/macosx/Sparkle.framework /usr/local/src/hbtrunk/build/HandBrake.app/Contents/Frameworks
** BUILD FAILED **

The following build commands failed:
HandBrakeCLI:
	Ld /usr/local/src/hbtrunk/build/HandBrakeCLI normal i386
HandBrake:
	Ld /usr/local/src/hbtrunk/build/HandBrake.app/Contents/MacOS/HandBrake normal i386
(2 failures)

make: *** [macosx.build] Error 1
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by jzietman »

Same error here.
refulgentis
Bright Spark User
Posts: 342
Joined: Mon Apr 14, 2008 5:08 am

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by refulgentis »

sorry guys, make a rookie mistake (told you I'm bad with SVN :P), basically I used svn diff to create the patch, but forgot there was a whole new file added for CoreAudio in libhb, and I didn't 'add' that to my svn repository so it didn't know to include that in the patch. build still succeeded because the new build system is so good.

'good' patch will be here shortly.

http://pastebin.ca/1353141
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by jzietman »

New patch confirmed working. Thank you!
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by jzietman »

Anyone else unable to patch the latest svn with this? Is there any chance that this will ever be committed to trunk?
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by jbrjake »

jzietman wrote:Is there any chance that this will ever be committed to trunk?
http://handbrake.fr/irclogs/handbrake-d ... 1_pg2.html:
[19:27] [jbrjake] KonaB1end: what's the plan for platform-specific stuff?
[19:28] [KonaB1end] jbrjake: docwise?
[19:28] [jbrjake] sorry i mean code
[19:28] [KonaB1end] libhb uses the same mechanism .
[19:28] [jbrjake] like saintdev was talking about the other day with asm for yadif
[19:28] [KonaB1end] oh,
[19:29] [KonaB1end] we have many methods of compiling optional files.
[19:29] [KonaB1end] we can key off:
[19:29] *** jbrjake is just curious if the new build system might allow the possibility of being extended to do stuff like ritsuka's core audio patch in an elegant way that keeps the code separate from the main body
[19:29] [KonaB1end] absolutely.
[19:29] [KonaB1end] refer to libhb/module.defs
[19:30] [KonaB1end] at bottom is just an example of conditional defines keying off $(BUILD.system)
[19:30] [KonaB1end] features can be done too.
[19:30] [KonaB1end] ie: we can add configure --enable-ritsuka
[19:31] [KonaB1end] and then FEATURE.ritsuka = 1 would show up to make .
[19:31] [jbrjake] ritsuka: and yes, that means i will stop my b*tching and let you check it in, if it's all segmented from the vanilla code
nightstrm
Veteran User
Posts: 1887
Joined: Fri Mar 23, 2007 5:43 am

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by nightstrm »

Woohoo! :D
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by jzietman »

That's fantastic!
eddyg
Veteran User
Posts: 798
Joined: Mon Apr 23, 2007 3:34 am

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by eddyg »

Hi,

The problem was never the build system, but how to have optional modules linked in and auto discovered and enabled without the core code knowing that they exist prior to that point.

The way I've seen this done in the past is to have some magic in the module which you scan for, and then get the module function init address from that. Once you have that you can initialise all your modules so that they can call hb_register() to register themselves with the infra.

However - I don't know how to do that myself. And maybe there is a better way of getting optionally linked in modules to initialise and register themselves?

Cheers, Ed.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by jbrjake »

eddyg wrote:The problem was never the build system, but how to have optional modules linked in and auto discovered and enabled without the core code knowing that they exist prior to that point.
Oh I agree that what you proposed earlier in the thread is clearly the optimal solution, with a sort of plug-in system for code to register itself....but we've been waiting awhile now and no one's done that, and the perfect shouldn't be the enemy of the good.

While at a design level I have major qualms about ifdef'd code in hb_init and the CLI, etc, the new build system's file autosensing ability at least makes this platform-specific stuff more clearly delineated, organizationally, at the file system level. Having the ca_aac.c file squirreled away in a subdir of libhb/ just for os x-specific code at least alleviates one of my concerns....which is that when this mushrooms out and we have a bunch of platform-specific codecs, people will be able to look through libhb/* and at least have a sense of what encoder and decoder wrappers are available where.
User avatar
Ritsuka
HandBrake Team
Posts: 1650
Joined: Fri Jan 12, 2007 11:29 am

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by Ritsuka »

As jbrjake gave his approval to commit the patch to svn, I post here an updated version for review/comment. If no one complains I'll commit it soon.

http://pastie.org/426557
cvk_b
Veteran User
Posts: 527
Joined: Sun Mar 18, 2007 2:11 am

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by cvk_b »

Ritsuka wrote:As jbrjake gave his approval to commit the patch to svn, I post here an updated version for review/comment. If no one complains I'll commit it soon.

http://pastie.org/426557
Just built with your patch and 'disable-xcode'. Compiled fine. Test chapter encodes seem fine. Thanks.
laika 1957
Posts: 5
Joined: Fri May 15, 2009 11:50 pm

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by laika 1957 »

Ritsuka wrote:As jbrjake gave his approval to commit the patch to svn, I post here an updated version for review/comment. If no one complains I'll commit it soon.

http://pastie.org/426557
Just some heads up...

This patch no longer merges properly with the current trunk (2419); 1 failure, in libhb/hb.h. It seems to fail on a simply difference that is easily corrected by hand, and after that it builds with one error from libhb/hb.c (undeclared: hb_register( &hb_decsub );). Simply commenting this line out makes the build succeed, and the CA AAC seems to work fine.

I'm very glad to see someone taking an effort to enable the CoreAudio AAC encoder in the OS X version of HB, and I hope to see it finalized in the next release.
cvk_b
Veteran User
Posts: 527
Joined: Sun Mar 18, 2007 2:11 am

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by cvk_b »

laika 1957 wrote: Simply commenting this line out makes the build succeed, and the CA AAC seems to work fine..
That would most likely break subtitle support.
User avatar
JohnAStebbins
HandBrake Team
Posts: 5712
Joined: Sat Feb 09, 2008 7:21 pm

Re: [PATCH] High quality AAC encoder on Mac OS X

Post by JohnAStebbins »

instead of commenting that line out, change hb_decsub to hb_decvobsub
cvk_b
Veteran User
Posts: 527
Joined: Sun Mar 18, 2007 2:11 am

[PATCH @ svn2440]

Post by cvk_b »

Oh look, I may have done something productive. Hopefully I didn't feck it up. :mrgreen:
Post Reply