gpt4 book ai didi

ffmpeg - 如何从 ffserver 流式传输音频

转载 作者:行者123 更新时间:2023-12-04 23:24:03 25 4
gpt4 key购买 nike

我尝试流式传输 2 个文件 - 1.mkv没有音频(可以流式传输)和2.mkv使用我无法流式传输的 Vorbis 编解码器编码的音频。对于我使用的编码

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

ffplay 一起玩还不错

服务器日志:
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

客户端日志:
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

配置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>

最佳答案

首先转换

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

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

您也很有可能通过指定输入编解码器和输出编解码器将它们两者组合成单个脚本。但需要继续努力

关于ffmpeg - 如何从 ffserver 流式传输音频,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56177171/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com