Gstreamer tcpserversink v0.10 vs 1.0和HTML5视频标签 [英] Gstreamer tcpserversink v0.10 vs 1.0 and HTML5 video tag

查看:185
本文介绍了Gstreamer tcpserversink v0.10 vs 1.0和HTML5视频标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站中嵌入了一个HTML5视频标签,其源代码是一个gstreamer流。

我有一个工作在gst 0.10的管道:

  gst-launch-0.10 -v videotestsrc! theoraenc! oggmux!队列! tcpserversink port = 8080 sync-method = 2 

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

  vlc tcp:// localhost:8080 

我也可以在HTML5视频标签中使用该网址,并且视频按预期显示。



现在我尝试调整这对于gst 1.0:

  gst-launch-1.0 -v videotestsrc! theoraenc! oggmux!队列! tcpserversink port = 8080 sync-method = 2 

我可以通过vlc连接到流, BUT 我无法在视频标签中使用此流。



这让我疯狂,我把管道放到了最低限度,不明白为什么它不起作用。



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

解决方案

让我告诉你这是一个有趣的问题。经过几个小时的鬼混,我仍然无法找到适合我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 

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

这是我使用的html文件:

 < html> ; 
< title>一个简单的HTML5视频测试< / title>
< / html>
< body>
< video autoplay controls width = 320 height = 240>
< source src =http:// localhost:8080type =video / ogg>
您的浏览器不支持元素< code>视频< / code> ;.
< / video>
< / body>




  • Google Chrome 38.0.2125.122显示但它会在几秒后停止(不知道为什么);
  • Internet Explorer 11.0.9600绘制播放器,但报告无效的源;

  • Firefox Nightly 36.0a1也吸引玩家,但报告找到MIME类型;



使用 .mp4 尽管VLC可以正确播放它:

  gst-launch-1.0 videotestsrc is-live = true! clockoverlay shaded-background = true font-desc =Sans 38! x264enc! mpegtsmux!排队! tcpserversink host = 127.0.0.1 port = 8080 

Kaspersky antivirus IIS 在测试过程中启用/禁用。我禁用IIS后,Google Chrome取得了一点成功。


I am embedding a HTML5 video tag in my site, the source being a gstreamer stream.

I have a pipeline working on gst 0.10:

gst-launch-0.10 -v videotestsrc ! theoraenc ! oggmux ! queue ! tcpserversink port=8080 sync-method=2

I can connect to this stream via vlc like so:

vlc tcp://localhost:8080

And I can also use the URL in a HTML5 video tag and the video is displayed as expected.

Now I try to adapt this for gst 1.0:

gst-launch-1.0 -v videotestsrc ! theoraenc ! oggmux ! queue ! tcpserversink port=8080 sync-method=2

Again I can connect to the stream with vlc, BUT I can not use this stream in a video tag.

This is driving me crazy, I stripped down the pipeline to the bare minimum and I do not understand why it is not working.

Why does it work with the old gst and in vlc but not with the new gst in the video tag?

解决方案

Let me tell you what an interesting problem this is. After hours of fooling around I still couldn't find a proper solution for my Windows 8.1 box.

I had some luck streaming .ogg with:

 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

but displaying the stream correctly is still a challenge.

This is the html file I'm using:

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

  • Google Chrome 38.0.2125.122 displays the stream but it stops after a few seconds (don't know why);
  • Internet Explorer 11.0.9600 draws the player but reports Invalid Source;
  • Firefox Nightly 36.0a1 also draws the player but reports No video with supported format and MIME type found;

I had no luck at all with .mp4 streams despite VLC playing it correctly:

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

Kaspersky antivirus and IIS were enabled/disabled during the tests. My little success with Google Chrome came after disabling IIS.

这篇关于Gstreamer tcpserversink v0.10 vs 1.0和HTML5视频标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆