Gstreamer tcpserversink v0.10 vs 1.0 and HTML5 video tag

gstreamer, html, linux, video

Solution

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.

Problem

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?

Original source