无法通过rtp从ffserver获取音频(libopus)流

时间:2017-07-07 16:10:43

标签: ffmpeg stream rtp transcoding ffserver

我需要使用下一个编解码器 vp8 opus 获取 rtp stream 。 我从相机(h264,aac)获得一个流,然后我发送到ffmpeg,然后我将它发送到ffserver,从那里我想收到一个格式为rtp的流。 没有音频的视频(VP8)我成功获得,但带有音频的流视频(任何编解码器(aac,vorbis,opus))都不起作用。

ffmpeg命令:

 ./ffmpeg -thread_queue_size 512 -rtsp_transport tcp -i rtsp://ip:port/stream -analyzeduration 0 -threads 2 http://localhost:4000/feed1.ffm

ffserver config:

HTTPPort 4000
RTSPPort 1235

RTSPBindAddress 0.0.0.0
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 10000

<Feed feed1.ffm>
        File /tmp/feed1.ffm
        FileMaxSize 1G
        ACL allow 127.0.0.1
        ACL allow localhost
</Feed>

<Stream test1.sdp>
    Feed feed1.ffm
    Format rtp

    # Video settings
    VideoCodec libvpx
    VideoSize 720x576
    VideoFrameRate 25
    VideoBitRate 512
    AVOptionVideo maxrate 2000
    VideoQMin 4
    VideoQMax 50
    VideoBufferSize 4000

    AVOptionVideo cpu-used 3
    AVOptionVideo crf 33
    AVOptionVideo quality realtime
    AVOptionVideo flags +global_header
    #PreRoll 0
    #StartSendOnKey

    # Audio settings
    #AudioCodec aac
    #AudioCodec libopus
    #Strict -2
    AudioBitRate 128
    AudioChannels 2
    AudioSampleRate 48k
    AVOptionAudio flags +global_header

    ACL allow localhost
</Stream>

没有视频(只有音频) - 没有工作

HTTPPort 4000
RTSPPort 1235

RTSPBindAddress 0.0.0.0
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 10000

<Feed feed1.ffm>
        File /tmp/feed1.ffm
        FileMaxSize 1G
        ACL allow 127.0.0.1
        ACL allow localhost
</Feed>

<Stream test1.sdp>
    Feed feed1.ffm
    Format rtp

    # Video settings
    NoVideo

    # Audio settings
    #AudioCodec aac
    #AudioCodec libopus
    #Strict -2
    AudioBitRate 128
    AudioChannels 2
    AudioSampleRate 48k
    AVOptionAudio flags +global_header

    ACL allow localhost
</Stream>

我尝试通过vlc连接到我的流,但我看到vlc中的错误(如果是音频libopus)core error: could not identify codec,如果是音频编解码器(例如aac) - live555 error: no data received in 10s, aborting

ffserver info build:

ffserver version N-86676-g45dbb40cd1-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.4.1 (Debian 5.4.1-11) 20170519
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
  libavutil      55. 67.100 / 55. 67.100
  libavcodec     57.100.102 / 57.100.102
  libavformat    57. 75.100 / 57. 75.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 94.100 /  6. 94.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100

ffmpeg info build:

ffmpeg version N-86676-g45dbb40cd1-static http://johnvansickle.com/ffmpeg/  Copyright (c) 2000-2017 the FFmpeg developers
  built with gcc 5.4.1 (Debian 5.4.1-11) 20170519
  configuration: --enable-gpl --enable-version3 --enable-static --disable-debug --disable-ffplay --disable-indev=sndio --disable-outdev=sndio --cc=gcc-5 --enable-fontconfig --enable-frei0r --enable-gnutls --enable-gray --enable-libass --enable-libfreetype --enable-libfribidi --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-librtmp --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libvidstab --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libzimg
  libavutil      55. 67.100 / 55. 67.100
  libavcodec     57.100.102 / 57.100.102
  libavformat    57. 75.100 / 57. 75.100
  libavdevice    57.  7.100 / 57.  7.100
  libavfilter     6. 94.100 /  6. 94.100
  libswscale      4.  7.101 /  4.  7.101
  libswresample   2.  8.100 /  2.  8.100
  libpostproc    54.  6.100 / 54.  6.100

有什么问题? 任何想法

0 个答案:

没有答案