简体   繁体   English

如何从ffserver流式传输音频

[英]How to stream audio from ffserver

I trying to stream 2 files - 1.mkv without audio (which streaming ok) and 2.mkv with audio encoded with Vorbis codec which i can't stream. 我试图流2个文件 - 1.mkv没有音频(流式传输正常)和2.mkv音频编码与Vorbis编解码器,我无法流。 For encoding I used 对于我使用的编码

ffmpeg -i 2.mp4 -strict -2 -c:a vorbis ex.mkv 

And it playing ok with ffplay 它与ffplay玩得很好

Server log: 服务器日志:

Fri May 17 00:49:08 2019 Opening feed file '1.mkv' for stream 'test1-rtsp'
Fri May 17 00:49:08 2019 [matroska,webm @ 0x200746c0]Unknown entry 0x55B0
Thu Dec 14 21:35:00 1950 [h264 @ 0x2007dcc0]gray chroma
Fri May 17 00:49:08 2019 [h264 @ 0x2007dcc0]error while decoding MB 18 1, bytestream 1989
Fri May 17 00:49:08 2019 [h264 @ 0x2007dcc0]concealing 432 DC, 432 AC, 432 MV errors in I frame
Fri May 17 00:49:08 2019 Opening feed file '2.mkv' for stream 'test2-rtsp'
Fri May 17 00:49:08 2019 [matroska,webm @ 0x200746c0]Unknown entry 0x55B0
Fri May 17 00:49:08 2019 FFserver started.
Fri May 17 00:49:25 2019 [matroska,webm @ 0x20080de0]Unknown entry 0x55B0
Fri May 17 00:49:25 2019 127.0.0.1:33582 - - "PLAY test2-rtsp/streamid=0 RTP/UDP"
Fri May 17 00:49:25 2019 127.0.0.1 - - [SETUP] "rtsp://127.0.0.1:7654/test2-rtsp/ RTSP/1.0" 200 2553

Client log: 客户日志:

Bad packed header lengths (30,0,1250,2673)
[udp @ 00000236f6318500] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 00000236f63185c0] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 00000236f633dc40] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[udp @ 00000236f634df00] 'circular_buffer_size' option was set but it is not supported on this build (pthread support is required)
[rtsp @ 00000236f63153c0] method SETUP failed: 503 Service Unavailable
rtsp://127.0.0.1:7654/test2-rtsp: Server returned 5XX Server Error reply

Configure ffserver file: 配置ffserver文件:

Port 8090
BindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 500000
CustomLog -
NoDaemon

RTSPPort 7654
RTSPBindAddress 0.0.0.0

<Stream test1-rtsp>
    Format rtp
    File "1.mkv"
</Stream>
<Stream test2-rtsp>
    Format rtp
    Strict -2
    AudioCodec vorbis
    File "2.mkv"
</Stream>

first convert 首先转换

ffmpeg -i input.mkv -c:v libx264 -c:a libvo_aacenc -b:a 128k output.mp4

Then stream 然后流

ffmpeg -i output.mp4 -vcodec libx264 -tune zerolatency -crf 18 http://localhost:1234/feed1.ffm

Also there is high chance you can combine the two of them into single script by speicify input codec and output codec. 您也很有可能通过speicify输入编解码器和输出编解码器将它们中的两个组合成单个脚本。 But need to keep trying 但需要继续努力

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM