Gstreamer tcpserversink v0.10与1.0和HTML5视频标签

sty*_*uxx 5 linux video html5 gstreamer

我将HTML5视频标签嵌入到我的网站中,源是gstreamer流。

我有一个在gst 0.10上运行的管道:

gst-launch-0.10 -v videotestsrc ! theoraenc ! oggmux ! queue ! tcpserversink port=8080 sync-method=2
Run Code Online (Sandbox Code Playgroud)

我可以像这样通过vlc连接到此流:

vlc tcp://localhost:8080
Run Code Online (Sandbox Code Playgroud)

而且,我还可以在HTML5视频标签中使用该URL,并按预期显示视频。

现在,我尝试将其改编为GST 1.0:

gst-launch-1.0 -v videotestsrc ! theoraenc ! oggmux ! queue ! tcpserversink port=8080 sync-method=2
Run Code Online (Sandbox Code Playgroud)

同样,我可以使用vlc连接到流,但是我不能在视频标签中使用此流。

这让我发疯,我将管道缩减到最低限度,而且我不明白为什么它不起作用。

为什么它可以在旧的GST和VLC中使用,但不能与视频标记中的新GST一起使用?

kar*_*lip 5

让我告诉你这是一个多么有趣的问题。经过几个小时的闲逛后,我仍然找不到适合我的 Windows 8.1 机器的正确解决方案。

我在流式传输.ogg时遇到了一些运气:

 gst-launch-1.0 -v videotestsrc is-live=true ! clockoverlay shaded-background=true font-desc="Sans 38" ! theoraenc ! oggmux ! tcpserversink host=127.0.0.1 port=8080
Run Code Online (Sandbox Code Playgroud)

但正确显示流仍然是一个挑战。

这是我正在使用的 html 文件:

<html>
    <title>A simple HTML5 video test</title>
</html>
<body> 
    <video autoplay controls width=320 height=240>    
    <source src="http://localhost:8080" type="video/ogg">
       You browser doesn't support element <code>video</code>.
    </video>
</body>
Run Code Online (Sandbox Code Playgroud)
  • Google Chrome 38.0.2125.122 显示流,但几秒钟后停止(不知道为什么);
  • Internet Explorer 11.0.9600 绘制玩家但报告Invalid Source
  • Firefox Nightly 36.0a1 也吸引玩家但报告No video with supported format and MIME type found

尽管 VLC 可以正确播放,但我对.mp4流一点运气都没有:

gst-launch-1.0 videotestsrc is-live=true ! clockoverlay shaded-background=true font-desc="Sans 38"  ! x264enc ! mpegtsmux ! queue ! tcpserversink host=127.0.0.1 port=8080
Run Code Online (Sandbox Code Playgroud)

在测试期间启用/禁用卡巴斯基防病毒软件IIS 。我在禁用 IIS 后使用 Google Chrome 取得了小小的成功。