【问题标题】:Gstreamer AAC encoding no more supported?不再支持 Gstreamer AAC 编码?
【发布时间】:2016-07-18 14:10:32
【问题描述】:

我想在我的应用程序中包含 AAC 作为兼容格式之一,但我在编码时遇到了问题。 GStreamer-1.0 Debian 派生的软件包中似乎缺少 FAAC(请参阅 Ubuntu),其主要原因(如果我理解正确的话)是存在 avenc_aac (Lunchpad bugreport) 作为替代品。

我尝试了以下方法:

gst-launch-1.0 filesrc location="src.avi" ! tee name=t  t.! queue ! decodebin ! progressreport ! x264enc ! mux. t.! queue ! decodebin ! audioconvert ! audioresample ! avenc_aac compliance=-2 ! mux. avmux_mpegts name=mux ! filesink location=/tmp/test.avi

它挂起预卷:

ERROR libav :0:: AAC bitstream not in ADTS format and extradata missing

使用 mpegtsmux 代替 avmux_mpegts 似乎可以工作,因为文件已创建,但结果是没有可用的音频(对于某些播放器,它完全无法播放)。

这是mplayer的踪迹:

Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
[aac @ 0x7f2860d6c3c0]channel element 3.15 is not allocated
[aac @ 0x7f2860d6c3c0]Sample rate index in program config element does not match the sample rate index configured by the container.
[aac @ 0x7f2860d6c3c0]Inconsistent channel configuration.
[aac @ 0x7f2860d6c3c0]get_buffer() failed
[aac @ 0x7f2860d6c3c0]Assuming an incorrectly encoded 7.1 channel layout instead of a spec-compliant 7.1(wide) layout, use -strict 1 to decode according to the specification instead.
[aac @ 0x7f2860d6c3c0]Reserved bit set.
[aac @ 0x7f2860d6c3c0]Number of bands (20) exceeds limit (14).
[aac @ 0x7f2860d6c3c0]invalid band type
[aac @ 0x7f2860d6c3c0]More than one AAC RDB per ADTS frame is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[aac @ 0x7f2860d6c3c0]Reserved bit set.
[aac @ 0x7f2860d6c3c0]Number of bands (45) exceeds limit (28).
Unknown/missing audio format -> no sound
ADecoder init failed :(
Opening audio decoder: [faad] AAC (MPEG2/4 Advanced Audio Coding)
FAAD: compressed input bitrate missing, assuming 128kbit/s!
AUDIO: 44100 Hz, 2 ch, floatle, 128.0 kbit/9.07% (ratio: 16000->176400)
Selected audio codec: [faad] afm: faad (FAAD AAC (MPEG-2/MPEG-4 Audio))
==========================================================================
AO: [pulse] 44100Hz 2ch floatle (4 bytes per sample)
Starting playback...
FAAD: error: Bitstream value not allowed by specification, trying to resync!
FAAD: error: Invalid number of channels, trying to resync!
FAAD: error: Invalid number of channels, trying to resync!
FAAD: error: Bitstream value not allowed by specification, trying to resync!
FAAD: error: Invalid number of channels, trying to resync!
FAAD: error: Bitstream value not allowed by specification, trying to resync!
FAAD: error: Channel coupling not yet implemented, trying to resync!
FAAD: error: Invalid number of channels, trying to resync!
FAAD: error: Invalid number of channels, trying to resync!
FAAD: error: Bitstream value not allowed by specification, trying to resync!
FAAD: Failed to decode frame: Bitstream value not allowed by specification 
Movie-Aspect is 1.33:1 - prescaling to correct movie aspect.
VO: [vdpau] 640x480 => 640x480 Planar YV12 
A:3602.2 V:3600.0 A-V:  2.143 ct:  0.000   3/  3 ??% ??% ??,?% 0 0 
FAAD: error: Array index out of range, trying to resync!
FAAD: error: Bitstream value not allowed by specification, trying to resync!
FAAD: error: Bitstream value not allowed by specification, trying to resync!
FAAD: error: Unexpected fill element with SBR data, trying to resync!
FAAD: error: Bitstream value not allowed by specification, trying to resync!
FAAD: error: Bitstream value not allowed by specification, trying to resync!
FAAD: error: Channel coupling not yet implemented, trying to resync!
FAAD: error: Invalid number of channels, trying to resync!
FAAD: error: PCE shall be the first element in a frame, trying to resync!
FAAD: error: Invalid number of channels, trying to resync!
FAAD: Failed to decode frame: Invalid number of channels 
A:3602.2 V:3600.1 A-V:  2.063 ct:  0.000   4/  4 ??% ??% ??,?% 0 0 

这些由 VLC 产生的消息(播放 10 秒):

ts info: MPEG-4 descriptor not found for pid 0x42 type 0xf
core error: option sub-original-fps does not exist
subtitle warning: failed to recognize subtitle type
core error: no suitable demux module for `file/subtitle:///tmp//test.avi.idx'
avcodec info: Using NVIDIA VDPAU Driver Shared Library 361.42 Tue Mar 22 17:29:16 PDT 2016 for hardware decoding.
core warning: VoutDisplayEvent 'pictures invalid'
core warning: VoutDisplayEvent 'pictures invalid'
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio warning: ADTS CRC not supported
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio warning: ADTS CRC not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio warning: Invalid ADTS header
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported
packetizer_mpeg4audio error: Multiple blocks per frame in ADTS not supported

使用悬挂管道的错误,我终于发现应该以这种方式告诉 avenc_aac 以不在 RAW AAC 而是在 ADTS AAC 中输出数据,关键是我不知道如何使用流媒体。见这里,页面底部:FFMPEG Ticket

在这一点上,因为我发现没有文档似乎正确地说我们不支持 GStreamer 中的 AAC 编码......这不是真的,我猜! (恕我直言,如果 AVENC_AAC 需要一直设置为实验模式,那么缺少 FAAC 似乎很奇怪)

有人可以为此提出一个可行的管道吗?

更新

经过更多研究,我发现(通过 avenc_aac 上的 gst-inspect)我可能正在寻找什么,但我不知道如何根据需要进行设置。 看看流格式:

Pad Templates:
  SRC template: 'src'
    Availability: Always
    Capabilities:
      audio/mpeg
               channels: [ 1, 6 ]
                   rate: [ 4000, 96000 ]
            mpegversion: 4
          stream-format: raw
        base-profile: lc

谢谢

【问题讨论】:

  • 您好,您的问题解决了吗?我在下面尝试过,但没有生成输出:---------------------------- gst-launch-1.0 --gst-debug-级别=3 dvbsrc 调制=“QAM 256” 跨模式=8k 带宽=8 频率=147000000 !发球台名称=t t.!队列 !解码器!进度报告 ! x264enc !多路复用器。吨!队列 !解码器!音频转换!音频重采样! avenc_aac 合规性=-2 !多路复用器。 avmux_mpegts 名称=多路复用器!文件接收器位置=test_streamer.avi

标签: ubuntu ffmpeg gstreamer aac


【解决方案1】:

还有voaacenc,它是一个AAC编码器。还可以尝试在 AAC 编码器元素之后添加aacparse

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-02-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-10-05
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多