hi,
i'm trying to use gstreamer to get an rtsp stream from an ip cam into my browser(html video tag). I'm currently trying to use "gst-launch-1.0 rtspsrc location=rtsp://user:password@192.168.1.5:554 ! rtph264depay ! h264parse ! decodebin ! x264enc ! tcpserversink host=127.0.0.1 port=8080" which seems to be sending something, but firefox won't display the video and reports that it has mime type "text/plain". Could anyone recommend the proper command for accomplishing this? thanks -- Information Technology Works https://ITwrx.org @ITwrxorg _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
The video tag in html is a bit problematic. The idea behind it was to be able to play any video in a browser but it requires that the browser implement the logic for handing the media types, which is a big blunder. Here is a table with a few media types: https://developer.mozilla.org/en-US/docs/Web/HTML/Supported_media_formats From what I see you are trying to reencode h264. Is there any reason why h264parse is not enough? h264 is a video compression standard but it does not provide any information on duration, metadata about the stream etc. You need to put the video in a container format that will handle all that for you. If you intend on streaming to a media player you can use tsmux to get an mpegts stream. However, you will need a compatible player on the client side like the vlc embedded player. That has it's own problem in that you need to assume that the client has vlc or any other player installed. One other alternative is to go for hls or mpeg dash. That will require that you create a fragmented stream, create the media descriptor file for the fragmented stream and then provide it via a http server. The nice thing about this approach is that there are javascript based players you can embed in your webpage. But it requires a lot of work to implement all the requirements. I am sure people can suggest more alternatives, but these are the ones I have played around with. If you want something simple I would try the mpegts stream to vlc. you will have a client to start with and can then work towarsd embedding it into your site. Dimitrios On Wed, Jan 18, 2017 at 9:07 PM, ITwrx.org <[hidden email]> wrote: hi, _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
A big blunder indeed. HTML5 video adds a lot of restrictions. The only two options I found to work are: 1) Demux the RTSP stream, re-mux it into fragmented MP4, send
this over HTTP (using EOF encoding, that is: no keepalive, no
content-length, "message" ends when the server closes the socket);
may also require transcoding to make sure the right audio and
video codecs are used, and can be tricky with one-to-many
streaming 2) Similar to (1), but transmit using HLS or DASH instead - these may be more useful for one-to-many streaming (since chunks can be shared between connections), but they are considerably more complex, and can cause problems if the stream isn't always there (for example, if an HLS stream starts on-demand, when the first client connects, then in the beginning, there is no .m3u8 file present yet) Without HTML5, it becomes considerably easier, yes. Although I
prefer Matroska over MPEGTS. On 2017-01-20 09:54, Dimitrios Katsaros
wrote:
_______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Dimitrios Katsaros
On 01/20/2017 02:54 AM, Dimitrios
Katsaros wrote:
right. firefox supports h264/aac but it doesn't support rtsp so i'm trying to use gstreamer to package the rtsp stream so that the browser doesn't know the difference. no, i just didn't know what i was doing. :) this is the heart of my question. isn't there any way to use gstreamer to put the rtsp stream into a container (or anything else the browser needed) and serve to the browser with tcpserversink? i tried mp4mux or splitmuxsink in various incantations with various errors. trying to avoid. thanks for that info. will keep it in mind. would prefer just to use gstreamer. i can do it with videotestsrc and webm (seems to work well) and i can do it with v4l2src and webcam(poorly). hoping there's a way to do it with rtspsrc. Thanks
-- Information Technology Works https://ITwrx.org @ITwrxorg _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Carlos Rafael Giani
On 01/20/2017 03:09 AM, Carlos Rafael
Giani wrote:
this sounds like what i'm trying to do. any chance you could provide an example gst-launch-1.0 command that does this (maybe minus the transcoding)? one-to-many would be nice, but one-to-one would work for my current requirements. thanks for all the info either way.
-- Information Technology Works https://ITwrx.org @ITwrxorg _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by ITwrx.org
this is the heart of my question. isn't there any way to use gstreamer to put the rtsp stream into a container (or anything else the browser needed) and serve to the browser with tcpserversink? i tried mp4mux or splitmuxsink in various incantations with various errors. rtsp is a protocol for controlling media across a network. In other words, the rtsp is the final step for you media pipeline. I am clarifying this since you are stating that you want to put your rtsp stream into a container, something that can not/should not be done. This might be a mistake but if you are confused about this it may be why you are having trouble transmitting data. The normal order of tramsmission of media is raw media -> encoded media -> encoded media wrapped in a container -> media bundled in a network transmission protocol -> transfer across the wire. RTSP is nedded for transmission using udp.If you want to transmit a container format without using a network protocol then you would probably have to use something like tcpserversink to transmit the media correctly. I am not sure how Carlos implemented his solution, but based o what he suggested I would imagine a pipeline looking like: rtspsrc location=rtsp://user:password@ The http compatible sink depends on how you are transmitting the media and how the browser is expecting it. You also need to set the qtmux properties to the correct values. fragment-duration needs to be a positive value and you should also set the streamable flag to true. You will probably have to play around with the values a bit. For the sink you will either want to use something like hlssink, but that expects a hls compatible player on the other end, or you can use something like multifilesink to create fragmented files, that you can serve using a standard http server. that will need from you to save the framgents in the correct location, with the correct name so the browser can request them. I am not sure how the video tag will work with a fragmented file on its own. That will need some looking into, A lot of people use stuff like dash.js or video.js to enhance the video tag. Again, some research is required. On Fri, Jan 20, 2017 at 7:51 PM, ITwrx.org <[hidden email]> wrote:
_______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
If I am no mistaken I once used VP8 in WebM and the tcpserversink element to successfully stream to Chrome. Could be worth a shot!
|
In reply to this post by Dimitrios Katsaros
On 01/24/2017 03:01 AM, Dimitrios
Katsaros wrote:
i must have misunderstood what you meant by "You need to put the video in a container format that will handle all that for you. "
Thanks for all the info.
-- Information Technology Works https://ITwrx.org @ITwrxorg _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
In reply to this post by Arjen Veenhuizen
How did you do that.? i have ip cam and I have to stream it to borwser using
gstreamer -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
HLS plays in mobile browsers like Safari on iOS using the native video player. For PC browsers I find you need to use hls.js. Together you should be able to stream live video to most browsers albeit with some latency. -----Original Message----- From: gstreamer-devel [mailto:[hidden email]] On Behalf Of kalyani2020 Sent: Tuesday, December 12, 2017 6:31 AM To: [hidden email] Subject: Re: rtsp to html5 video tag How did you do that.? i have ip cam and I have to stream it to borwser using gstreamer -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |