gpt4 book ai didi

stream - ffserver 流式传输 webm 数据,但没有显示任何内容

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

我正在尝试在 lubuntu 机器上通过互联网传输网络摄像头数据。为此,我安装了 ffmpeg 和 ffserver。但是,我似乎无法让它发挥作用。
我想使用 webm 格式将其集成为 HTML5 视频。我在互联网上找到了几个这样的例子,所以这是我设置的基础。这是我目前拥有的 ffserver 配置:

HTTPPort 8090                      # Port to bind the server to
HTTPBindAddress 0.0.0.0
MaxHTTPConnections 2000
MaxClients 1000
MaxBandwidth 10000 # Maximum bandwidth per client
# set this high enough to exceed stream bitrate
CustomLog -
#NoDaemon # Remove this if you want FFserver to daemonize after start

<Feed feed1.ffm> # This is the input feed where FFmpeg will send
File ./feed1.ffm # video stream.
FileMaxSize 5M # Maximum file size for buffering video
ACL allow 127.0.0.1 # Allowed IPs
</Feed>

<Stream camera1.webm> # Output stream URL definition
Feed feed1.ffm # Feed from which to receive video
Format webm

# Audio settings
#AudioCodec vorbis
#AudioBitRate 64 # Audio bitrate
NoAudio

# Video settings
VideoCodec libvpx
VideoSize 640x480 # Video resolution
VideoFrameRate 2 # Video FPS
AVOptionVideo flags +global_header # Parameters passed to encoder
# (same as ffmpeg command-line parameters)
#AVOptionVideo cpu-used 0
AVOptionVideo qmin 1
AVOptionVideo qmax 42
#AVOptionVideo quality good
AVOptionAudio flags +global_header
#PreRoll 1
#StartSendOnKey
VideoBitRate 400 # Video bitrate
</Stream>

<Stream status.html> # Server status URL
Format status
# Only allow local people to get the status
ACL allow localhost
ACL allow 192.168.0.0 192.168.255.255
</Stream>

<Redirect index.html> # Just an URL redirect for index
# Redirect index.html to the appropriate site
URL http://www.ffmpeg.org/
</Redirect>

我将 FPS 设置为 2 秒,由于某种原因,我使用的计算机可以达到的最大值几乎是 4。然后我使用以下命令启动 ffmpeg:
ffmpeg -f video4linux2 -s 640x480 -r 2 -i /dev/video0 -c:v libvpx http://localhost:8090/feed1.ffm. 

输入是一个标准的 UVC 网络摄像头,可以正常工作(用奶酪测试),ffmpeg 似乎工作(将文件设置为输出工作正常)并且到 ffserver 的链接似乎工作,两个程序相互重新识别。如果应用程序请求 ffserver 流,它会接收数据。例如,wget 会生成一个具有给定比特率的文件大小。但是,在网页中打开流不起作用。
我尝试了两种方式:简单地浏览到 webm 链接。 firefox 表示它正在接收一些数据,但没有显示任何内容。 ffserver 还表示传输了正常数量的数据。我尝试的第二个选项是带有视频流视频标签的网页:
<video with="640" height="480" autoplay>
<source src="http://localhost:8090/camera1.webm" type="video/webm">
</video>

但这也不起作用。
谁知道我哪里出错了?

最佳答案

你可以试试<embed>为此目的标记。像这样的东西:

<embed type="video/webm" src="http://localhost:8090/camera1.webm" width="640" height="480">

如果这不起作用,您可以尝试 127.0.0.1而不是 localhost

关于stream - ffserver 流式传输 webm 数据,但没有显示任何内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26802154/

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