Gstreamer tcpserversink v0.10 vs 1.0 and HTML5 video tag

I am embedding the HTML5 video tag on my site, with the source being the gstreamer stream.

I have a pipeline running 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 through vlc as follows:

 vlc tcp://localhost:8080 

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

Now I'm trying 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 using vlc, BUT . I cannot use this stream in a video tag.

It drives me crazy, I cut the conveyor to a minimum, and I don’t understand why it doesn’t work.

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

+3
source share
2 answers

Let me tell you what an interesting problem this is. After several hours of cheating, I still could not find a suitable solution for my Windows 8.1 window.

I got lucky with the .ogg stream:

  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 the correct display of the stream is still a problem.

This is the html file I am 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 (I don’t know why);
  • Internet Explorer 11.0.9600 draws a player, but reports Invalid Source ;
  • Firefox Nightly 36.0a1 also draws a player, but reports No video with supported format and MIME type found ;

I had no luck with .mp4 streams, despite the fact that VLC played 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 Anti-Virus and IIS were turned on / off during the tests. My little success with Google Chrome came after disabling IIS.

+3
source

Powered by VLC 2.0.8 Twoflower and Chrome Version 37.0.2062.120 Ubuntu 12.04 (281580) (64-bit):

 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 wants the Mime type to be correct. Gstreamer sends this as Mime = 'Plain' when it should be "video / mp4". Failed to override types.

I used empty HTML5 with tags to test various things:

 <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 works on chrome since it just doesn't care about Mime types.

+1
source

Source: https://habr.com/ru/post/970029/


All Articles