Page 3 of 4

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

Posted: Tue Feb 17, 2009 1:35 pm
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.

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

Posted: Tue Feb 17, 2009 2:02 pm
by Ritsuka
Nothing new.
But the encoder has been improved in quicktime 7.6.

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

Posted: Tue Feb 17, 2009 6:42 pm
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!

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

Posted: Mon Mar 02, 2009 3:37 am
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!

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

Posted: Mon Mar 02, 2009 6:26 pm
by nightstrm
I second this request. :D

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

Posted: Mon Mar 02, 2009 10:00 pm
by cvk_b
I think there's good reason to let the dust settle on the new build system first.

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

Posted: Tue Mar 03, 2009 5:37 pm
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.

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

Posted: Wed Mar 04, 2009 6:32 am
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

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

Posted: Wed Mar 04, 2009 1:30 pm
by nightstrm
Thanks refulgentis and Ritsuka!

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

Posted: Wed Mar 04, 2009 8:10 pm
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

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

Posted: Wed Mar 04, 2009 11:53 pm
by jzietman
Same error here.

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

Posted: Thu Mar 05, 2009 1:37 am
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

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

Posted: Thu Mar 05, 2009 4:44 am
by jzietman
New patch confirmed working. Thank you!

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

Posted: Thu Mar 12, 2009 10:40 pm
by jzietman
Anyone else unable to patch the latest svn with this? Is there any chance that this will ever be committed to trunk?

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

Posted: Fri Mar 13, 2009 2:01 pm
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

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

Posted: Fri Mar 13, 2009 2:48 pm
by nightstrm
Woohoo! :D

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

Posted: Fri Mar 13, 2009 3:23 pm
by jzietman
That's fantastic!

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

Posted: Mon Mar 16, 2009 3:09 am
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.

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

Posted: Mon Mar 16, 2009 3:39 pm
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.

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

Posted: Wed Mar 25, 2009 3:13 pm
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

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

Posted: Wed Mar 25, 2009 7:40 pm
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.

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

Posted: Sat May 16, 2009 1:02 am
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.

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

Posted: Fri May 22, 2009 10:22 pm
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.

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

Posted: Fri May 22, 2009 11:02 pm
by JohnAStebbins
instead of commenting that line out, change hb_decsub to hb_decvobsub

[PATCH @ svn2440]

Posted: Sat May 23, 2009 2:36 am
by cvk_b
Oh look, I may have done something productive. Hopefully I didn't feck it up. :mrgreen: