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

时间:2014-09-12 14:29:27

标签: linux html5 video gstreamer

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

我有一个关于gst 0.10的管道:

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

我可以通过vlc连接到此流,如下所示:

vlc tcp://localhost:8080

我还可以在HTML5视频标记中使用该网址,视频会按预期显示。

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

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

我再次使用vlc连接到流,但是我无法在视频代码中使用此流。

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

为什么它适用于旧的gst和vlc,而不适用于视频标签中的新gst?

2 个答案:

答案 0 :(得分:4)

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

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

这是我正在使用的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>
  • 谷歌浏览器 38.0.2125.122显示了流,但几秒后就停止了(不知道原因);
  • Internet Explorer 11.0.9600绘制播放器,但报告Invalid Source;
  • Firefox每晚 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
测试期间启用/禁用了

卡巴斯基反病毒 IIS 。在禁用IIS后,我在Google Chrome上取得了一些成功。

答案 1 :(得分:1)

运行VLC 2.0.8 Twoflower&amp; Chrome版本37.0.2062.120 Ubuntu 12.04(281580)(64位):

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

Firefox希望Mime类型正确。当它应该是'video / mp4'时,Gstreamer将其发送为Mime ='Plain'。没有成功覆盖类型。

我使用带有标签的空HTML5来测试各种内容:

<video id="video" autoplay="autoplay" controls >
    <source src="http://localhost:8083" type="html" codecs="vp8.0, vorbis">
    <source src="http://localhost:8080" type="video/webm" codecs="vp8.0, vorbis">
    <source src="http://localhost:8081" type="video/ogg" codecs="theora, vorbis">
    <source src="http://localhost:8082" type="video/mp4" codecs="avc1.4D401E, mp4a.40.2">
    You browser doesn't support element <code>video</code>.
</video>

webm / ogg / mp4适用于chrome,因为它不关心Mime类型。