2

I have a custom board which takes input stream from a IP camera and the application perform facial detection using OpenCV on the input video stream.

My use case is to provide an output stream through network which will be accessible through VLC on any device connected in the same network.

I tried writing OpenCV frames through VideoWriter:

VideoWriter outStream("/home/user/frames/frame.mjpg", CV_FOURCC('M','J','P','G'), CAP_PROP_FPS, img.size(), true);
 if (outStream.isOpened()){
     outStream.write(img);

and creating a stream using mjpg_streamer like:

mjpg_streamer -i "input_file.so -f /home/user/frames" -o "output_http.so -w /usr/local/www -p 5241"

But the above process shows a lot of latency. I can't use imshow as my hardware does not have any video output port.

Here is my code : https://pastebin.com/s66xGjAC

1 Answer 1

2

I would suggest using imwrite(), to save jpeg images in the directory specified by Mjpeg-Streamer. Write low quality Jpegs, set the " CV_IMWRITE_JPEG_QUALITY" to the lowest value that satisfies your requirement.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.