doucuo4413
2015-06-24 12:59
浏览 21
已采纳

avconv网络摄像头图像到标准输出在php中使用

I try to get a webcam image direct to my PHP script on a debian system. For this, I tried to open a file handling to /dev/video0, but that doesn't work. Using the software "streamer" I got an image to the disk, the webcam works on /dev/video0

I don't want to save the image to the disk first, because I need to refresh it in a short interval. My idea is to get an image direct to the standard output and use php passthru to pipe the output to the client browser:

$header("Content-type: image/jpeg");
passthru('avconv /dev/video0 someparamters for direct output');

I hoped that avconv has the option to push the image to the standard output, but I could not find any option like this. Is there a possibility to get the webcam image (via avconv or another tool) direct in php as an binary stream?

Thanks a lot! Sebastian

图片转代码服务由CSDN问答提供 功能建议

我尝试将网络摄像头图像直接发送到debian系统上的PHP脚本。 为此,我尝试打开文件处理到/ dev / video0,但这不起作用。 使用软件“流光”我得到了一张图像到磁盘,网络摄像头在/ dev / video0上运行

我不想先将图像保存到磁盘,因为我需要 在短时间内刷新它。 我的想法是直接将图像输出到标准输出并使用php passthru将输出传递给客户端浏览器:

  $ header(“Content-type:image / jpeg  “); 
passthru('avconv / dev / video0 someparamters for direct output'); 
   
 
 

我希望avconv可以选择将图像推送到标准 输出,但我找不到这样的选项。 是否有可能将网络摄像头图像(通过avconv或其他工具)直接在PHP中作为二进制流?

非常感谢! Sebastian

  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

2条回答 默认 最新

查看更多回答(1条)

相关推荐 更多相似问题