RTMP live stream

463 views
Skip to first unread message

Dmitriy -

unread,
Feb 17, 2017, 3:22:08 AM2/17/17
to Shaka Player Users
Hello,

Is it possible to play live rtmp stream (h264 video) with Shaka player?

Jacob Trimble

unread,
Feb 17, 2017, 1:55:48 PM2/17/17
to Shaka Player Users
No, Shaka Player only supports DASH and (partially) HLS.

Unfortunately adding support for rtmp would be unlikely.  Shaka Player is a web-based player designed to run in a browser.  rtmp is a binary stream that is sent over TCP.  In a browser, we cannot access the TCP stream directly, we can only make HTTP web requests.  So there is no way for us to access the stream data to parse it.

Maxim Solodovnik

unread,
Feb 21, 2017, 9:36:41 PM2/21/17
to Shaka Player Users
Actually Multimedia data can be sent via websockets, the library like RTMP.js (https://github.com/yurydelendik/rtmp.js) can be used to properly wrap audio/video frames.
Unfortunately I have no idea how RTMP audio/video frame should be wrapped to playable by <video> tag :(

Maybe you have an example of such processing?
We are currently using red5 as media server, setting h264 3_1 profile on client and need to play live stream
Would appreciate any hint on how this can be implemented ...

Jacob Trimble

unread,
Feb 22, 2017, 12:37:58 PM2/22/17
to Shaka Player Users
RTMP.js uses browser specific features (Firefox) to allow access to the raw TCP stream.  You cannot use websockets for this because websockets wrap the TCP communication in a way that would be incompatible with the "raw" RTMP stream.

As far as I can see, RTMP passes raw H264 data inside the stream.  In Shaka Player, we use MSE to append data to <video> tags.  What you could do is wrap the input from the RTMP stream in basic fMP4 (fragmented MP4) files that can be passed to MSE.  This would allow playing and streaming of the content.  You could also look at hls.js (https://github.com/dailymotion/hls.js/tree/master), which is a browser transcoder that converts MPEG2-TS to fMP4.
Reply all
Reply to author
Forward
0 new messages