FFMPEG and mp3 without separate LAME encoder trick.

This section is now closed.
Forum rules
Audacity 1.3.x is now obsolete. Please use the current Audacity 2.1.x version.

The final version of Audacity for Windows 98/ME is the legacy 2.0.0 version.
Locked
Goofus Maximus
Posts: 2
Joined: Fri May 07, 2010 5:36 pm
Operating System: Please select

FFMPEG and mp3 without separate LAME encoder trick.

Post by Goofus Maximus » Fri May 07, 2010 6:16 pm

I've just installed the new beta version of Audacity here, along with the FFMPEG libraries. I was surprised that mp3 encoding still wanted to use the LAME encoding library only, since encoding the mp3 format is one of FFMPEG's specialties, and I thought Audacity would use the second library if the first was not present. Thus, I experimented, and came up with this. I thought I'd share this tip, since I couldn't find anything similar using Google, and this worked for me. (Windows XP SP3. Vista and 7 user's mileage may vary)

I originally tried using the avformat-52.dll in the lame-enc library entry, just like the ffmpeg library entry uses, but that gave me an error, so on a whim, I tried using the libmp3lame-0.dll in place of the lame-enc.dll it wanted, and this worked, Metadata and bitrate options included. It identifies the dll as LAME 3.98.2

Anyhow from preferences -> Libraries, this is what I did:
Image

The only thing where it may not be working correctly, is in the joint-stereo area, since this method makes my test mp3 about twice as large as using the "stereo" option.

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: FFMPEG and mp3 without separate LAME encoder trick.

Post by Gale Andrews » Sat May 08, 2010 11:43 am

Goofus Maximus wrote:I've just installed the new beta version of Audacity here, along with the FFMPEG libraries. I was surprised that mp3 encoding still wanted to use the LAME encoding library only, since encoding the mp3 format is one of FFMPEG's specialties, and I thought Audacity would use the second library if the first was not present. Thus, I [paraphrase] located libmp3lame-0.dll in the FFmpeg installation folder instead of the lame-enc.dll it wanted, and this worked, Metadata and bitrate options included. It identifies the dll as LAME 3.98.2. The only thing where it may not be working correctly, is in the joint-stereo area, since this method makes my test mp3 about twice as large as using the "stereo" option.
Thanks, yes for a power user that may well work. We had discussed using libmp3lame from FFmpeg last year but decided not to make the considerable changes needed because at that time we thought a new 2.0 Release of Audacity was imminent. In any case, until we can make FFmpeg autodetected as LAME is if installed in the correct places - that is, without having to go into preferences to "locate" it - using FFmpeg for mp3 export is a non-starter.

You could also export MP3 without browsing in Preferences for LAME, by choosing "Custom FFmpeg export" in the Export File window, and choosing mp3 in the format list. Looks like that would give you CBR joint stereo though, without the ability to change that.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Goofus Maximus
Posts: 2
Joined: Fri May 07, 2010 5:36 pm
Operating System: Please select

Re: FFMPEG and mp3 without separate LAME encoder trick.

Post by Goofus Maximus » Sat May 08, 2010 1:08 pm

Is it also somehow technically possible to use an "external" codec like FFDShow? I'm curious now! :)

Gale Andrews
Quality Assurance
Posts: 41761
Joined: Fri Jul 27, 2007 12:02 am
Operating System: Windows 10

Re: FFMPEG and mp3 without separate LAME encoder trick.

Post by Gale Andrews » Sat May 08, 2010 7:05 pm

Goofus Maximus wrote:Is it also somehow technically possible to use an "external" codec like FFDShow? I'm curious now! :)
Yes in principle, choosing (external program) in the Export File window, which is a command line interface. I'm not 100% sure how to feed it an arbitrary path to the encoder, but if you put your encoder in a "Lame For Audacity" folder in the operating system's "Program Files" directory (i.e. the default location for the Audacity LAME installer), Audacity will see it. For example to use SOX, enter this in the Audacity command line export options:

sox -t wav - "%f"

Then enter the file name and extension required such as "Grandstream_ringtone.bin". And if you use the .dat extension you can save a text file containing a textual representation of the audio (a feature we get asked for quite a lot). That gives you for each sample a) the time since the beginning of the first sample and b) the sample value between 1 and -1.


Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual

Locked