Page 1 of 1

how to specify audio bitrate with acodec=samr

Posted: 26 Sep 2007 16:49
by PeeZee
I'm trying to stream 3gp encoded content.

I have recompiled ffmpeg and vlc with samr support.
When I try to encode a movie file with samr audio codec, I can't seem to specify the correct audio bitrate.

(Please ignore the mmsh access method, I don't know whether it works, I don't think it is related, I'm testing some mms streaming)

command line:

Code: Select all

vlc inputfile --sout '#transcode{width=128,height=96,vcodec=H263,acodec=samr,vb=28,ab=5.25,fps=12.5,samplerate=8000,channels=1}:standard{access=mmsh,dst=:1234/test.3gp}' -vvvv
snip of the log:

Code: Select all

[00000299] stream_out_standard private debug: mux opened [00000299] main private debug: using sout stream module "stream_out_standard" [00000296] main private debug: set config option: sout-transcode-width to 128 [00000296] main private debug: set config option: sout-transcode-height to 96 [00000296] main private debug: set config option: sout-transcode-vcodec to H263 [00000296] main private debug: set config option: sout-transcode-acodec to samr [00000296] main private debug: set config option: sout-transcode-vb to 28 [00000296] main private debug: set config option: sout-transcode-ab to 5.25 [00000296] main private debug: set config option: sout-transcode-fps to 12.5 [00000296] main private debug: set config option: sout-transcode-samplerate to 8000 [00000296] main private debug: set config option: sout-transcode-channels to 1 [00000296] stream_out_transcode private debug: codec audio=samr 8000Hz 1 channels 5Kb/s [00000296] stream_out_transcode private debug: codec video=H263 128x96 scaling: 1.000000 28kb/s
Important parts to read:
[00000296] main private debug: set config option: sout-transcode-ab to 5.25
...
[00000296] stream_out_transcode private debug: codec audio=samr 8000Hz 1 channels 5Kb/s

it seems vlc cuts off the bitrate at the decimal point...

This produces the following ffmpeg error message and no audio in the stream:

Code: Select all

[00000345] ffmpeg encoder warning: bitrate not supported: use one of 4.75k, 5.15k, 5.9k, 6.7k, 7.4k, 7.95k, 10.2k or 12.2k (libamr_nb@0x8456a0)
Is there a workaround for this ?

Re: how to specify audio bitrate with acodec=samr

Posted: 27 Sep 2007 01:51
by Jean-Baptiste Kempf
Seems a bug. Ask on the mailing lists or trac it.

Re: how to specify audio bitrate with acodec=samr

Posted: 27 Sep 2007 11:41
by PeeZee
Thanks to the help of some people on the IRC channel, we figured out a workaround:

Ssing 5150 in stead of 5.15 as audio bitrate seems to solve the problem.

(The 5.25 in the original post was a typo, should have been 5.15)

Thanks for the help!

Re: how to specify audio bitrate with acodec=samr

Posted: 12 Jul 2009 04:07
by diegofn
The audio bitrate only can you set in bits/sg.

acodec="samr",ab="7400",samplerate="8000",channels="1"
aenc=ffmpeg,acodec="sawb",ab="23850",samplerate="16000",channels="1"