Quantcast

When encoding mp3 at low bitrate FFmpeg gives error report.

classic Classic list List threaded Threaded
8 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

When encoding mp3 at low bitrate FFmpeg gives error report.

bat guano

Hi
When encoding to mp3 at low bitrate FFmpeg gives a (red) error report.
[mp3 @ 0x9777d40] Unsupported sample rate.

lame --longhelp shows:-
MPEG-2   layer III sample frequencies (kHz):  16  24  22.05
bitrates (kbps):  8 16 24 32 40 48 56 64 80 96 112 128 144 160

So 16Kbps, 22.05Khz is valid.

Although it is "MPEG-2" layer III, this is still mp3.

FFmpeg does the conversion OK, but why does it say "Unsupported sample rate"?

*****************************************
@ubuntu:~$ ffmpeg -i foo.flac -c:a libmp3lame -b:a 16k -ar 22050 -ac 1 foo.mp3
ffmpeg version N-37961-gf649247 Copyright (c) 2000-2012 the FFmpeg developers
  built on Feb 18 2012 00:14:51 with gcc 4.5.2
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --disable-encoder=vorbis --enable-libvo-amrwbenc --enable-libvo-aacenc --enable-libspeex
  libavutil      51. 39.100 / 51. 39.100
  libavcodec     54.  3.100 / 54.  3.100
  libavformat    54.  1.100 / 54.  1.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 62.101 /  2. 62.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
[flac @ 0x9723ac0] max_analyze_duration 5000000 reached at 5015510
[flac @ 0x9723ac0] Estimating duration from bitrate, this may be inaccurate
Input #0, flac, from 'foo.flac':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
[mp3 @ 0x9777d40] Unsupported sample rate.
Output #0, mp3, to 'foo.mp3':
  Metadata:
    TSSE            : Lavf54.1.100
    Stream #0:0: Audio: mp3, 22050 Hz, 1 channels, s16, 16 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (flac -> libmp3lame)
Press [q] to stop, [?] for help
size=     201kB time=00:01:42.81 bitrate=  16.0kbits/s   
video:0kB audio:201kB global headers:0kB muxing overhead 0.016534%
*****************************************
     
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: When encoding mp3 at low bitrate FFmpeg gives error report.

Tom Evans
On Wed, Feb 22, 2012 at 12:39 PM, bat guano <[hidden email]> wrote:
>
> Hi
> When encoding to mp3 at low bitrate FFmpeg gives a (red) error report.
> [mp3 @ 0x9777d40] Unsupported sample rate.

No idea.

>
> lame --longhelp shows:-
> MPEG-2   layer III sample frequencies (kHz):  16  24  22.05
> bitrates (kbps):  8 16 24 32 40 48 56 64 80 96 112 128 144 160
>
> So 16Kbps, 22.05Khz is valid.
>
> Although it is "MPEG-2" layer III, this is still mp3.
>

MP3 stands for 'MPEG-2 layer 3'

Cheers

Tom
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: When encoding mp3 at low bitrate FFmpeg gives error report.

bat guano



----------------------------------------
>
>
> No idea.
>
>

Bump
     
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: When encoding mp3 at low bitrate FFmpeg gives error report.

bat guano



> From: [hidden email]
> To: [hidden email]
> Subject: RE: [FFmpeg-user] When encoding mp3 at low bitrate FFmpeg gives error report.
> Date: Thu, 23 Feb 2012 15:02:36 +0000
>
>
>
>
> ----------------------------------------
> >
> >
> > No idea.
> >
> >
>
> Bump
>      
Hi
Bump again.

Is there an explanation, or is it just something we have to live with?

Original question was:-

...
When encoding to mp3 at low bitrate FFmpeg gives a (red) error report.
[mp3 @ 0x9777d40] Unsupported sample rate.
 
 ...
FFmpeg does the conversion OK, but why does it say "Unsupported sample rate"?
 
*****************************************
@ubuntu:~$ ffmpeg -i foo.flac -c:a libmp3lame -b:a 16k -ar 22050 -ac 1 foo.mp3
ffmpeg version N-37961-gf649247 Copyright (c) 2000-2012 the FFmpeg developers
  built on Feb 18 2012 00:14:51 with gcc 4.5.2
  configuration: --enable-gpl --enable-version3 --enable-nonfree --enable-postproc --enable-libfaac --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libtheora --enable-libvorbis --enable-libvpx --enable-libx264 --enable-libxvid --enable-x11grab --disable-encoder=vorbis --enable-libvo-amrwbenc --enable-libvo-aacenc --enable-libspeex
  libavutil      51. 39.100 / 51. 39.100
  libavcodec     54.  3.100 / 54.  3.100
  libavformat    54.  1.100 / 54.  1.100
  libavdevice    53.  4.100 / 53.  4.100
  libavfilter     2. 62.101 /  2. 62.101
  libswscale      2.  1.100 /  2.  1.100
  libswresample   0.  6.100 /  0.  6.100
  libpostproc    52.  0.100 / 52.  0.100
[flac @ 0x9723ac0] max_analyze_duration 5000000 reached at 5015510
[flac @ 0x9723ac0] Estimating duration from bitrate, this may be inaccurate
Input #0, flac, from 'foo.flac':
  Duration: N/A, bitrate: N/A
    Stream #0:0: Audio: flac, 44100 Hz, stereo, s16
[mp3 @ 0x9777d40] Unsupported sample rate.
Output #0, mp3, to 'foo.mp3':
  Metadata:
    TSSE            : Lavf54.1.100
    Stream #0:0: Audio: mp3, 22050 Hz, 1 channels, s16, 16 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (flac -> libmp3lame)
Press [q] to stop, [?] for help
size=     201kB time=00:01:42.81 bitrate=  16.0kbits/s   
video:0kB audio:201kB global headers:0kB muxing overhead 0.016534%
**********************************************************************************


     
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: When encoding mp3 at low bitrate FFmpeg gives error report.

Tom Evans
On Mon, Feb 27, 2012 at 4:15 PM, bat guano <[hidden email]> wrote:

> Hi
> Bump again.
>
> Is there an explanation, or is it just something we have to live with?
>
> Original question was:-
>
> ...
> When encoding to mp3 at low bitrate FFmpeg gives a (red) error report.
> [mp3 @ 0x9777d40] Unsupported sample rate.

ffmpeg emits this error when it tries to write the xing header at the
start of the MP3 file. The sample rate 22050 is not part of the MPEG-1
audio layer III spec (but is part of the MPEG-2 audio layer III spec).
ffmpeg is only trying to write a MPEG-1 spec header, so it fails, and
you see the error message.

However, failing to write the header is not considered fatal, so it continues.

Cheers

Tom
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: When encoding mp3 at low bitrate FFmpeg gives error report.

bat guano



----------------------------------------

> ...The sample rate 22050 is not part of the MPEG-1
> audio layer III spec (but is part of the MPEG-2 audio layer III spec).
> ffmpeg is only trying to write a MPEG-1 spec header, so it fails, and
> you see the error message.
>
>
> Cheers
>
> Tom

Thanks Tom, that explains it. ;-)

I can confirm FFmpeg gives the error message when using other MPEG-2 layer III settings.

eg
ffmpeg -i foo.flac -c:a libmp3lame -b:a 64k -ar 22050 -ac 1 foo.mp3

and also with MPEG-2.5 layer III settings.

eg
ffmpeg -i foo.flac -c:a libmp3lame -b:a 64k -ar 11025 -ac 1 foo.mp3

But when I use lame like this:-
lame -b 16 --resample 22050 foo.wav foo.mp3
or this:-
lame -b 16 --resample 11025 foo.wav foo.mp3

It converts OK, without showing an error.

Shouldn't FFmpeg, when using libmp3lame, be able to convert to MPEG-2 and MPEG-2.5 without showing errors too?
     
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: When encoding mp3 at low bitrate FFmpeg gives error report.

bat guano




>
> Shouldn't FFmpeg, when using libmp3lame, be able to convert to MPEG-2 and MPEG-2.5 without showing errors too?
>      

I've submitted a ticket:- http://ffmpeg.org/trac/ffmpeg/ticket/1027
     
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: When encoding mp3 at low bitrate FFmpeg gives error report.

bat guano



----------------------------------------

>
> >
> > Shouldn't FFmpeg, when using libmp3lame, be able to convert to MPEG-2 and MPEG-2.5 without showing errors too?
> >
>
> I've submitted a ticket:- http://ffmpeg.org/trac/ffmpeg/ticket/1027
>

Hi
This issue has been fixed in git ;-)
http://git.videolan.org/?p=ffmpeg.git;a=commit;h=ca297513f034198029084b4af33ac4c29ab83bce 
     
_______________________________________________
ffmpeg-user mailing list
[hidden email]
http://ffmpeg.org/mailman/listinfo/ffmpeg-user
Loading...