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: