Difference between revisions of "VLC mosaic config"

From Hackerspace ACKspace
Jump to: navigation, search
(Specific version seems to do the trick)
(Made multi-channel audio work in mosaic)
 
Line 55: Line 55:
  
 
new channel2 broadcast enabled
 
new channel2 broadcast enabled
#setup channel1 input "https://cdn.c3voc.de/hls/s2_native_hd.m3u8"
+
#setup channel2 input "https://cdn.c3voc.de/hls/s2_native_hd.m3u8"
 
setup channel2 input "https://cdn.c3voc.de/hls/s2_native_sd.m3u8"
 
setup channel2 input "https://cdn.c3voc.de/hls/s2_native_sd.m3u8"
 
setup channel2 output #rtp{mux=ts,dst=239.255.255.42,port=9002,sdp=sap://,name="Saal Borg"}
 
setup channel2 output #rtp{mux=ts,dst=239.255.255.42,port=9002,sdp=sap://,name="Saal Borg"}
  
 
new channel3 broadcast enabled
 
new channel3 broadcast enabled
#setup channel1 input "https://cdn.c3voc.de/hls/s3_native_hd.m3u8"
+
#setup channel3 input "https://cdn.c3voc.de/hls/s3_native_hd.m3u8"
 
setup channel3 input "https://cdn.c3voc.de/hls/s3_native_sd.m3u8"
 
setup channel3 input "https://cdn.c3voc.de/hls/s3_native_sd.m3u8"
 
setup channel3 output #rtp{mux=ts,dst=239.255.255.42,port=9003,sdp=sap://,name="Saal Clarke"}
 
setup channel3 output #rtp{mux=ts,dst=239.255.255.42,port=9003,sdp=sap://,name="Saal Clarke"}
  
 
new channel4 broadcast enabled
 
new channel4 broadcast enabled
#setup channel1 input "https://cdn.c3voc.de/hls/s4_native_hd.m3u8"
+
#setup channel4 input "https://cdn.c3voc.de/hls/s4_native_hd.m3u8"
 
setup channel4 input "https://cdn.c3voc.de/hls/s4_native_sd.m3u8"
 
setup channel4 input "https://cdn.c3voc.de/hls/s4_native_sd.m3u8"
 
setup channel4 output #rtp{mux=ts,dst=239.255.255.42,port=9004,sdp=sap://,name="Saal Dijkstra"}
 
setup channel4 output #rtp{mux=ts,dst=239.255.255.42,port=9004,sdp=sap://,name="Saal Dijkstra"}
  
 
new channel5 broadcast enabled
 
new channel5 broadcast enabled
#setup channel1 input "https://cdn.c3voc.de/hls/s5_native_hd.m3u8"
+
#setup channel5 input "https://cdn.c3voc.de/hls/s5_native_hd.m3u8"
 
setup channel5 input "https://cdn.c3voc.de/hls/s5_native_sd.m3u8"
 
setup channel5 input "https://cdn.c3voc.de/hls/s5_native_sd.m3u8"
 
setup channel5 output #rtp{mux=ts,dst=239.255.255.42,port=9005,sdp=sap://,name="Saal Eliza"}
 
setup channel5 output #rtp{mux=ts,dst=239.255.255.42,port=9005,sdp=sap://,name="Saal Eliza"}
  
 
new channel6 broadcast enabled
 
new channel6 broadcast enabled
#setup channel1 input "https://cdn.c3voc.de/hls/s150_native_hd.m3u8"
+
#setup channel6 input "https://cdn.c3voc.de/hls/s150_native_hd.m3u8"
 
setup channel6 input "https://cdn.c3voc.de/hls/s150_native_sd.m3u8"
 
setup channel6 input "https://cdn.c3voc.de/hls/s150_native_sd.m3u8"
 
setup channel6 output #rtp{mux=ts,dst=239.255.255.42,port=9006,sdp=sap://,name="Chaos West Buhne"}
 
setup channel6 output #rtp{mux=ts,dst=239.255.255.42,port=9006,sdp=sap://,name="Chaos West Buhne"}
  
 
new channel7 broadcast enabled
 
new channel7 broadcast enabled
#setup channel1 input "https://cdn.c3voc.de/hls/s151_native_hd.m3u8"
+
#setup channel7 input "https://cdn.c3voc.de/hls/s89_native_hd.m3u8"
setup channel7 input "https://cdn.c3voc.de/hls/s151_native_sd.m3u8"
+
setup channel7 input "https://cdn.c3voc.de/hls/s89_native_sd.m3u8"
 
setup channel7 output #rtp{mux=ts,dst=239.255.255.42,port=9007,sdp=sap://,name="WikiPakaWG Eszimmer"}
 
setup channel7 output #rtp{mux=ts,dst=239.255.255.42,port=9007,sdp=sap://,name="WikiPakaWG Eszimmer"}
  
 
new channel8 broadcast enabled
 
new channel8 broadcast enabled
#setup channel1 input "https://cdn.c3voc.de/hls/soio_native_hd.m3u8"
+
#setup channel8 input "https://cdn.c3voc.de/hls/oio_native_hd.m3u8"
setup channel8 input "https://cdn.c3voc.de/hls/soio_native_sd.m3u8"
+
setup channel8 input "https://cdn.c3voc.de/hls/oio_native_sd.m3u8"
 
setup channel8 output #rtp{mux=ts,dst=239.255.255.42,port=9008,sdp=sap://,name="OIO"}
 
setup channel8 output #rtp{mux=ts,dst=239.255.255.42,port=9008,sdp=sap://,name="OIO"}
  
Line 107: Line 107:
 
new channel1 broadcast enabled
 
new channel1 broadcast enabled
 
setup channel1 input "rtp://@239.255.255.42:9001"
 
setup channel1 input "rtp://@239.255.255.42:9001"
setup channel1 output #duplicate{dst=mosaic-bridge{id=1},select=video,dst=mosaic-bridge{id=1},select=audio}
+
setup channel1 output #duplicate{dst=mosaic-bridge{id=1},select=video,dst=bridge-out{id=1},select=audio}
  
 
new channel2 broadcast enabled
 
new channel2 broadcast enabled
 
setup channel2 input "rtp://@239.255.255.42:9002"
 
setup channel2 input "rtp://@239.255.255.42:9002"
setup channel2 output #duplicate{dst=mosaic-bridge{id=2},select=video,dst=mosaic-bridge{id=2},select=audio}
+
setup channel2 output #duplicate{dst=mosaic-bridge{id=2},select=video,dst=bridge-out{id=2},select=audio}
  
 
new channel3 broadcast enabled
 
new channel3 broadcast enabled
 
setup channel3 input "rtp://@239.255.255.42:9003"
 
setup channel3 input "rtp://@239.255.255.42:9003"
setup channel3 output #duplicate{dst=mosaic-bridge{id=3},select=video,dst=mosaic-bridge{id=3},select=audio}
+
setup channel3 output #duplicate{dst=mosaic-bridge{id=3},select=video,dst=bridge-out{id=3},select=audio}
  
 
new channel4 broadcast enabled
 
new channel4 broadcast enabled
 
setup channel4 input "rtp://@239.255.255.42:9004"
 
setup channel4 input "rtp://@239.255.255.42:9004"
setup channel4 output #duplicate{dst=mosaic-bridge{id=4},select=video,dst=mosaic-bridge{id=4},select=audio}
+
setup channel4 output #duplicate{dst=mosaic-bridge{id=4},select=video,dst=bridge-out{id=4},select=audio}
  
 
new channel5 broadcast enabled
 
new channel5 broadcast enabled
 
setup channel5 input "rtp://@239.255.255.42:9005"
 
setup channel5 input "rtp://@239.255.255.42:9005"
setup channel5 output #duplicate{dst=mosaic-bridge{id=5},select=video,dst=mosaic-bridge{id=5},select=audio}
+
setup channel5 output #duplicate{dst=mosaic-bridge{id=5},select=video,dst=bridge-out{id=5},select=audio}
  
 
new channel6 broadcast enabled
 
new channel6 broadcast enabled
 
setup channel6 input "rtp://@239.255.255.42:9006"
 
setup channel6 input "rtp://@239.255.255.42:9006"
setup channel6 output #duplicate{dst=mosaic-bridge{id=6},select=video,dst=mosaic-bridge{id=6},select=audio}
+
setup channel6 output #duplicate{dst=mosaic-bridge{id=6},select=video,dst=bridge-out{id=6},select=audio}
  
 
new channel7 broadcast enabled
 
new channel7 broadcast enabled
 
setup channel7 input "rtp://@239.255.255.42:9007"
 
setup channel7 input "rtp://@239.255.255.42:9007"
setup channel7 output #duplicate{dst=mosaic-bridge{id=7},select=video,dst=mosaic-bridge{id=7},select=audio}
+
setup channel7 output #duplicate{dst=mosaic-bridge{id=7},select=video,dst=bridge-out{id=7},select=audio}
  
 
new channel8 broadcast enabled
 
new channel8 broadcast enabled
 
setup channel8 input "rtp://@239.255.255.42:9008"
 
setup channel8 input "rtp://@239.255.255.42:9008"
setup channel8 output #duplicate{dst=mosaic-bridge{id=8},select=video,dst=mosaic-bridge{id=8},select=audio}
+
setup channel8 output #duplicate{dst=mosaic-bridge{id=8},select=video,dst=bridge-out{id=8},select=audio}
  
 
new mosaic broadcast enabled
 
new mosaic broadcast enabled

Latest revision as of 17:17, 29 December 2019

Project: VLC mosaic config
Featured: No
State Active
Members xopr, Stuiterveer
GitHub pausenkatzen
Description
Picture
No project picture! Fill in form Picture or Upload a jpeg here

We're streaming hacker conferences and camps several years now, and every year something new is added. The update with the most impact was in December 2014: "let's try multicast". This year xopr is trying to automate his ridiculous video spamming with his "pausenkatzen" project. For the people that didn't grew up in the 70's or 80's with German television: Pausenkatzen is a placeholder video (with playing cats) when there is no actual content. Nowadays it's probably erotic contact ads and horoscope TV.

Note: Below is the original working (static) config

preface

Initially (years ago) xopr figured out a way how to do multicast streaming. The reason was simple: lower some of CCC's data output, minimize data output of our own server and don't simply spam the network with broadcast.

After a lot of experimentation (using VLC since that had some GUI to get going and a command line for further experimentation), the best recipe seemed to be RTP multicast; this could survive hiccups of the stream without VLC throwing an error or stopping playback. At first, the network (including wifi) broke, since the switches and router didn't do IGMP snooping.

This failed again in 2017 (maybe even the year before): all streams would glitch into unintelligible pink blobs onto the mosaic. stuiterveer joined the project and with his effort of experimenting with versions, he came to the conclusion that only VLC version 2.1.6 works 'stable' and had it installed on a Ubuntu 14.4 VM. Note that 14.4 is supported until april 2019. Also note that all 100Mbit devices (read: Raspberry PI) will have severe network problems if they receive multicast traffic of this magnitude.


pausenkatzen mosaic

Reads c3voc congress and camp schedules and sets up multicast streams for each room/stage. Transmits a random video from a pool when there is no talk broadcasted (also known as 'pausenkatzen' or: 'intermission cats').

Also, create a mosaic that covers all streams, backed with testcards in case a stream fails. See the github page for the source. One thing is to learn how VLC integrates SAP/SDP announcements in/next to the actual stream.


future

Since support for both Ubuntu 14.4 and VLC 2.1.6 has ended, xopr is going to look for another solution to create the mosaic. c3voc has a really impressive repository and there should be enough ffmpeg documentation to get going.


old configuration

These configs were used in previous years (and therefore proven to be successful).

VLC config files

Note: apparently VLC >= 3.x has issues with HLS streams, VLC >= 2.2 has issues with creating the mosaic. It's best to use VLC < 2.2 to make this work. Specifically VLC 2.1.6 seems to work best at this point. This is included by default in the Ubuntu 14.04 repositories, for other distros you will need to search around or compile from source (which will be "fun" since most dependencies included in the makefile have changed in the meantime).

broadcast.conf

fetch 4 unicast streams and put them out as multicast

# cvlc --vlm-conf /home/xopr/Desktop/VLC/broadcast.conf
# vlc rtp://@239.255.255.42:5004

new channel1 broadcast enabled
#setup channel1 input "https://cdn.c3voc.de/hls/s1_native_hd.m3u8"
setup channel1 input "https://cdn.c3voc.de/hls/s1_native_sd.m3u8"
setup channel1 output #rtp{mux=ts,dst=239.255.255.42,port=9001,sdp=sap://,name="Saal Adams"}

new channel2 broadcast enabled
#setup channel2 input "https://cdn.c3voc.de/hls/s2_native_hd.m3u8"
setup channel2 input "https://cdn.c3voc.de/hls/s2_native_sd.m3u8"
setup channel2 output #rtp{mux=ts,dst=239.255.255.42,port=9002,sdp=sap://,name="Saal Borg"}

new channel3 broadcast enabled
#setup channel3 input "https://cdn.c3voc.de/hls/s3_native_hd.m3u8"
setup channel3 input "https://cdn.c3voc.de/hls/s3_native_sd.m3u8"
setup channel3 output #rtp{mux=ts,dst=239.255.255.42,port=9003,sdp=sap://,name="Saal Clarke"}

new channel4 broadcast enabled
#setup channel4 input "https://cdn.c3voc.de/hls/s4_native_hd.m3u8"
setup channel4 input "https://cdn.c3voc.de/hls/s4_native_sd.m3u8"
setup channel4 output #rtp{mux=ts,dst=239.255.255.42,port=9004,sdp=sap://,name="Saal Dijkstra"}

new channel5 broadcast enabled
#setup channel5 input "https://cdn.c3voc.de/hls/s5_native_hd.m3u8"
setup channel5 input "https://cdn.c3voc.de/hls/s5_native_sd.m3u8"
setup channel5 output #rtp{mux=ts,dst=239.255.255.42,port=9005,sdp=sap://,name="Saal Eliza"}

new channel6 broadcast enabled
#setup channel6 input "https://cdn.c3voc.de/hls/s150_native_hd.m3u8"
setup channel6 input "https://cdn.c3voc.de/hls/s150_native_sd.m3u8"
setup channel6 output #rtp{mux=ts,dst=239.255.255.42,port=9006,sdp=sap://,name="Chaos West Buhne"}

new channel7 broadcast enabled
#setup channel7 input "https://cdn.c3voc.de/hls/s89_native_hd.m3u8"
setup channel7 input "https://cdn.c3voc.de/hls/s89_native_sd.m3u8"
setup channel7 output #rtp{mux=ts,dst=239.255.255.42,port=9007,sdp=sap://,name="WikiPakaWG Eszimmer"}

new channel8 broadcast enabled
#setup channel8 input "https://cdn.c3voc.de/hls/oio_native_hd.m3u8"
setup channel8 input "https://cdn.c3voc.de/hls/oio_native_sd.m3u8"
setup channel8 output #rtp{mux=ts,dst=239.255.255.42,port=9008,sdp=sap://,name="OIO"}

control channel1 play
control channel2 play
control channel3 play
control channel4 play
control channel5 play
control channel6 play
control channel7 play
control channel8 play

saal_mosaic.conf

Pick up on the 8 multicast streams and put them in a mosaic

# run with
# cvlc --vlm-conf /home/xopr/Desktop/VLC/saal_mosaic.conf --mosaic-width 1280 --mosaic-order "1,2,3,4,9,5,6,7,8" --mosaic-height 720

new channel1 broadcast enabled
setup channel1 input "rtp://@239.255.255.42:9001"
setup channel1 output #duplicate{dst=mosaic-bridge{id=1},select=video,dst=bridge-out{id=1},select=audio}

new channel2 broadcast enabled
setup channel2 input "rtp://@239.255.255.42:9002"
setup channel2 output #duplicate{dst=mosaic-bridge{id=2},select=video,dst=bridge-out{id=2},select=audio}

new channel3 broadcast enabled
setup channel3 input "rtp://@239.255.255.42:9003"
setup channel3 output #duplicate{dst=mosaic-bridge{id=3},select=video,dst=bridge-out{id=3},select=audio}

new channel4 broadcast enabled
setup channel4 input "rtp://@239.255.255.42:9004"
setup channel4 output #duplicate{dst=mosaic-bridge{id=4},select=video,dst=bridge-out{id=4},select=audio}

new channel5 broadcast enabled
setup channel5 input "rtp://@239.255.255.42:9005"
setup channel5 output #duplicate{dst=mosaic-bridge{id=5},select=video,dst=bridge-out{id=5},select=audio}

new channel6 broadcast enabled
setup channel6 input "rtp://@239.255.255.42:9006"
setup channel6 output #duplicate{dst=mosaic-bridge{id=6},select=video,dst=bridge-out{id=6},select=audio}

new channel7 broadcast enabled
setup channel7 input "rtp://@239.255.255.42:9007"
setup channel7 output #duplicate{dst=mosaic-bridge{id=7},select=video,dst=bridge-out{id=7},select=audio}

new channel8 broadcast enabled
setup channel8 input "rtp://@239.255.255.42:9008"
setup channel8 output #duplicate{dst=mosaic-bridge{id=8},select=video,dst=bridge-out{id=8},select=audio}

new mosaic broadcast enabled
setup mosaic input "file:///home/xopr/Desktop/VLC/ACKbg-1280x720.jpg"
setup mosaic option image-duration=-1
setup mosaic option image-fps=24/1
setup mosaic option mosaic-position=1
setup mosaic output #transcode{sfilter=mosaic,vcodec=mp2v,vb=500,scale=1}:bridge-in{delay=400,id-offset=100}:rtp{mux=ts,dst=239.255.255.42,port=5004,sap,name="Mosaic"}

control channel1 play
control channel2 play
control channel3 play
control channel4 play
control channel5 play
control channel6 play
control channel7 play
control channel8 play
control mosaic play

backgrounds

The mosaic uses a background with testcards plotted in a similar layout as the mosaic video's.

Recently xopr created a bash script for generating these. It uses bg.png as a base, and adding a philips PM5644 testcard for each title provided like this: ./mosaicbg.sh SAAL1 SAAL2 SAALG,"special room" SAAL6

notes and other info

  • 4 HD streams were too heavy for my (xopr's) dual core hyperthreaded 2.4GHz laptop: it would glitch into an unintelligible paint blob
  • using a VLM config file to open multiple streams with bandwith/cpu issues causes all streams to pause upon reconnecting a stream that went out of sync. Use a separate instance for each stream. (Note that this was before stuiterveer discovered that previous versions of VLC seemed to work better)
  • the RTP stream seems to emit some type of timecode, so multiple streams are fairly in sync. Picking up on the RTP streams to create an RTP mosaic will off course delay that mosaic.
  • In 2013, Xopr wrote an XBMC remote control script for streams to switch channels from within a console with just one keypress.
  • Multicast streams didn't work on wifi (as expected), but even worse: multicast broke the wifi networks. You can start a multicast stream over wifi though.