php-opencv / php-opencv

opencv 4.5+ with dnn module for php 7/8

Home Page:https://github.com/php-opencv/php-opencv-examples

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

process video stream with php-opencv?

scramatte opened this issue · comments

Hi,

I'm trying to process a video with CV\VideoCapture , but I 'm unable to open stream.
I've tried with local mp4 and remote hls. Neither works.

What I'm doing wrong?

use CV\VideoCapture;

$url = 'http://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8';
$video=new VideoCapture($url);
var_dump($video->isOpened());
var_dump($video);

To get it working you need to rebuild opencv with ffmpeg librairies.
Finally, I've rebuilt manually OpenCV 4.7 with all these modules and php-opencv, and it works!

I've been able to detect objects by tensorflow model mobilenet from mp4 and hls stream
Currently, I've saved the frame as individual jpeg because Cv\VideoWriter is not implemented into php_opencv.

So, definitely we want to sponsor php-opencv to all these missing parts.

Regards