搜尋此網誌

2023年3月27日 星期一

Install vlc server on ubuntu server

vlc server 支援 Ipv4 multicast/unicast streaming 和 IPv6 multicast streaming. 
 本篇文章紀錄如何在linux ubuntu server 上安娤和設定 vlc 
 Installation: 
apt update 
apt install vlc -y 

設定:
1. Run vlc as root:
預設是不能以root 執行,用sed更改vlc 權限:
sed -i 's/geteuid/getppid/' /usr/bin/vlc

2. 指定網卡:
如果有雙網卡, vlc 會根據路由優先權發送streaming. 
有時需指定路由, 底下指定IPv6 multicast 由網卡enp4s0 優先送出
ip route add multicast ff00::/8 dev enp4s0 table local metric 100

ip -6 route show type multicast table local


Running:
IPv4 multicast:
cvlc  /root/test.mp4 --sout '#duplicate{dst=rtp{mux=ts,dst='239.0.0.101',sdp=sap,name="Stream1"}}' --sout-keep --sout-all --loop --ttl=10

IPv6 multicast:

cvlc  /root/test.mp4 --sout '#duplicate{dst=rtp{mux=ts,dst='[ff3e::9c00:0]',sdp=sap,name="Stream1"}}' --sout-keep --sout-all --loop --ttl=10 &

Client:
用vlc client 



URL: rtp://[ff3e::9c00:0] or rtp://239.0.0.101




沒有留言:

張貼留言