How do I stream an openCV video to an HTML webpage?

前端 未结 3 632
清歌不尽
清歌不尽 2020-12-24 13:45

I am making a robot that will have a webcam on it to provide some simple object detection. For right now, I would like to simply stream the video to a webpage hosted on the

3条回答
  •  半阙折子戏
    2020-12-24 14:16

    The issue of streaming frames out of OpenCV and Python has been addressed in the following thread: Pipe raw OpenCV images to FFmpeg

    This didn't work for me, but they claim it did for them.

    The reason for it not working in my case seems to be that for some output frames additional bytes were added or lost, somewhere between the output to stdout in capture.py and the input to FFMPEG. Therefore, the number of bytes doesn't correspond to the number of frames. I am not sure why this is the case. I used Windows 7.

    I will be curious to hear what is your experience if you try this. I also tried a modified version of capture.py using cv2, and failed for the same reasons.

提交回复
热议问题