Discussion:
[BitPim-devel] Optimizing and updating ringtone code
Nathan Hjelm
2009-03-05 21:00:06 UTC
Permalink
I find that adjustwavfilevolume is horribly slow on my macbook pro so
I propose we change it to use ffmpeg -vol. This change will require a
new build off ffmpeg for each platform (I have a universal binary for
macos x ready). The speed increase is more than an order of magnitude
(it took around 60 seconds to start playing a 260 second song with the
old routine and it now takes about a second).

Here is the updated routine:
def adjustwavfilevolume(wavfilename, gain):
""" Ajdust the volume of a wav file.
"""
temp_name=common.gettempfilename("wav")
ffmpeg=gethelperbinary ("ffmpeg")
run(ffmpeg, "-i", wavfilename, "-vol", `int(pow(10.0, gain/10.0)
* 256.0)`, temp_name)
os.remove(wavfilename)
os.rename(temp_name, wavfilename)

Additionally, since I want to add support for mpeg4 (AAC audio)
ringtones support since all new phone models support them (I have
already finished the code). AAC sounds better than mp3 at comparable
bitrates. AAC support requires that the new build of ffmpeg has
support for libfaac and libfaad.

Any comments?

-Nathan Hjelm
Joe Pham
2009-03-05 23:57:55 UTC
Permalink
Post by Nathan Hjelm
I propose we change it to use ffmpeg -vol.
I'm all for it, though I'd need Stephen to build the Linux version. My laptop died so I lost access to all of my Linux partitions. btw, I'm still working with Sean to upload his Mac builds for the test release.

-Joe Pham


____________________________________________________________
Fashion Design Education - Click Here!
http://thirdpartyoffers.netzero.net/TGL2231/fc/BLSrjnxaFaAziHeDqUqEiOfudycny8Qnj5QFn4xF6GAfdoYWRMlh5r2uYaE/
Stephen Wood
2009-03-06 03:59:06 UTC
Permalink
Point me to the sources and I'll build it on the oldest Linux I can find.

Stephen
Post by Joe Pham
Post by Nathan Hjelm
I propose we change it to use ffmpeg -vol.
I'm all for it, though I'd need Stephen to build the Linux version. My
laptop died so I lost access to all of my Linux partitions. btw, I'm still
working with Sean to upload his Mac builds for the test release.
-Joe Pham
Nathan Hjelm
2009-03-06 04:06:57 UTC
Permalink
git ffmpeg: http://www.ffmpeg.org/download.html (not sure where the
get a release-- they claim no such thing exists)
lame 3.98: http://sourceforge.net/project/showfiles.php?group_id=290&package_id=309
(3.98.2 is buggy)
faac 1.28, faad 2.7: http://www.audiocoding.com/downloads.html

-Nathan
Post by Stephen Wood
Point me to the sources and I'll build it on the oldest Linux I can find.
Stephen
Post by Nathan Hjelm
I propose we change it to use ffmpeg -vol.
I'm all for it, though I'd need Stephen to build the Linux version.
My laptop died so I lost access to all of my Linux partitions. btw,
I'm still working with Sean to upload his Mac builds for the test
release.
-Joe Pham
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Nathan Hjelm
2009-03-06 04:04:25 UTC
Permalink
I uploaded some of the mpeg4 code to SVN but will hold off on the rest
of the updates until the new builds off ffmpeg are ready.

I will upload the updated ffmpeg.mbin (universal, svn ffmpeg, mp3lame
3.98, libfaac 1.28, libfaad 2.7) unless Sean wants to handle that. As
for the Linux version, I can build one on Monday for x86_64. Is the
current build a x86_64 binary or just i386?

-Nathan
Post by Joe Pham
Post by Nathan Hjelm
I propose we change it to use ffmpeg -vol.
I'm all for it, though I'd need Stephen to build the Linux version.
My laptop died so I lost access to all of my Linux partitions. btw,
I'm still working with Sean to upload his Mac builds for the test
release.
-Joe Pham
____________________________________________________________
Fashion Design Education - Click Here!
http://thirdpartyoffers.netzero.net/TGL2231/fc/BLSrjnxaFaAziHeDqUqEiOfudycny8Qnj5QFn4xF6GAfdoYWRMlh5r2uYaE/
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Sean Patrick Burke
2009-03-06 17:38:04 UTC
Permalink
Nathan,
If you have a build ready, that's fine otherwise I can build a new
one. Your call.

Sean
--
Sean Patrick Burke
Full time law student, part time developer
http://www.bitpim.org
Post by Nathan Hjelm
I uploaded some of the mpeg4 code to SVN but will hold off on the rest
of the updates until the new builds off ffmpeg are ready.
I will upload the updated ffmpeg.mbin (universal, svn ffmpeg, mp3lame
3.98, libfaac 1.28, libfaad 2.7) unless Sean wants to handle that. As
for the Linux version, I can build one on Monday for x86_64. Is the
current build a x86_64 binary or just i386?
-Nathan
Post by Joe Pham
Post by Nathan Hjelm
I propose we change it to use ffmpeg -vol.
I'm all for it, though I'd need Stephen to build the Linux version.
My laptop died so I lost access to all of my Linux partitions. btw,
I'm still working with Sean to upload his Mac builds for the test
release.
-Joe Pham
____________________________________________________________
Fashion Design Education - Click Here!
http://thirdpartyoffers.netzero.net/TGL2231/fc/BLSrjnxaFaAziHeDqUqEiOfudycny8Qnj5QFn4xF6GAfdoYWRMlh5r2uYaE/
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Nathan Hjelm
2009-03-06 18:36:57 UTC
Permalink
Done. The binary is a little big (10 MB) but thats the cost of a
universal binary. I will try to make a smaller one by turning off some
of ffmpeg's features (most video formats since we don't need them at
the moment) later today.

-Nathan
Post by Sean Patrick Burke
Nathan,
If you have a build ready, that's fine otherwise I can build a new
one. Your call.
Sean
--
Sean Patrick Burke
Full time law student, part time developer
http://www.bitpim.org
Post by Nathan Hjelm
I uploaded some of the mpeg4 code to SVN but will hold off on the rest
of the updates until the new builds off ffmpeg are ready.
I will upload the updated ffmpeg.mbin (universal, svn ffmpeg, mp3lame
3.98, libfaac 1.28, libfaad 2.7) unless Sean wants to handle that. As
for the Linux version, I can build one on Monday for x86_64. Is the
current build a x86_64 binary or just i386?
-Nathan
Post by Joe Pham
Post by Nathan Hjelm
I propose we change it to use ffmpeg -vol.
I'm all for it, though I'd need Stephen to build the Linux version.
My laptop died so I lost access to all of my Linux partitions. btw,
I'm still working with Sean to upload his Mac builds for the test
release.
-Joe Pham
____________________________________________________________
Fashion Design Education - Click Here!
http://thirdpartyoffers.netzero.net/TGL2231/fc/BLSrjnxaFaAziHeDqUqEiOfudycny8Qnj5QFn4xF6GAfdoYWRMlh5r2uYaE/
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Sean Patrick Burke
2009-03-06 18:44:35 UTC
Permalink
Not a problem Nathan. I'll try a build this afternoon to make sure
everything is running smoothly.
s
--
Sean Patrick Burke
Full time law student, part time developer
http://www.bitpim.org
Post by Nathan Hjelm
Done. The binary is a little big (10 MB) but thats the cost of a
universal binary. I will try to make a smaller one by turning off some
of ffmpeg's features (most video formats since we don't need them at
the moment) later today.
-Nathan
Post by Sean Patrick Burke
Nathan,
If you have a build ready, that's fine otherwise I can build a new
one. Your call.
Sean
--
Sean Patrick Burke
Full time law student, part time developer
http://www.bitpim.org
Post by Nathan Hjelm
I uploaded some of the mpeg4 code to SVN but will hold off on the rest
of the updates until the new builds off ffmpeg are ready.
I will upload the updated ffmpeg.mbin (universal, svn ffmpeg, mp3lame
3.98, libfaac 1.28, libfaad 2.7) unless Sean wants to handle that. As
for the Linux version, I can build one on Monday for x86_64. Is the
current build a x86_64 binary or just i386?
-Nathan
Post by Joe Pham
Post by Nathan Hjelm
I propose we change it to use ffmpeg -vol.
I'm all for it, though I'd need Stephen to build the Linux version.
My laptop died so I lost access to all of my Linux partitions.
btw,
I'm still working with Sean to upload his Mac builds for the test
release.
-Joe Pham
____________________________________________________________
Fashion Design Education - Click Here!
http://thirdpartyoffers.netzero.net/TGL2231/fc/BLSrjnxaFaAziHeDqUqEiOfudycny8Qnj5QFn4xF6GAfdoYWRMlh5r2uYaE/
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Nathan Hjelm
2009-03-06 20:00:06 UTC
Permalink
Cool, I will upload the smaller binary. Can you test it on a ppc
machine? I don't have access to one right now.

-Nathan
Post by Sean Patrick Burke
Not a problem Nathan. I'll try a build this afternoon to make sure
everything is running smoothly.
s
--
Sean Patrick Burke
Full time law student, part time developer
http://www.bitpim.org
Post by Nathan Hjelm
Done. The binary is a little big (10 MB) but thats the cost of a
universal binary. I will try to make a smaller one by turning off some
of ffmpeg's features (most video formats since we don't need them at
the moment) later today.
-Nathan
Post by Sean Patrick Burke
Nathan,
If you have a build ready, that's fine otherwise I can build a new
one. Your call.
Sean
--
Sean Patrick Burke
Full time law student, part time developer
http://www.bitpim.org
Post by Nathan Hjelm
I uploaded some of the mpeg4 code to SVN but will hold off on the rest
of the updates until the new builds off ffmpeg are ready.
I will upload the updated ffmpeg.mbin (universal, svn ffmpeg, mp3lame
3.98, libfaac 1.28, libfaad 2.7) unless Sean wants to handle that. As
for the Linux version, I can build one on Monday for x86_64. Is the
current build a x86_64 binary or just i386?
-Nathan
Post by Joe Pham
Post by Nathan Hjelm
I propose we change it to use ffmpeg -vol.
I'm all for it, though I'd need Stephen to build the Linux
version.
My laptop died so I lost access to all of my Linux partitions.
btw,
I'm still working with Sean to upload his Mac builds for the test
release.
-Joe Pham
____________________________________________________________
Fashion Design Education - Click Here!
http://thirdpartyoffers.netzero.net/TGL2231/fc/BLSrjnxaFaAziHeDqUqEiOfudycny8Qnj5QFn4xF6GAfdoYWRMlh5r2uYaE/
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Stephen Wood
2009-03-06 18:52:56 UTC
Permalink
Let me know what you turn off and how so that I can do the same to the Linux
binary to keep its size down too.

Stephen
Post by Nathan Hjelm
Done. The binary is a little big (10 MB) but thats the cost of a
universal binary. I will try to make a smaller one by turning off some
of ffmpeg's features (most video formats since we don't need them at
the moment) later today.
-Nathan
Nathan Hjelm
2009-03-06 19:58:33 UTC
Permalink
Attached is a modified version of ffmpeg's configure script. It uses
libavcodec/allcodecs_dis.c to turn off unwanted codecs. Much simpler
than using --disable-encoder :D. I was able to save about 3MB on the
universal binary by disabling these codecs.

The only video codec not disabled is the h264 encoder/decoder as it is
needed by the h264 parser (might be useful for extracting audio out of
video files).



-Nathan
Post by Stephen Wood
Let me know what you turn off and how so that I can do the same to
the Linux binary to keep its size down too.
Stephen
Done. The binary is a little big (10 MB) but thats the cost of a
universal binary. I will try to make a smaller one by turning off some
of ffmpeg's features (most video formats since we don't need them at
the moment) later today.
-Nathan
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San
Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the
Enterprise
-Strategies to boost innovation and cut costs with open source
participation
-Receive a $600 discount off the registration fee with the source
code: SFAD
http://p.sf.net/sfu/XcvMzF8H_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Nathan Hjelm
2009-03-06 19:59:28 UTC
Permalink
Forgot the include my ffmpeg configuration options:

./configure --prefix=/usr/local --enable-static --enable-libfaac --
enable-libfaad --enable-libmp3lame --enable-gpl

-Nathan
Joe Pham
2009-03-09 20:37:46 UTC
Permalink
Post by Nathan Hjelm
faac 1.28, faad 2.7: http://www.audiocoding.com/downloads.html
The use of these libraries requires either patent licensing and/or payment, so it's a no go for inclusion with BitPim (unless we can get the license for free!)


-Joe Pham



____________________________________________________________
Be there without being there. Click now for great video conferencing solutions!
http://thirdpartyoffers.netzero.net/TGL2231/fc/BLSrjnxPnB6kaYSMtwjw0lecucjkmc3L0i0l4Yr8kBe3zs4e9DWxplKcfXS/
Nathan Hjelm
2009-03-09 21:07:49 UTC
Permalink
Hmmm, doesn't the inclusion of libmp3lame (required for mp3 support) also have this problem? Both libraries are GPL but have licensing restrictions on the distribution in binary format :-/. Did we get the mp3 license for free? If so I will see if we can get a similar agreement so we can use faac.

If not I will rebuild mplayer without mp4 support and upload it to svn.

-Nathan
Post by Joe Pham
Post by Nathan Hjelm
faac 1.28, faad 2.7: http://www.audiocoding.com/downloads.html
The use of these libraries requires either patent licensing and/or payment, so it's a no go for inclusion with BitPim (unless we can get the license for free!)
-Joe Pham
____________________________________________________________
Be there without being there. Click now for great video conferencing solutions!
http://thirdpartyoffers.netzero.net/TGL2231/fc/BLSrjnxPnB6kaYSMtwjw0lecucjkmc3L0i0l4Yr8kBe3zs4e9DWxplKcfXS/
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
BitPim-devel mailing list
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
Loading...