HydrogenAudio

Lossy Audio Compression => MP3 => MP3 - Tech => Topic started by: Markosz on 2020-04-13 13:39:32

Title: freeformat- how I can create mp3 @ 384kbps?
Post by: Markosz on 2020-04-13 13:39:32
Hello everyone
Please let me know how I can create mp3 in high bitrate looking  for 384kbps
What kind of software I need may I create this files from CD .?
Or I need high resolution files.?
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: itisljar on 2020-04-13 13:53:17
Please let me know how I can create mp3 in high bitrate looking  for 384kbps
What kind of software I need may I create this files from CD .?
Or I need high resolution files.?

You need latest lame encoder, original wav files and knowledge of working in console.
Simplest, put your input.wav file and lame.exe in same folder, navigate to that folder in console, and then type this:
lame.exe --freeformat -b 384 input.wav
Be aware, though, that not many players will play it. Foobar2000 says it doesn't know what the hell this is :) VLC plays it.
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: DVDdoug on 2020-04-13 15:34:50
The highest standard MP3 bitrate is 320kbps.     If you're getting audible artifacts at 320kbps, those artifacts are probably not bitrate-related and going to a higher (or slightly lower) bitrate probably won't make any difference.

Most of the time, you don't have to push MP3 to it's limits (or past it's official limits) to get transparent compression (i.e. an MP3 that sounds identical to the uncompressed original in a blind ABX test). 

Quote
What kind of software I need may I create this files from CD .?
Or I need high resolution files.?
If you can use a different format, FLAC is lossless.   You'll get typically files that are a little more than twice the size of a good-quality MP3 (a bitrate of around 700kbps).
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: Markosz on 2020-04-13 18:18:32
You need latest lame encoder, original wav files and knowledge of working in console.
Simplest, put your input.wav file and lame.exe in same folder, navigate to that folder in console, and then type this:
lame.exe --freeformat -b 384 input.wav
Be aware, though, that not many players will play it. Foobar2000 says it doesn't know what the hell this is :) VLC plays it.

Thank you I’m not sure  what you mean when you talk about console what kind of console you talking about ?
Are you talking about Windows prompt ?


mod edit - fix quote
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: Markosz on 2020-04-13 18:21:43
The highest standard MP3 bitrate is 320kbps.     If you're getting audible artifacts at 320kbps, those artifacts are probably not bitrate-related and going to a higher (or slightly lower) bitrate probably won't make any difference.

I would like to test myself then I can have some options




mod edit - fix quote
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: itisljar on 2020-04-13 19:35:59
Thank you I’m not sure  what you mean when you talk about console what kind of console you talking about ?
Are you talking about Windows prompt ?
Yes, prompt, I am working on various OSes, so all these are consoles to me :)
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: Markosz on 2020-04-13 20:06:25
I will need your help and baby steps how to move wave file and lame to prompt comment
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: ajp9 on 2020-04-13 21:51:09
Many older versions of LAME can handle compressing free format. I know that 3.8x does; it's likely your version can.

Converting to free format can be done in foobar2000 (even though foobar2000 won't recognize the resulting MP3). In fb2k, select your file to convert to MP3, go to the Converter Setup->Output format, click Add New; select MP3 (LAME) encoder, then select Custom for the encoder. By default you should see the text "-S --noreplaygain -V 2 - %d" in the command line options (Parameters). Replace the "-V 2" text with "-b 384 -h --freeformat". That will set up the encoder to do free format at 384 kbps at high quality (the -h means high quality).
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: Markosz on 2020-04-14 00:04:13
I was able to navigate to folder with wave file and lame .exe then I write commend
lame.exe - -freeformat - b 384 input wav
Come with unrecognized option
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: m14u on 2020-04-14 00:22:50
ctrl+c, ctrl+v
I would like to test myself[...]
:'(
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: Markosz on 2020-04-14 00:41:52
Many older versions of LAME can handle compressing free format. I know that 3.8x does; it's likely your version can.

Converting to free format can be done in foobar2000 (even though foobar2000 won't recognize the resulting MP3). In fb2k, select your file to convert to MP3, go to the Converter Setup->Output format, click Add New; select MP3 (LAME) encoder, then select Custom for the encoder. By default you should see the text "-S --noreplaygain -V 2 - %d" in the command line options (Parameters). Replace the "-V 2" text with "-b 384 -h --freeformat". That will set up the encoder to do free format at 384 kbps at high quality (the -h means high quality).
Thank you very much for your help some how I have error please re check parameters
I use lime 3.1 and 3.99 I try to decode wave file to mp3
In Parameters line -b 384 -h —freeformat %d
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: korth on 2020-04-14 00:49:35
Code: [Select]
-S --noreplaygain -b 384 -h --freeformat - %d
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: Markosz on 2020-04-14 01:16:11
The encoder has terminated  prematurely with code -1. (0xFFFFFFFF)
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: Markosz on 2020-04-14 01:38:23
Ok i finally was able to make mp3 384kbps thank you all for help
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: kode54 on 2020-04-14 02:46:04
Now, good luck getting anything to play it.
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: Brazil2 on 2020-04-14 14:28:29
Now, good luck getting anything to play it.
Anything using the MAD decoder:
https://sourceforge.net/projects/mad/

Examples: SoX with libmad, Winamp with in_mad plugin, VLC, MADplay.
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: kode54 on 2020-04-15 01:30:52
Yes, and they can't be doing their own MP3 stream parsing. Freeformat requires special parsing, since the only indicator that it's free format is that the length field in the packet does not indicate the packet length.
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: Markosz on 2020-04-15 02:22:32
Hi everyone
I can play this files with Cool Player I didn’t have to do anything no changes no set up I have no idea if this player have Mad decoder but plays MP3 384 kbps I was doing this experiment because DCC player is set up for MPEG 1 384kbps I like to hear if there is differences in quality
My question is how to set up Foobar2000 player with this Mad decoder ?
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: kode54 on 2020-04-15 08:01:16
You don't.
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: m14u on 2020-04-15 11:04:57
maybe Command-Line Decoder Wrapper (http://www.foobar2000.org/components/view/foo_input_exe) can help you. and try use a comma...
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: Brazil2 on 2020-04-15 13:05:03
Yes, and they can't be doing their own MP3 stream parsing.
Well, it works fine with SoX, I just dropped libmad.dll into SoX' folder and here is the result with a 512 kbps Free Format file:

Code: [Select]
D:\Tools\SoX>sox FF512k.mp3 -d

FF512k.mp3:

 File Size: 1.88M     Bit Rate: 512k
  Encoding: MPEG audio
  Channels: 2 @ 16-bit
Samplerate: 44100Hz
Replaygain: off
  Duration: 00:00:29.39

In:99.9% 00:00:29.36 [00:00:00.03] Out:1.29M [      |      ] Hd:0.2 Clip:0
Done.

I don't have Winamp anymore but since 1by1 supports Winamp plugins I just tried to drop in_mad.dll 0.15.1b into it's folder and here is the result:
(https://images2.imgbox.com/f5/97/fZjYtSjM_o.png)

And latest VLC plays Free Format out of the box, nothing to tweak / tune.
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: itisljar on 2020-04-15 16:20:49
Is thera a specific reason why foobar2000 doesn't play freeformat mp3 files?
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: rutra80 on 2020-04-15 18:53:38
Because they are not quite mp3 files and because there are better alternatives which are both of higher quality at that bitrates and more compatible? Supporting them could make that evolutional deadend more popular.
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: [JAZ] on 2020-04-15 19:36:15
I was doing this experiment because DCC player is set up for MPEG 1 384kbps
What do you mean with DCC?   Digital Compact Cassette? That is NOT MP3, that is MP1 and that does have a 384kbps standard setting. Or do you mean DVB (Digital video broadcast? That would be MP2).
LAME is not an MP1 encoder. (for MP2, there is twolame.  ).
MP3 players might or might not support MP1 (just like freeformat MP3). MP2 is more supported
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: ajp9 on 2020-04-16 18:07:16
Because they are not quite mp3 files and because there are better alternatives which are both of higher quality at that bitrates and more compatible? Supporting them could make that evolutional deadend more popular.
While the format is more wasteful in space compared to Vorbis and AAC, free format is still very much a valid MP3. It's only non-standard. Out of the various possible header codes used for free format, I've only seen two in practice. mpg123 already covers one of them; to get mpg123 to recognize both is pretty easy, and only requires changing a line or two in one source file.

ffmpeg recognizes and decodes all of the free format MP3s. Really, player decoders are behind on this. I expected more from MPC-HC.
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: kode54 on 2020-04-16 22:31:14
The only way for a stream parser to recognize Free Format properly is to blindly search ahead for the sync word, since there is no other way to detect the length of a packet, other than completely parsing it.
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: nu774 on 2020-04-18 06:04:27
The only way for a stream parser to recognize Free Format properly is to blindly search ahead for the sync word, since there is no other way to detect the length of a packet, other than completely parsing it.
Theoretically, if we store it in a proper container such as mp4, each frame can be externally delimited on the container side.
ffmpeg recognizes and decodes all of the free format MP3s. Really, player decoders are behind on this. I expected more from MPC-HC.
Well, which version of ffmpeg have you tried?
I just tried with lame --freeformat -b 384, but ffmpeg (version 4.1.4) cannot decode the resulting file.
According to a comment in the libavcodec source (mpegaudio_template.c), they are aware of the free format.
However, when bitrate_index in the frame header is zero, decode_frame() of the decoder just returns an error.
Since this check is in the decoder, ffmpeg won't be able to handle freeformat mp3 even when stored in containers such as mp4.
Title: Re: freeformat- how I can create mp3 @ 384kbps?
Post by: ajp9 on 2020-04-19 20:15:43
Huh. I was under the impression that it was ffmpeg under Audacity that loaded free format.

Through process of elimination, and checking the source code, it appears that Audacity's built-in MP3 decoder(s) is handling it.