My aim to get video stream from capture card (Blackmagic decklink) to OpenCV and live stream to red5 or any other rtmp server.
So, I tried done with two branch at gstreamer with command is at below is working properly. But, when using with OpenCV just stream black frames to rtmp server, by the way opencv works well.
Gstreamer Command :
gst-launch-1.0 -v autovideosrc ! tee name=t t. ! videoconvert ! videoscale ! queue ! x264enc pass=pass1 threads=4 bitrate=5000 tune=zerolatency ! queue ! flvmux streamable=true ! rtmpsink location="rtmp://127.0.0.1/live/stb live=1" max-lateness=100 t. ! video/x-raw,width=1280,height=720 ! appsink
OpenCV code :
String gstSentence = "gst-launch-1.0 -v autovideosrc ! tee name=t " +
"t. ! videoconvert ! videoscale ! queue ! x264enc pass=pass1 threads=4 bitrate=5000 tune=zerolatency " +
"! queue ! flvmux streamable=true ! rtmpsink location=\"rtmp://127.0.0.1/live/stb live=1\" max-lateness=100 " +
"t. ! video/x-raw,width=1280,height=720 ! appsink";
System.out.println(gstSentence);
videoCapture = new VideoCapture(gstSentence);
My environment :
- Ubuntu 16.04
- OpenCV 3.1 - Java Wrapper
- Gstreamer 1.8.1
How can I deal with it?
Thanks in advance.