Webm live stream server with Node.js: issues with <video> tag

596 views
Skip to first unread message

Pietro Marrone

unread,
Dec 6, 2013, 12:52:29 PM12/6/13
to webm-d...@webmproject.org

Hello everyone!

I'm using Node.js as stream server to stream realtime Webm videos that is sent by FFMPEG (executed from another application, the stream is done via HTTP) and received by a webapp that uses the tag.

This is what I'm doing: FFMPEG streams the received frames using the following command:

ffmpeg -r 30 -f rawvideo  -pix_fmt bgra -s 640x480 -i \\.\pipe\STREAM_PIPE -r 60  -f segment  -s 240x160 -codec:v libvpx  -f webm http://my.domain.com/video_stream.webm

(the stream comes from an application that uses the Kinect as source and communicates with FFMPEG through a pipe, sending one frame after another)

When the webapp connects, it receives immediately this response from the server:

    HTTP/1.1 200 OK

    X-Powered-By: Express

    content-type: video/webm

    cache-control: private

    connection: close

    Date: Fri, 06 Dec 2013 14:36:31 GMT

and a Webm header (previously stored on the server, with the same resolution and frame rate of the source stream and tested as working on VLC) is immediately appended. Then the webapp starts to receive the data streamed by FFMPEG. 

Here is a screenshot of Mkvinfo GUI showing the fields of the header, for a quick consultation (I also attached the header file to this topic):


However, even if the Network tab of the Chrome console shows that there is an actual stream of data (meaning that what is streamed is not completely garbage, otherwise the connection would be dropped), the player doesn't display anything. We tried to manually prepend our header to the dumped video received by the webapp and VLC plays it just fine, but this is not happening with the <video> tag.

What can cause this problem? Are we missing something about the encoding on the FFMPEG side or we stored wrong values on the header (or they're not enough)?


PS: I cannot rely on an extern stream server.

PPS: We tried the following experiments: 

  •  substituting the video header with the one stored in the server makes the video playable on both vlc and video tag
  •  if we dump the video that is already started (without an header) and we prepend the video header stored in the server or even its original header, the video is playable in VLC but not on the <video> tag (we're carefully prepending the header just before the beggining of the cluster).

webmHeader.webm
Reply all
Reply to author
Forward
0 new messages