Hacking together a FreeBSD presentation streaming box For as little as possible Tom Jones tj@enoti.me 1 / 68
Hacking together a FreeBSD presentation streaming box Internet Engineer Foolish volunteer "I said yes because I don't know how to say no" For as little as possible Founder, sometime organiser at local hackerspace I take the hackerspace camping every summer (campgnd.com) Organiser of Techmeetup Aberdeen Monthly event with beer, pizza and talks Tom Jones 2 / 68 tj@enoti.me 1 / 68
2 / 68 When will the talks be up? "What is needed is adding logos to the front of the video and uploading them to YouTube. That takes time and effort." "Video is not high priority. It is a volunteer effort done only because folks want it. There is so "I much said work yes because and effort I put don't into know the the how conference to say in no" the months before the conference, that once it is over, we want to attend to so many other tasks Founder, which have sometime been pushed organiser to the at side. local We need hackerspace to get caught up on our personal lives. This is part of why it takes so long to get postconference tasks completed." Dan Langille Internet Engineer Foolish volunteer I take the hackerspace camping every summer (campgnd.com) Organiser of Techmeetup Aberdeen Monthly event with beer, pizza and talks 3 / 68
3 / 68 When will the talks be up? Why this talk? "What is needed is adding logos to the front of the video and uploading them to YouTube. That takes time and effort." Recording talks is easy uploading them is nigh on impossible Streaming "Video is not high priority. It is a volunteer effort done only because folks want it. There is so much work and effort put into the the conference in the months before the conference, that once it is over, we want to attend to so many other tasks which have been pushed to the side. We need to get caught up on our personal lives. This is part of why it takes so long to get post- expensive hard require multiple people to operate conference physically exhausting tasks completed." and emotionally devastating Dan Langille If we can can make the equipment cheap the event can own it If the event owns the equipment they can train a team 4 / 68
4 / 68 Why this talk? What this talk is Architecture, tools and equipment to stream events Technical explanation of what these pieces do Instructions on how to hack these pieces together Tools to debug Recording talks is easy uploading them is nigh on impossible Streaming expensive hard require multiple people to operate physically exhausting and emotionally devastating If we can can make the equipment cheap the event can own it If the event owns the equipment they can train a team 5 / 68
5 / 68 What this talk is Typical Box Architecture, tools and equipment to stream events Technical explanation of what these pieces do Instructions on how to hack these pieces together Tools to debug ""#""!""#"" 6 / 68
6 / 68 Typical Box Iron Age Smelting ""#""!""#"" 7 / 68
Iron Age Smelting ERG Summer School 8 / 68 7 / 68
ERG Summer School ERG Summer School 9 / 68 8 / 68
9 / 68 ERG Summer School ERG Summer School 10 / 68
10 / 68 ERG Summer School Summer School Architecture Cl ie nt Cl ie nt Cl ie nt Ci sc o In te rn et St re am Te st Vi d o Mix er St re am La pt o p # # Sl id es Mi c # _ O Au di o De sk Ca me ra 11 / 68
Summer School Architecture What are we doing right now? My laptop is connected to this projector, you can see my slides I am standing up here talking Cl ie nt Cl ie nt Cl ie nt You are listening to me (I hope) and watching stuff from my laptop La pt op Ci sc o In te rn et St re am Pr oj ect or Te st Vi d o Mix er St re am La pt o p Ideally we would share this experience far beyond this room # # Sl id es Mi c 12 / 68 # _ O Au di o De sk Ca me ra 11 / 68
12 / 68 What are we doing right now? Requirements My laptop is connected to this projector, you can see my slides Capture the output from the laptop Capture the audio from speaker I am standing up here talking Send our capture to the internet You Distribute it as far as possible You are listening to me (I hope) and watching stuff from my laptop The Solution Self contained Plug and play La pt op Pr oj ect or Cheap enough for the event to own it Less that 100 would be ideal Components MUST be generally for sale Run FreeBSD Ideally we would share this experience far beyond this room 13 / 68
13 / 68 Requirements What we don't get Capture the output from the laptop Capture the audio from speaker Video of the speaker Audience participation (repeat the question!) Send our capture to the internet Distribute it as far as possible The Solution Self contained Plug and play Cheap enough for the event to own it Less that 100 would be ideal Components MUST be generally for sale Run FreeBSD 14 / 68
14 / 68 What we don't get Components Capturing Slides Capturing Audio Mixing Streaming Out Recording Video Video of the speaker Audience participation (repeat the question!) 15 / 68
15 / 68 Components Capturing Slides Capturing Slides Screen Capture software HDMI Capture Card Capturing Audio Hacked up HDMI thing Mixing Streaming Out Recording Video 16 / 68
16 / 68 Capturing Slides Capturing Slides Screen Capture software HDMI Capture Card Screen Capture software HDMI Capture Card Hacked up HDMI thing Hacked up HDMI thing 17 / 68
17 / 68 Capturing Slides Capturing Slides Screen Capture software HDMI Capture Card Screen Capture software HDMI Capture Card Hacked up HDMI thing Hacked up HDMI thing 18 / 68
18 / 68 Capturing Slides Capturing Slides Screen Capture software HDMI Capture Card Screen Capture software HDMI Capture Card Hacked up HDMI thing Hacked up HDMI thing 19 / 68
19 / 68 Capturing Slides HDMI Ethernet Extender Screen Capture software HDMI Capture Card NOT 60m HDMI CAT6 Ethernet extenders LKV373 based HDMI Ethernet extender Hacked up HDMI thing 20 / 68
HDMI Ethernet Extender HDMI Ethernet Extender NOT 60m HDMI CAT6 Ethernet extenders NOT 60mLKV373 HDMI CAT6 Ethernet extenders based HDMI Ethernet extender LKV373 based HDMI Ethernet extender 21 / 68 20 / 68
HDMI Ethernet Extender HDMI Ethernet Extender NOT 60m HDMI CAT6 Ethernet extenders LKV373 HDMI Extender LKV373 based HDMI Ethernet extender MPEG2 Multicast Fully reverse engineered [1] 1: https://blog.danman.eu/new-version-of-lenkeng-hdmi-over-ip-extender-lkv373a/ 22 / 68 21 / 68
HDMI Ethernet Extender HDMI Ethernet Extender LKV373 HDMI Extender MPEG2 Multicast Fully reverse engineered [1] 23 / 68 1: https://blog.danman.eu/new-version-of-lenkeng-hdmi-over-ip-extender-lkv373a/ 22 / 68
23 / 68 HDMI Ethernet Extender HDMI Ethernet Extender 24 / 68
24 / 68 HDMI Ethernet Extender HDMI Ethernet Extender 25 / 68
25 / 68 HDMI Ethernet Extender Bridging multicast to unicast bridge.sh 26 / 68
26 / 68 Components Capturing Slides Capturing Audio Mixing Bridging multicast to unicast bridge.sh Streaming Out Recording Video 27 / 68
27 / 68 Capturing Audio Interfaces USB Desk ($$) USB Interface ($) Built-in Audio Interface (0) Microphones Components Lavalier Cardioid Boundary/Area Capturing Slides Capturing Audio Mixing Streaming Out Recording Video 28 / 68
28 / 68 Capturing Audio Capturing Audio Interfaces USB Desk ($$) USB Interface ($) Built-in Audio Interface (0) Microphones Lavalier Cardioid Boundary/Area 29 / 68
Capturing Audio Capturing Audio 30 / 68 29 / 68
Capturing Audio Capturing Audio sox is netcat for audio check your levels: Record and play back 31 / 68 30 / 68
31 / 68 Capturing Audio Check that time is progressing sox is netcat for audio check your levels: at the correct rate Record and play back If your test is fast or slow you may need to manually sync the rate 32 / 68
Check that time is progressing Aside: Software Defined Radio at the correct rate A wireless lavalier mic made the most sense It says 229.7M on it could we just grab it from the air? 33 / 68 If your test is fast or slow you may need to manually sync the rate 32 / 68
Aside: Software Defined Radio Aside: Software Defined Radio A wireless lavalier mic made the most sense It says 229.7M on it could we just grab it from the air? 34 / 68 33 / 68
34 / 68 Aside: Software Defined Radio Aside: Software Defined Radio ""#""!""#"" 35 / 68
35 / 68 Aside: Software Defined Radio Aside: Software Defined Radio ""#""!""#"" ""#""!""#"" 36 / 68
36 / 68 Aside: Software Defined Radio Aside: Software Defined Radio AM Voice 229.7MHz center freq ~15KHz wide ""#""!""#"" 37 / 68
37 / 68 Aside: Software Defined Radio Playing audio with rtl_sdr AM Voice 229.7MHz center freq ~15KHz wide Test SDR with FM radio Capturing the wireless mic with rtl_sdr 38 / 68
38 / 68 Playing audio with rtl_sdr Components Capturing Slides Capturing Audio Mixing Test SDR with FM radio Streaming Out Recording Video Capturing the wireless mic with rtl_sdr 39 / 68
39 / 68 Components Mixing: gstreamer Capturing Slides Everything assemblerizer for video and audio Capturing Audio Mixing SR C p p NO DE 1 p p NO DE 2 p p SI NK Streaming Out Recording Video 40 / 68
40 / 68 Mixing: gstreamer Mixing: gstreamer audio Everything assemblerizer for video and audio BEEEEEEEEEEEP! SR C p p NO DE 1 p p NO DE 2 p p SI NK 41 / 68
41 / 68 Mixing: gstreamer audio Mixing: gstreamer video BEEEEEEEEEEEP! 42 / 68
42 / 68 Mixing: gstreamer video Mixing: gstreamer video 43 / 68
43 / 68 Mixing: gstreamer video Mixing: gstreamer muxing AU DI O SR C p p A N O DE p VI DE O SRC p p VN OD E p p MU X p p SI NK 44 / 68
44 / 68 Mixing: gstreamer muxing Mixing: gstreamer demuxing AU DI O SR C p p A N O DE p VI DE O AUD I p p DE MU X p SR C VI DE O SRC p p AN OD E p p VN OD E p p VN OD E p p p p DR OP MU X p p SI NK VI DE O S NK 45 / 68
45 / 68 Mixing: gstreamer demuxing Playing video from the feed recvfeed.sh VI DE O AUD I p p DE MU X SR C p p AN OD E p p VN OD E p p p DR OP VI DE O S NK 46 / 68
46 / 68 Playing video from the feed Playing Audio recvfeed.sh 47 / 68
47 / 68 Playing Audio Components Capturing Slides Capturing Audio Mixing Streaming Out Recording Video 48 / 68
48 / 68 Components Streaming Out Streaming Service handles: Ingestion (accepting our feed) Distribution Mixing Recording Fan out Scale Engine Capturing Slides Capturing Audio Streaming Out Recording Video FreeBSD Streaming CDN Free streaming for BSD events (ask Allan) Other streaming services are available 49 / 68
49 / 68 Streaming Out Streaming Out Streaming Service handles: Service accepts a Real-Time Messaging Protocol (RTMP) stream RTMP Ingestion (accepting our feed) TCP protocol Distribution port 1935 H264 Video Recording AAC Audio Fan out Scale Engine FreeBSD Streaming CDN Free streaming for BSD events (ask Allan) Other streaming services are available 50 / 68
Streaming Out Streaming box Service accepts a Real-Time Messaging Protocol (RTMP) stream RTMP TCP protocol on port 1935 H264 Video AAC Audio 51 / 68 50 / 68
Streaming box Streaming out Mux it together 52 / 68 51 / 68
52 / 68 Streaming out Audio Streaming out Mux it together 53 / 68
53 / 68 Streaming out Video Streaming out Audio 54 / 68
54 / 68 Streaming out In full we get Streaming out Video 55 / 68
55 / 68 Components Capturing Slides Capturing Audio Mixing Streaming out In full we get Streaming Out Recording Video 56 / 68
56 / 68 Components Recording Capturing Slides Scale Engine defaults: Start Capturing a recording at Audio rtmp publish Stop recording at rtmp unpublish Recordings recoverable from Scale Engine file store Mixing Streaming Out Recording Video 57 / 68
Recording Pulling it all together Scale Engine defaults: Start a recording at rtmp publish Stop recording at rtmp unpublish Recordings recoverable from Scale Engine file store 58 / 68 57 / 68
Pulling it all together Pulling it all together 59 / 68 58 / 68
Pulling it all together Pulling it all together 60 / 68 59 / 68
Pulling it all together Architecture Client Client Client Scale Engine Mic Present' Laptop audio if Stream Test Stream Box hdmi tx LAN TAP hdmi rx Projector 61 / 68 60 / 68
Using it Find scaleengine dashboard demo feed Launch stream.sh Launch bridge.sh 62 / 68 Architecture r l n e i P c C i t i e P t t am T i p i u o N j t i d t e e x M a C l e t L e s B x T P r n a se p h t l e a S t n n d o h e S f m m m A C i x o t t c E e ' L n l a r r A e ng S d i i r o c r o 61 / 68
62 / 68 Using it Final System Find scaleengine dashboard demo feed Launch stream.sh Launch bridge.sh 63 / 68
63 / 68 Final System Thank you for listening Questions? ""#""!""#"" 64 / 68
64 / 68 Colophon Questions? This presentation is open source software and was made with open source software. Open tools were used to build the system presented and the final system is open source. FreeBSD wireshark gstreamer socat sox vim Thank you for listening remark.js goat firefox 65 / 68 ""#""!""#""
65 / 68 Saving the video feed to a file recordfeed.sh Colophon This presentation is open source software and was made with open source software. Open tools were used to build the system presented and the final system is open source. FreeBSD wireshark gstreamer socat sox vim remark.js goat firefox 66 / 68
66 / 68 Saving the video feed to a file Capturing AAC Audio recordfeed.sh gstreamer audio pipeline 67 / 68
67 / 68 Capturing AAC Audio Feeding the rtlsdr into gstreamer audio pipeline gstreamer 68 / 68
68 / 68 Feeding the rtlsdr into gstreamer