Why VideoJS/HTML5 video tag cannot play video form NGINX media server, while stream is written by OpenCV GStreamer

bahram bahram_adil at hotmail.com
Thu Nov 9 03:57:01 UTC 2017


I try to play the RTMP live video stream from NGINX media server which the
stream is written in OpenCV by GStreamer. It is how I encode the video
stream to FLV format:
String urlWriter = "appsrc ! videoconvert ! x264enc speed-preset=ultrafast
tune=zerolatency threads=2 byte-stream=true ! flvmux ! rtmpsink
location=rtmp://xxxxx:5000/live/test"
VideoWriter writer = new VideoWriter();
writer.open(urlWriter, Videoio.CAP_GSTREAMER, 0, 15, new Size(640, 480),
true);
if (!writer.isOpened()) {
    System.out.println("error open writer");
    return;
}


But when I try to open on the HTML page, it is not working, if I open the
stream in VLC, then it is working well.

But I think there is the problem with FLV encoder, if I use ffenc_flv
encoder it is working neither in VLC nor on the HTML. I want to ask, how I
must encode the stream that can be open in the HTML page? 

HTML code:

// import video.js 5.x
<link href=".\liv\css\video.css" rel="stylesheet">




// usage
<video id="my_video_2" class="video-js vjs-default-skin" controls
preload="auto" width="500" height="500" data-setup='{}'>
    <source src="rtmp://xxxxx:5000/live/test" type="rtmp/flv">
</video>


Note: 
 I tried almost all the encoder no one is working only x264ecn that only
works in VLC.



--
Sent from: http://gstreamer-devel.966125.n4.nabble.com/


More information about the gstreamer-devel mailing list