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

查看:127
本文介绍了使用烧瓶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是正在运行流的flask应用程序.

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'  

在localhost上它正在工作,但是在我的网站上却没有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.

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

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