网页控制omxplayer

1.安装lnmp

sudo apt-get update
sudo apt-get  install nginx php5-fpm php5-cli php5-curl php5-gd php5-mcrypt php5-mysql php5-cgi mysql-server
首次安装mysql的时候会提示输入密码,密码不要忘记就行了。
接下来我们来配置Nginx,首先打开配置文件,/etc/nginx/nginx.conf ,按照下面的配置进行修改。

user=root;


接下来打开/etc/nginx/sites-available/default也是按照下面的配置进行修改。

server {
     listen 80;#Web服务端口号,大陆用户可能需要修改为81或8080等
     server_name raspiweb.dyndns.org;
     root /media/usb/www/;
 
     access_log  /var/log/nginx/localhost.access.log;
     #error_page 404 /404.html;
 
     if (!-e $request_filename)
     {
         rewrite ^(.*)$ /index.php$1 last;
     }
 
     location / {
         index  index.html index.htm index.php default.html default.htm default.php;
     }
 
     location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
         access_log  off;
         expires 1d;
     }
 
     location ~ .*\.php(\/.*)*$ {
         fastcgi_split_path_info ^(.+\.php)(/.+)$;
         fastcgi_pass unix:/var/run/php5-fpm.sock;
         fastcgi_index index.php;
         include fastcgi_params;
     }
}

下面是对mysql的调优,打开配置文件/etc/mysql/my.cnf修改以下几处。

1
2
3
4
5
6
7
[mysqld]
key_buffer = 16k
max_allowed_packet = 1M
thread_stack = 64K
thread_cache_size = 4
query_cache_limit = 1M
default-storage-engine = MYISAM

最后我们来配置php.ini,php-fpm,打开配置文件/etc/php5/fpm/php.ini和/etc/php5/fpm/php-fpm.conf修改以下几处。

1
2
memory_limit=16M
process.max=4

到这里我们的lnmp环境配置已经大功告成!接下来是安装phpmyadmin到指定目录~这里只讲如何配置lnmp。

2.修改/etc/php5/fpm/pool.d/www.conf

#user = www-data
#group = www-data
user = pi
group = pi


3. 修改/usr/share/nginx/www/目录权限

chgrp pi *

chown pi *


4.使用soap建设serve.php client.ph

<?php   
//server端 serverSoap.php


$soap = new SoapServer(null,array('uri'=>"http://192.168.1.101/"));//This uri is your SERVER ip.
//$soap->addFunction('play');                                                 //Register the function
$soap->addFunction(SOAP_FUNCTIONS_ALL);
$soap->handle();


function play($url,$dbusname){
//    system("nohup omxplayer --dbus_name $dbusname  $url &",$ret);
system("nohup omxplayer --live --threshold 2  $url &",$ret);
    return $ret;
}


function control($str){
    system("./dbuscontrol.sh $str",$ret);
    return $ret;
}
     
?>  

client.php内容

<?
    $client = new SoapClient(null, array('location' =>"http://localhost/test/server.php",'uri' => "http://127.0.0.1/"));
    echo $client->play($_GET["url"],$_GET["dbusname"]);
?>

备注:使用dbus-send命令控制omxplayer

pi@pi-102:/tmp$ ls
omxplayerdbus.pi  omxplayerdbus.pi.pid

一定要是pi用户才行!!!!!!!!!



  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值