Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#2587 closed defect (invalid)

libfaac doesn't support this output format

Reported by: burek Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords:
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
When no audio encoding options are specified, libfaac complains about unsupported output format.
More info here: http://ffmpeg.gusari.org/viewtopic.php?f=11&t=927&p=2054#p2052

How to reproduce:

ffmpeg -i ffmpeg -i rtsp://your_cam_ip:port/additional_path out.mp4
ffmpeg version N-53206-gebe8c7f Copyright (c) 2000-2013 the FFmpeg developers
built on May 17 2013 16:03:45 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-54)
configuration: --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-gpl --enable-postproc --enable-nonfree
libavutil 52. 33.100 / 52. 33.100
libavcodec 55. 10.100 / 55. 10.100
libavformat 55. 7.100 / 55. 7.100
libavdevice 55. 0.100 / 55. 0.100
libavfilter 3. 68.101 / 3. 68.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Input #0, rtsp, from 'ffmpeg -i rtsp://your_cam_ip:port/additional_path out.mp4':
Metadata:
title : Media Presentation
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mpeg4 (Advanced Simple Profile), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 21.92 tbr, 90k tbn, 1k tbc
Stream #0:1: Audio: aac, 16000 Hz, mono, fltp
File 'out.mp4' already exists. Overwrite ? [y/N] y
[libx264 @ 0x97dae40] using SAR=1/1
[libx264 @ 0x97dae40] using cpu capabilities: MMX2 SSE2Fast SSEMisalign LZCNT
[libx264 @ 0x97dae40] profile High, level 2.2
[libx264 @ 0x97dae40] 264 - core 132 r2310 76a5c3a - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=21 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
[libfaac @ 0x97dcce0] libfaac doesn't support this output format!
Output #0, mp4, to 'out.mp4':
Metadata:
title : Media Presentation
Stream #0:0: Video: h264 (libx264), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 90k tbn, 21.92 tbc
Stream #0:1: Audio: aac, 16000 Hz, mono, s16, 128 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mpeg4 -> libx264)
Stream #0:1 -> #0:1 (aac -> libfaac)
Error while opening encoder for output stream #0:1 - maybe incorrect parameters such as bit_rate, rate, width or height

Further down in the forum post, when the correct audio encoding options were given, everything went fine:

ffmpeg -t 10 -i rtsp://your_cam_ip:port/additional_path -ar 16000 -ac 1 -ab 16k out.mp4g
ffmpeg version N-53206-gebe8c7f Copyright (c) 2000-2013 the FFmpeg developers
built on May 17 2013 16:03:45 with gcc 4.1.2 (GCC) 20080704 (Red Hat 4.1.2-54)
configuration: --enable-version3 --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libvpx --enable-libfaac --enable-libmp3lame --enable-libtheora --enable-libvorbis --enable-libx264 --enable-libxvid --enable-gpl --enable-postproc --enable-nonfree
libavutil 52. 33.100 / 52. 33.100
libavcodec 55. 10.100 / 55. 10.100
libavformat 55. 7.100 / 55. 7.100
libavdevice 55. 0.100 / 55. 0.100
libavfilter 3. 68.101 / 3. 68.101
libswscale 2. 3.100 / 2. 3.100
libswresample 0. 17.102 / 0. 17.102
libpostproc 52. 3.100 / 52. 3.100
Input #0, rtsp, from 'rtsp://your_cam_ip:port/additional_path':
Metadata:
title : Media Presentation
Duration: N/A, start: 0.000000, bitrate: N/A
Stream #0:0: Video: mpeg4 (Advanced Simple Profile), yuv420p, 640x360 [SAR 1:1 DAR 16:9], 21.92 tbr, 90k tbn, 1k tbc
Stream #0:1: Audio: aac, 16000 Hz, mono, fltp
-t is not an input option, keeping it for the next output; consider fixing your command line.
[libx264 @ 0x959c3a0] using SAR=1/1
[libx264 @ 0x959c3a0] using cpu capabilities: MMX2 SSE2Fast SSEMisalign LZCNT
[libx264 @ 0x959c3a0] profile High, level 2.2
[libx264 @ 0x959c3a0] 264 - core 132 r2310 76a5c3a - H.264/MPEG-4 AVC codec - Copyleft 2003-2013 - http://www.videolan.org/x264.html - options: cabac=1 ref=3 deblock=1:0:0 analyse=0x3:0x113 me=hex subme=7 psy=1 psy_rd=1.00:0.00 mixed_ref=1 me_range=16 chroma_me=1 trellis=1 8x8dct=1 cqm=0 deadzone=21,11 fast_pskip=1 chroma_qp_offset=-2 threads=1 lookahead_threads=1 sliced_threads=0 nr=0 decimate=1 interlaced=0 bluray_compat=0 constrained_intra=0 bframes=3 b_pyramid=2 b_adapt=1 b_bias=0 direct=1 weightb=1 open_gop=0 weightp=2 keyint=250 keyint_min=21 scenecut=40 intra_refresh=0 rc_lookahead=40 rc=crf mbtree=1 crf=23.0 qcomp=0.60 qpmin=0 qpmax=69 qpstep=4 ip_ratio=1.40 aq=1:1.00
Output #0, mp4, to 'out.mp4':
Metadata:
title : Media Presentation
encoder : Lavf55.7.100
Stream #0:0: Video: h264 (libx264) ([33][0][0][0] / 0x0021), yuv420p, 640x360 [SAR 1:1 DAR 16:9], q=-1--1, 16832 tbn, 21.92 tbc
Stream #0:1: Audio: aac (libfaac) ([64][0][0][0] / 0x0040), 16000 Hz, mono, s16, 16 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (mpeg4 -> libx264)
Stream #0:1 -> #0:1 (aac -> libfaac)
Press [q] to stop, [?] for help
frame= 220 fps= 52 q=28.0 Lsize= 401kB time=00:00:09.94 bitrate= 329.9kbits/s dup=5026 drop=0
video:397kB audio:0kB subtitle:0 global headers:0kB muxing overhead 0.854777%
[libx264 @ 0x959c3a0] frame I:1 Avg QP:22.30 size: 57873
[libx264 @ 0x959c3a0] frame P:56 Avg QP:20.68 size: 5789
[libx264 @ 0x959c3a0] frame B:163 Avg QP:31.84 size: 146
[libx264 @ 0x959c3a0] consecutive B-frames: 0.5% 0.9% 4.1% 94.5%
[libx264 @ 0x959c3a0] mb I I16..4: 1.6% 85.3% 13.0%
[libx264 @ 0x959c3a0] mb P I16..4: 0.2% 0.3% 0.1% P16..4: 20.5% 4.2% 6.1% 0.0% 0.0% skip:68.6%
[libx264 @ 0x959c3a0] mb B I16..4: 0.0% 0.0% 0.0% B16..8: 7.6% 0.1% 0.1% direct: 0.1% skip:92.0% L0:33.3% L1:62.4% BI: 4.3%
[libx264 @ 0x959c3a0] 8x8 transform intra:78.9% inter:69.6%
[libx264 @ 0x959c3a0] coded y,uvDC,uvAC intra: 81.7% 79.1% 52.4% inter: 5.8% 6.5% 2.8%
[libx264 @ 0x959c3a0] i16 v,h,dc,p: 8% 17% 70% 4%
[libx264 @ 0x959c3a0] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14% 10% 39% 5% 6% 4% 8% 8% 8%
[libx264 @ 0x959c3a0] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 18% 12% 15% 8% 11% 6% 14% 8% 8%
[libx264 @ 0x959c3a0] i8c dc,h,v,p: 54% 26% 12% 8%
[libx264 @ 0x959c3a0] Weighted P-Frames: Y:0.0% UV:0.0%
[libx264 @ 0x959c3a0] ref P L0: 46.0% 5.5% 41.4% 7.1%
[libx264 @ 0x959c3a0] ref B L0: 82.7% 15.4% 1.9%
[libx264 @ 0x959c3a0] ref B L1: 93.5% 6.5%
[libx264 @ 0x959c3a0] kb/s:323.51
[libfaac @ 0x959e080] 1 frames left in the queue on closing

Change History (7)

comment:1 by burek, 11 years ago

There is a typo in the first cmd line, it should say:

ffmpeg -i rtsp://your_cam_ip:port/additional_path out.mp4

comment:2 by Carl Eugen Hoyos, 11 years ago

Is network input needed to reproduce this problem or does it also happen with file input?

Last edited 11 years ago by Carl Eugen Hoyos (previous) (diff)

comment:3 by Carl Eugen Hoyos, 11 years ago

Resolution: invalid
Status: newclosed

If you want to help FFmpeg development, please ask for the sample video-MP4V-ES-1.

comment:4 by Michael Niedermayer, 11 years ago

Resolution: invalidneeds_more_info

If this requires a network camera to reproduce, please provide dumps of the network packets in some form so they can be replayed without the network camera or provide a public IP through which developers can connect to this network camera to debug the issue. (or donate such camera)

If this does not require a network camera to reproduce then please provide a testcase that does not require a network camera.

comment:5 by Carl Eugen Hoyos, 11 years ago

Resolution: needs_more_infoinvalid

libfaac refuses to encode 16k source with 256kb, to the best of my knowledge there is no API that allows FFmpeg to read why libfaac initialisation fails.

Allow me to add that Michael's answer shows convincingly that this was a very hard to understand report and how important it is to test file input instead of network input, -an / -vn (all the things that I always request).

I would like to repeat that the original user's original report shows a possible bug and a sample would be very welcome!

comment:6 by burek, 11 years ago

Since the first ffmpeg command:

ffmpeg -i rtsp://your_cam_ip:port/additional_path out.mp4

shows that ffmpeg has successfully detected the network input as:

Stream #0:1: Audio: aac, 16000 Hz, mono, fltp

and tried to produce the following output:

Stream #0:1: Audio: aac, 16000 Hz, mono, s16, 128 kb/s

it seems to me that ffmpeg or libfaac failed to set the appropriate bitrate for the given input, so I'm just curious if there are already any AAC test sample files, in ffmpeg test suite, which might be used as an input, like:

ffmpeg -i aac_16khz_mono_fltp.mp4 out.mp4

comment:7 by burek, 11 years ago

Ok, I've tried to generate a test file myself and some similar issues happened while I was doing so. This is what I tried in order to generate the aac file for a test:

# ffmpeg -f lavfi -i aevalsrc="sin(440*2*PI*t)" -acodec aac -strict -2 -ar 16k -ac 1 -t 10 -y output.mp4
ffmpeg version N-53535-g9c66da5 Copyright (c) 2000-2013 the FFmpeg developers
  built on May 28 2013 03:27:43 with gcc 4.6 (Debian 4.6.3-1)
  configuration: --enable-libfaac --enable-shared --disable-static --enable-nonfree
  libavutil      52. 34.100 / 52. 34.100
  libavcodec     55. 12.100 / 55. 12.100
  libavformat    55.  7.100 / 55.  7.100
  libavdevice    55.  1.101 / 55.  1.101
  libavfilter     3. 72.100 /  3. 72.100
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
Input #0, lavfi, from 'aevalsrc=sin(440*2*PI*t)':
  Duration: N/A, start: 0.000000, bitrate: 2822 kb/s
    Stream #0:0: Audio: pcm_f64le, 44100 Hz, mono, dbl, 2822 kb/s
[aac @ 0x252c000] Too many bits per frame requested
Output #0, mp4, to 'output.mp4':
    Stream #0:0: Audio: aac, 16000 Hz, mono, fltp, 128 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_f64le -> aac)
Error while opening encoder for output stream #0:0 - maybe incorrect parameters such as bit_rate, rate, width or height

which made me believe that some default options for aac encoder are invalid or some options are not paired well with each other.

Using libfaac, produced a good result (at least libfaac estimated bit rate correctly):

# ffmpeg -f lavfi -i aevalsrc="sin(440*2*PI*t)" -acodec libfaac -strict -2 -ar 16k -t 10 -y output.mp4
ffmpeg version N-53535-g9c66da5 Copyright (c) 2000-2013 the FFmpeg developers
  built on May 28 2013 03:27:43 with gcc 4.6 (Debian 4.6.3-1)
  configuration: --enable-libfaac --enable-shared --disable-static --enable-nonfree
  libavutil      52. 34.100 / 52. 34.100
  libavcodec     55. 12.100 / 55. 12.100
  libavformat    55.  7.100 / 55.  7.100
  libavdevice    55.  1.101 / 55.  1.101
  libavfilter     3. 72.100 /  3. 72.100
  libswscale      2.  3.100 /  2.  3.100
  libswresample   0. 17.102 /  0. 17.102
Input #0, lavfi, from 'aevalsrc=sin(440*2*PI*t)':
  Duration: N/A, start: 0.000000, bitrate: 2822 kb/s
    Stream #0:0: Audio: pcm_f64le, 44100 Hz, mono, dbl, 2822 kb/s
[libfaac @ 0x1269fe0] libfaac doesn't support the specified bitrate, using 96kbit/s instead
Output #0, mp4, to 'output.mp4':
  Metadata:
    encoder         : Lavf55.7.100
    Stream #0:0: Audio: aac (libfaac) ([64][0][0][0] / 0x0040), 16000 Hz, mono, s16, 96 kb/s
Stream mapping:
  Stream #0:0 -> #0:0 (pcm_f64le -> libfaac)
Press [q] to stop, [?] for help
size=      34kB time=00:00:10.04 bitrate=  27.4kbits/s
video:0kB audio:32kB subtitle:0 global headers:0kB muxing overhead 4.154168%

So, I guess the ticket can stay marked as invalid, but aac issue might be investigated a bit more perhaps.

Note: See TracTickets for help on using tickets.