linux服务器视频转码,Centos7视频转码服务器(示例代码)

环境 Centos7 双网卡(一网卡负责接收组播 一网卡负责其他服务器访问)

安装系统

下载并解压软件 执行 ipvtl_16ch_trial 可运行转码进程,有提示ip:8888访问 访问见图

arial.ttf  ipvtl_16ch_trial  ipvtl.so  ipvts.so  libva-drm.so.1  libva.so.1

6e027b86a193dffaa6206d155421858e.png

3.调整系统

1.配置两块网卡  网卡1配置互联网地址,网卡2配置一个组播vlan内一个管理IP

2.修改配置文件实现双网卡接收组播 (原因见我其他博客)/etc/sysctl.conf

把 net.ipv4.conf.all.rp_filter和net.ipv4.conf.default.rp_filter设为2即可

net.ipv4.conf.default.rp_filter = 2

net.ipv4.conf.all.rp_filter = 2

4.关闭防火墙systemctl stop firewalld.service 关闭防火墙

systemctl disable firewall.service 禁用开机自启动

5.关闭selinux[[email protected] ~]# cat /etc/selinux/config

# This file controls the state of SELinux on the system.

# SELINUX= can take one of these three values:

#     enforcing - SELinux security policy is enforced.

#     permissive - SELinux prints warnings instead of enforcing.

#     disabled - No SELinux policy is loaded.

SELINUX=disabled

# SELINUXTYPE= can take one of three two values:

#     targeted - Targeted processes are protected,

#     minimum - Modification of targeted policy. Only selected processes are protected.

#     mls - Multi Level Security protection.

SELINUXTYPE=targeted

6 添加组播路由 我网卡为eno4 在网卡配置文件内增加文件

[[email protected] ~]#  cat /etc/sysconfig/network-scripts/route-eno4

234.1.1.0/24 dev eno4

添加完后执行重启网卡 ,route -n 可看到路由[[email protected] ~]# route -n

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

0.0.0.0         10.32.250.225   0.0.0.0         UG    100    0        0 eno1

10.32.250.224   0.0.0.0         255.255.255.240 U     100    0        0 eno1

192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0

192.168.218.0   0.0.0.0         255.255.255.0   U     100    0        0 eno4

234.1.1.0       0.0.0.0         255.255.255.0   U     100    0        0 eno4

7.将转码程序调为开机启动修改/etc/rc.d/rc.local 由于是测试版测试时间30天 ,所以设置为开机启动时删除文件,重新解压。注意rc.local 要添加x权限。rm -rf /ipvtl

tar -xvf /ipvtl_trial-x64.tar

/ipvtl/ipvtl_16ch_trial

至此服务器应该就可以接受组播信息了。

可通过安装vlc视频播放器检测。安装方式见下

yum -y install epel-release

yum install vlc

注意 默认情况下vlc无法通过root运行 ,可以通过修改参数来实现root运行

vim /usr/bin/vlc

搜索geteuid,将其替换为getppid即可

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值