使用flask apche2和wsgi服务器在raspberrypi上进行视频串流 [英] Video Straming on raspberrypi using flask apche2and wsgi server

查看:38
本文介绍了使用flask apche2和wsgi服务器在raspberrypi上进行视频串流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了 Flask 应用程序通过 raspberrypi 相机串流视频.我用于烧瓶应用程序的代码在这里:https://blog.miguelgrinberg.com/post/video-streaming-with-烧瓶

I have used flask app for straming video via raspberrypi camera. The code i used for flask app is here: https://blog.miguelgrinberg.com/post/video-streaming-with-flask

在本地服务器上它正在播放视频流,但不在我的网站上.

In local server it is doing video stream but not on my website.

我正在使用具有 wsgi 文件的 apache2 服务器:

I am using apache2 server having wsgi file below:

flaskapp2.wsgi

flaskapp2.wsgi

#!/usr/bin/python
import sys  
import logging  
logging.basicConfig(stream=sys.stderr)   
sys.path.insert(0,"/var/www/FlaskApp2/FlaskApp2")  
from ashish import app as application  
application.secret_key ='1233883'

文件系统的结构是:

/var/www/FlaskApp2/
    flskapp2.wsgi
    FlaskApp2/
        ashish.py
        camera_pi.py
        templates/index.html  

ashish.py 是正在执行流的烧瓶应用程序.

The ashish.py is the flask app which is doing stream.

apache中的错误日志文件为:

The error log file in apache is:

[Wed Nov 23 15:17:17.458803 2016] [mpm_prefork:notice] [pid 783] AH00163: Apache/2.4.10 (Raspbian) mod_wsgi/4.3.0 Python/2.7.9 configured -- resuming normal operations  

[Wed Nov 23 15:17:17.459043 2016] [core:notice] [pid 783] AH00094: Command line: '/usr/sbin/apache2' 

[Wed Nov 23 15:17:14.278353 2016] [wsgi:warn] [pid 662] mod_wsgi: Compiled for Python/2.7.8.  

[Wed Nov 23 15:17:14.279359 2016] [wsgi:warn] [pid 662] mod_wsgi: Runtime using Python/2.7.9.  

[Wed Nov 23 15:17:14.305871 2016] [mpm_prefork:notice] [pid 662] AH00163: Apache/2.4.10 (Raspbian) mod_wsgi/4.3.0 Python/2.7.9 configured -- resuming normal operations  

[Wed Nov 23 15:17:14.306169 2016] [core:notice] [pid 662] AH00094: Command line: '/usr/sbin/apache2'  

[Wed Nov 23 15:17:16.502484 2016] [wsgi:warn] [pid 670] mod_wsgi: Compiled for Python/2.7.8.  

[Wed Nov 23 15:17:16.504897 2016] [wsgi:warn] [pid 670] mod_wsgi: Runtime using Python/2.7.9.  

[Wed Nov 23 15:17:16.531217 2016] [mpm_prefork:notice] [pid 670] AH00163: Apache/2.4.10 (Raspbian) mod_wsgi/4.3.0 Python/2.7.9 configured -- resuming normal operations  

[Wed Nov 23 15:17:16.531502 2016] [core:notice] [pid 670] AH00094: Command line: '/usr/sbin/apache2'  

在本地主机上它可以工作,但在我的网站上却没有,wsgi 文件中是否有任何错误,或者我需要添加一些内容.

On localhost it is working but not on my website is there any mistake in wsgi file or i need to add something.

推荐答案

我的整个文件配置是正确的,但是当我在 apache 服务器下运行 Flask 应用程序时,apache 无法访问 pi 摄像头,因为它没有 root 访问权限到 pi.so,在本地服务器上它正在运行,但在我的网站上运行时却没有在 apache 上运行.

My whole configuration of files were right but as i was running flask applications under apache server ,apache was not able to acess pi camera because it was not having root access to pi.so,on local server it was working but not on my website when it was running on apache.

这篇关于使用flask apche2和wsgi服务器在raspberrypi上进行视频串流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆