Please auto-adjust high bitrates in AC3 encoder

Bug #929178 reported by Max Brustkern
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
libav (Ubuntu)
Triaged
Low
Unassigned

Bug Description

I'm running the following command:
/usr/bin/ffmpeg -i ./data/sound-file.wav ~/test.ac3
On Oneiric, it works correctly, and outputs this:
ffmpeg version 0.7.3-4:0.7.3-0ubuntu0.11.10.1, Copyright (c) 2000-2011 the Libav developers
  built on Jan 4 2012 16:08:51 with gcc 4.6.1
  configuration: --extra-version='4:0.7.3-0ubuntu0.11.10.1' --arch=amd64 --prefix=/usr --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --enable-runtime-cpudetect --enable-vaapi --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
  libavutil 51. 7. 0 / 51. 7. 0
  libavcodec 53. 6. 0 / 53. 6. 0
  libavformat 53. 3. 0 / 53. 3. 0
  libavdevice 53. 0. 0 / 53. 0. 0
  libavfilter 2. 4. 0 / 2. 4. 0
  libswscale 2. 0. 0 / 2. 0. 0
  libpostproc 52. 0. 0 / 52. 0. 0
Input #0, wav, from './data/sound-file.wav':
  Duration: 00:00:00.76, bitrate: 706 kb/s
    Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
Unable to find a suitable output format for '/home/ubuntu/test.ace'
ubuntu@server-4541:/opt/canonical.com/qa-regression-testing/scripts$ /usr/bin/ffmpeg -i ./data/sound-file.wav ~/test.ac3
ffmpeg version 0.7.3-4:0.7.3-0ubuntu0.11.10.1, Copyright (c) 2000-2011 the Libav developers
  built on Jan 4 2012 16:08:51 with gcc 4.6.1
  configuration: --extra-version='4:0.7.3-0ubuntu0.11.10.1' --arch=amd64 --prefix=/usr --enable-vdpau --enable-bzlib --enable-libgsm --enable-libschroedinger --enable-libspeex --enable-libtheora --enable-libvorbis --enable-pthreads --enable-zlib --enable-libvpx --enable-runtime-cpudetect --enable-vaapi --enable-gpl --enable-postproc --enable-swscale --enable-x11grab --enable-libdc1394 --enable-shared --disable-static
  libavutil 51. 7. 0 / 51. 7. 0
  libavcodec 53. 6. 0 / 53. 6. 0
  libavformat 53. 3. 0 / 53. 3. 0
  libavdevice 53. 0. 0 / 53. 0. 0
  libavfilter 2. 4. 0 / 2. 4. 0
  libswscale 2. 0. 0 / 2. 0. 0
  libpostproc 52. 0. 0 / 52. 0. 0
Input #0, wav, from './data/sound-file.wav':
  Duration: 00:00:00.76, bitrate: 706 kb/s
    Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
Incompatible sample format 's16' for codec 'ac3', auto-selecting format 'flt'
[ac3 @ 0x1d56d80] channel_layout not specified
[ac3 @ 0x1d56d80] No channel layout specified. The encoder will guess the layout, but it might be incorrect.
Output #0, ac3, to '/home/ubuntu/test.ac3':
  Metadata:
    encoder : Lavf53.3.0
    Stream #0.0: Audio: ac3, 44100 Hz, mono, flt, 64 kb/s
Stream mapping:
  Stream #0.0 -> #0.0
Press ctrl-c to stop encoding
size= 6kB time=0.77 bitrate= 64.0kbits/s
video:0kB audio:6kB global headers:0kB muxing overhead 0.000000%

On the most recent package in Precise, it fails, and outputs this:
ffmpeg version 0.8-4:0.8-1ubuntu1, Copyright (c) 2000-2011 the Libav developers
  built on Jan 24 2012 07:15:53 with gcc 4.6.2
This program is not developed anymore and is only provided for compatibility. Use avconv instead (see Changelog for the list of incompatible changes).
Input #0, wav, from './data/sound-file.wav':
  Duration: 00:00:00.76, bitrate: 706 kb/s
    Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
Incompatible sample format 's16' for codec 'ac3', auto-selecting format 'flt'
[ac3 @ 0x12a65e0] channel_layout not specified
[ac3 @ 0x12a65e0] No channel layout specified. The encoder will guess the layout, but it might be incorrect.
[ac3 @ 0x12a65e0] invalid bit rate
Output #0, ac3, to '/home/ubuntu/test.ac3':
    Stream #0.0: Audio: ac3, 44100 Hz, mono, flt, 200 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

I know it previously worked on Precise, but I don't have a version number for the last time I verified that it worked. The input file is attached. Working version on Oneiric is 4:0.7.3-0ubuntu0.11.10.1. Failing version on precise is 4:0.8-1ubuntu1.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: ffmpeg 4:0.7.3-0ubuntu0.11.10.1
ProcVersionSignature: Ubuntu 3.0.0-15.26-generic 3.0.13
Uname: Linux 3.0.0-15-generic x86_64
NonfreeKernelModules: nvidia
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
CheckboxSubmission: 45e465ddf7959aab9a61cdadad3b8cd9
CheckboxSystem: 4ed15c40009aa6f7770f606350a390a2
Date: Wed Feb 8 17:29:54 2012
InstallationMedia: Ubuntu 11.04 "Natty Narwhal" - Release amd64 (20110427.1)
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
SourcePackage: libav
UpgradeStatus: Upgraded to oneiric on 2011-10-13 (118 days ago)

Revision history for this message
Max Brustkern (nuclearbob) wrote :
Revision history for this message
Reinhard Tartler (siretart) wrote : Re: [Bug 929178] [NEW] ffmpeg does not convert wav to ac3

On Mi, Feb 08, 2012 at 23:35:44 (CET), Max Brustkern wrote:

> Public bug reported:
>
> I'm running the following command:
> /usr/bin/ffmpeg -i ./data/sound-file.wav ~/test.ac3

In precise, please try using 'avconv' instead of 'ffmpeg'.

Moreover, does using "-acodec ac3_fixed" work better in this case? I
notice in your output that you are using the float-based ac3 encoder,
and there are some warning messages in the output.

--
Gruesse/greetings,
Reinhard Tartler, KeyID 945348A4

Revision history for this message
Max Brustkern (nuclearbob) wrote : Re: ffmpeg does not convert wav to ac3

Tried this command line instead:
/usr/bin/avconv -i /opt/canonical.com/qa-regression-testing/data/sound-file.wav -acodec ac3_fixed test.ac3
Got similar output:
avconv version 0.8-4:0.8-1ubuntu1, Copyright (c) 2000-2011 the Libav developers
  built on Jan 24 2012 07:15:53 with gcc 4.6.2
Input #0, wav, from '/opt/canonical.com/qa-regression-testing/data/sound-file.wav':
  Duration: 00:00:00.76, bitrate: 706 kb/s
    Stream #0.0: Audio: pcm_s16le, 44100 Hz, 1 channels, s16, 705 kb/s
[ac3_fixed @ 0x169b600] channel_layout not specified
[ac3_fixed @ 0x169b600] No channel layout specified. The encoder will guess the layout, but it might be incorrect.
[ac3_fixed @ 0x169b600] invalid bit rate
Output #0, ac3, to 'test.ac3':
    Stream #0.0: Audio: ac3, 44100 Hz, mono, s16, 200 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_s16le -> ac3_fixed)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

Also tried -acodec=ac3, and without -acodec specified, and all 3 with ffmpeg instead of avconv, and all cases failed.

Revision history for this message
Justin Ruggles (justin-ruggles) wrote :

There is no such thing as 200kbps AC-3. We need to modify the AC-3 encoder to choose the closest bit rate. 192k should work.

Revision history for this message
Reinhard Tartler (siretart) wrote :

@justin: Thanks for the comment, much appreciated.

the AC-3 encoder could at least give better error messages. Auto adjusting bitrate would be also great.

summary: - ffmpeg does not convert wav to ac3
+ Please auto-adjust high bitrates in AC3 encoder
Changed in libav (Ubuntu):
importance: Undecided → Low
status: New → Triaged
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.