From: Cecil Westerhof on
I installed ffmpeg. There is a problem that when using mp3 there should
also be an -ar parameter. At the moment this is not mentioned and you
are wondering why your command goes wrong. :-[ I was thinking about
making a patch to mention this when trying to use mp3 without -ar and
keeping other people from the same search for a solution. But the
sources are not installable with yast. Is there a reason for this?
Because I thought that normally you could install sources to make
changes.

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
From: David Bolt on
On Saturday 10 Apr 2010 09:02, while playing with a tin of spray paint,
Cecil Westerhof painted this mural:

> I installed ffmpeg. There is a problem that when using mp3 there should
> also be an -ar parameter.

Not if the audio is already sampled at one of the supported rates.

> At the moment this is not mentioned and you
> are wondering why your command goes wrong. :-[

You mean something like the error message you get when you try
converting to mp3 with an invalid sample rate[0] isn't good enough?

davjam(a)moray:~/sync> ffmpeg -i empty-sample.wav -ab 128k empty-sample.mp3
FFmpeg version SVN-r22648, Copyright (c) 2000-2010 the FFmpeg developers
built on Mar 23 2010 21:43:37 with gcc 4.4.1 [gcc-4_4-branch revision 150839]
configuration: --shlibdir=/usr/lib64 --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64
--enable-shared --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex
--enable-libfaad --enable-libfaac --enable-nonfree --enable-libxvid --enable-postproc --enable-gpl
--enable-x11grab --enable-libschroedinger --enable-libdirac --enable-libgsm --enable-version3
--enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libdc1394
--enable-pthreads
libavutil 50.12. 0 / 50.12. 0
libavcodec 52.59. 0 / 52.59. 0
libavformat 52.57. 1 / 52.57. 1
libavdevice 52. 2. 0 / 52. 2. 0
libswscale 0.10. 0 / 0.10. 0
libpostproc 51. 2. 0 / 51. 2. 0
[wav @ 0x64a060]max_analyze_duration reached
[wav @ 0x64a060]Estimating duration from bitrate, this may be inaccurate
Input #0, wav, from 'empty-sample.wav':
Duration: 00:01:00.00, bitrate: 192 kb/s
Stream #0.0: Audio: pcm_s16le, 6000 Hz, 2 channels, s16, 192 kb/s
Output #0, mp3, to 'empty-sample.mp3':
Stream #0.0: Audio: libmp3lame, 6000 Hz, 2 channels, s16, 128 kb/s
Stream mapping:
Stream #0.0 -> #0.0
Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate,
width or height

It's simple enough to figure out. The error message says about width or
height, but those don't apply because they aren't relevant to audio
streams. The bitrate is correct, as there's quite a few 128k mp3s
floating around. This leaves only the sample rate, which is indeed
invalid:

davjam(a)moray:~/sync> lame --longhelp
LAME 64bits version 3.98.3 (http://www.mp3dev.org/)

usage: lame [options] <infile> [outfile]

<infile> and/or <outfile> can be "-", which means stdin/stdout.

....

MPEG-1 layer III sample frequencies (kHz): 32 48 44.1
bitrates (kbps): 32 40 48 56 64 80 96 112 128 160 192 224 256 320

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

MPEG-2.5 layer III sample frequencies (kHz): 8 12 11.025
bitrates (kbps): 8 16 24 32 40 48 56 64



> I was thinking about
> making a patch to mention this when trying to use mp3 without -ar and
> keeping other people from the same search for a solution.

Have you tried mentioning this on the ffmpeg mailing lists?

> But the
> sources are not installable with yast. Is there a reason for this?

Packman doesn't have a separate sources repo so if you want to install
the sources they built from, you need to manually download and install
the source rpm. As an alternative, you can use svn and check out the
sources directly from their server. That way you'll know you've got the
most up to date sources.

> Because I thought that normally you could install sources to make
> changes.

You can, just not automatically.


[0] Just in case you're curious, the file empty-sample.wav was created
using the following two commands:

dd if=/dev/zero of=empty-sample.pcm bs=4 count=360000
ffmpeg -f s16le -ac 2 -ar 6000 -i empty-sample.pcm -y empty-sample.wav

The first one creates a file containing just 0x00 bytes. The second
takes this file and, by specifying the sample format, sample rate and
number of channels, it's converted to a wav file.

Regards,
David Bolt

--
Team Acorn: www.distributed.net OGR-NG @ ~100Mnodes RC5-72 @ ~1Mkeys/s
openSUSE 11.0 32b | | | openSUSE 11.3M4 32b
openSUSE 11.0 64b | openSUSE 11.1 64b | openSUSE 11.2 64b |
TOS 4.02 | openSUSE 11.1 PPC | RISC OS 4.02 | RISC OS 3.11

From: Cecil Westerhof on
David Bolt <blacklist-me(a)davjam.org> writes:

>> I installed ffmpeg. There is a problem that when using mp3 there should
>> also be an -ar parameter.
>
> Not if the audio is already sampled at one of the supported rates.

I found this out, yes. My audio is samples at 7.875 Hz, if it was
sampled at 8 KHz there would have not been a problem.


>> At the moment this is not mentioned and you
>> are wondering why your command goes wrong. :-[
>
> You mean something like the error message you get when you try
> converting to mp3 with an invalid sample rate[0] isn't good enough?
>
> davjam(a)moray:~/sync> ffmpeg -i empty-sample.wav -ab 128k empty-sample.mp3
> FFmpeg version SVN-r22648, Copyright (c) 2000-2010 the FFmpeg developers
> built on Mar 23 2010 21:43:37 with gcc 4.4.1 [gcc-4_4-branch revision 150839]
> configuration: --shlibdir=/usr/lib64 --prefix=/usr --mandir=/usr/share/man --libdir=/usr/lib64
> --enable-shared --enable-libmp3lame --enable-libvorbis --enable-libtheora --enable-libspeex
> --enable-libfaad --enable-libfaac --enable-nonfree --enable-libxvid --enable-postproc --enable-gpl
> --enable-x11grab --enable-libschroedinger --enable-libdirac --enable-libgsm --enable-version3
> --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libx264 --enable-libdc1394
> --enable-pthreads
> libavutil 50.12. 0 / 50.12. 0
> libavcodec 52.59. 0 / 52.59. 0
> libavformat 52.57. 1 / 52.57. 1
> libavdevice 52. 2. 0 / 52. 2. 0
> libswscale 0.10. 0 / 0.10. 0
> libpostproc 51. 2. 0 / 51. 2. 0
> [wav @ 0x64a060]max_analyze_duration reached
> [wav @ 0x64a060]Estimating duration from bitrate, this may be inaccurate
> Input #0, wav, from 'empty-sample.wav':
> Duration: 00:01:00.00, bitrate: 192 kb/s
> Stream #0.0: Audio: pcm_s16le, 6000 Hz, 2 channels, s16, 192 kb/s
> Output #0, mp3, to 'empty-sample.mp3':
> Stream #0.0: Audio: libmp3lame, 6000 Hz, 2 channels, s16, 128 kb/s
> Stream mapping:
> Stream #0.0 -> #0.0
> Error while opening encoder for output stream #0.0 - maybe incorrect parameters such as bit_rate, rate,
> width or height
>
> It's simple enough to figure out. The error message says about width or
> height, but those don't apply because they aren't relevant to audio
> streams. The bitrate is correct, as there's quite a few 128k mp3s
> floating around. This leaves only the sample rate, which is indeed
> invalid:

For someone who is a novice it is a bit cryptic. When you explain it, it
makes sense, but if you are complete blank it can be challenging.


> davjam(a)moray:~/sync> lame --longhelp
> LAME 64bits version 3.98.3 (http://www.mp3dev.org/)
>
> usage: lame [options] <infile> [outfile]
>
> <infile> and/or <outfile> can be "-", which means stdin/stdout.
>
> ...
>
> MPEG-1 layer III sample frequencies (kHz): 32 48 44.1
> bitrates (kbps): 32 40 48 56 64 80 96 112 128 160 192 224 256 320
>
> 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
>
> MPEG-2.5 layer III sample frequencies (kHz): 8 12 11.025
> bitrates (kbps): 8 16 24 32 40 48 56 64

This is useful information.


>> I was thinking about
>> making a patch to mention this when trying to use mp3 without -ar and
>> keeping other people from the same search for a solution.
>
> Have you tried mentioning this on the ffmpeg mailing lists?

On IRC, there it was blamed on lame.


>> But the
>> sources are not installable with yast. Is there a reason for this?
>
> Packman doesn't have a separate sources repo so if you want to install
> the sources they built from, you need to manually download and install
> the source rpm. As an alternative, you can use svn and check out the
> sources directly from their server. That way you'll know you've got the
> most up to date sources.

It was made clear to me not to change anything, because it should be
solved in lame, not in ffmpeg.

Thanks for the info.

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof
 | 
Pages: 1
Prev: Gnome Terminal autocomplete
Next: bitlbee