WEBVTT 00:00.000 --> 00:09.000 So, we're going to continue with the next talk. 00:09.000 --> 00:12.000 I think it's always interesting to hear about how people, 00:12.000 --> 00:14.000 like how infrastructure works, 00:14.000 --> 00:16.000 and especially the conference like this. 00:16.000 --> 00:21.000 There's always cool to hear about this kind of stuff. 00:21.000 --> 00:25.000 So, I'm wondering, I'm sure you're going to talk about it. 00:25.000 --> 00:27.000 So, I'm not going to ask the question. 00:27.000 --> 00:29.000 I'm just going to hand over to the talk. 00:29.000 --> 00:33.000 The talk is called, the title of this talk is conference video streaming 00:33.000 --> 00:35.000 with the help of NYXOS. 00:35.000 --> 00:40.000 So, I'm really curious to hear what you're doing there. 00:40.000 --> 00:46.000 And this is Godfather and Angle of. 00:46.000 --> 00:49.000 So, a round of applause for our speakers, please, 00:49.000 --> 00:52.000 and have a good time with this talk. 00:53.000 --> 00:57.000 Thank you. 00:57.000 --> 01:00.000 First of all, thank you for coming to this talk. 01:00.000 --> 01:04.000 And second of all, I want to thank to the people who made this NYXOS chain. 01:04.000 --> 01:06.000 I feel like a true NYXOS hacker. 01:06.000 --> 01:09.000 Today, we want to tell you something about what we did. 01:09.000 --> 01:12.000 And we want to talk about OpenFest, 01:12.000 --> 01:15.000 which is a really cool conference that we are kind of helping for. 01:15.000 --> 01:18.000 And we're going to talk about the challenge that we had, 01:18.000 --> 01:22.000 how we use NYX to solve all of these challenges and what's next. 01:22.000 --> 01:26.000 So, very roughly, what's OpenFest OpenFest is a conference in 01:26.000 --> 01:30.000 Sofia Bulgaria that happens for the last 20 something years. 01:30.000 --> 01:36.000 Since 2003, it usually happens every full around October. 01:36.000 --> 01:39.000 So, if you happen to be around Bulgaria in October, 01:39.000 --> 01:42.000 please, Robby, we'll be happy to talk about anything. 01:42.000 --> 01:45.000 Open source and open culture related. 01:46.000 --> 01:49.000 At some point, it used to be in multiple cities simultaneously. 01:49.000 --> 01:52.000 Right now, it's just in Sofia, but it's a lot of fun. 01:52.000 --> 01:53.000 I promise. 01:53.000 --> 01:56.000 So, basically, we have this thing. 01:56.000 --> 01:58.000 We have audio and video mixers. 01:58.000 --> 02:01.000 Basically, the same problem that full of them has. 02:01.000 --> 02:02.000 We have cameras. 02:02.000 --> 02:03.000 We have online streaming. 02:03.000 --> 02:04.000 We have presenters. 02:04.000 --> 02:05.000 We have microphones. 02:05.000 --> 02:09.000 And this something has somehow has to be mixed all together. 02:09.000 --> 02:11.000 It has to go online. 02:11.000 --> 02:12.000 It has to be backed up. 02:12.000 --> 02:13.000 It has to be streamed. 02:13.000 --> 02:16.000 It has to be like, it has to work basically. 02:16.000 --> 02:19.000 So, every time we had to deal with this, 02:19.000 --> 02:22.000 it's like, you're setting up basically a Linux machine. 02:22.000 --> 02:25.000 While Linux, I probably wouldn't explain, but yeah. 02:25.000 --> 02:29.000 And the problem is that every time something small changes, 02:29.000 --> 02:32.000 we don't really believe that it's going to work tomorrow. 02:32.000 --> 02:36.000 And that's why we decided we want to do audio video mixer. 02:36.000 --> 02:40.000 That's basically everything has to work from the get-go. 02:40.000 --> 02:42.000 Basically, I want to boot the machine. 02:42.000 --> 02:46.000 And it should like rise up with everything configured and installed. 02:46.000 --> 02:49.000 And I should just press buttons. 02:49.000 --> 02:52.000 We add a lot of fun doing this. 02:52.000 --> 02:53.000 Of course, we did it with nix. 02:53.000 --> 02:55.000 And you'll start at the project. 02:55.000 --> 02:57.000 I joined somewhere in the middle. 02:57.000 --> 03:01.000 And my qualifications were basically I like nix. 03:01.000 --> 03:03.000 And I like fiddle with operating system. 03:03.000 --> 03:07.000 And it turns out that I don't really have to know a lot about audio and video mixers. 03:07.000 --> 03:10.000 But because nix is so flexible and powerful, 03:10.000 --> 03:14.000 you can just apply your knowledge to build something that could complex. 03:14.000 --> 03:16.000 And we had some interesting issues. 03:16.000 --> 03:19.000 For example, we stumbled upon a bug in FFNPEG. 03:19.000 --> 03:22.000 That required like very specific bug. 03:22.000 --> 03:27.000 That required us to kind of roll back to a very specific release of FFNPEG, 03:27.000 --> 03:32.000 which made us kind of compile certain stuff for the specific hardware. 03:32.000 --> 03:35.000 We had to bundle the GPU drivers and all the other stuff. 03:35.000 --> 03:41.000 I had a lot of fun rising sway to like basically all my way bar config. 03:41.000 --> 03:44.000 And all that other cool stuff that I put on my desktop machine. 03:44.000 --> 03:47.000 I put in that configuration and people seem to like that. 03:47.000 --> 03:51.000 Another fun thing that we did is I don't know if I've used something for streaming. 03:51.000 --> 03:59.000 There is a tinkled train deck, which is basically a macro pad with very fancy displays as buttons. 03:59.000 --> 04:01.000 That you can reprogram. 04:01.000 --> 04:07.000 We solved this problem by buying like a very simple and stupid small numpad keyboard. 04:07.000 --> 04:10.000 And we just printed labels on top of it. 04:10.000 --> 04:15.000 And we packed it a little bit with shortcuts for nix and it worked perfectly well. 04:15.000 --> 04:20.000 We also wanted to pack all the assets, all the promo images and videos, 04:20.000 --> 04:22.000 etc. inside the operating system. 04:22.000 --> 04:26.000 So in case something goes wrong and things in conferences go wrong all the time. 04:26.000 --> 04:30.000 I promise it's a fact of life. 04:30.000 --> 04:32.000 So everything's baked in. 04:32.000 --> 04:36.000 And again another friend of ours configured OBS. 04:36.000 --> 04:43.000 So basically when you boot the system, you have exactly the same separation of different screens and all the views. 04:43.000 --> 04:47.000 One of the cool things that we could do because it's nix. 04:47.000 --> 04:51.000 We used nix generators to basically generate QM image. 04:51.000 --> 04:54.000 And because you need to test a lot of stuff all the time. 04:54.000 --> 05:01.000 We need to iterate very fast. QM allows you to boot really fast, validate, fix, rebuild and so on and so on. 05:01.000 --> 05:06.000 And finally, we were using deployers to deploy on the remote host. 05:06.000 --> 05:09.000 That's how we're bootstrapping the mixer computer. 05:09.000 --> 05:13.000 But Angel did not like the process at all for some reason. 05:13.000 --> 05:15.000 He's going to tell the problem more about it. 05:15.000 --> 05:20.000 And he did a thing that he calls deploy Omatic, which besides that it sounds cool. 05:20.000 --> 05:21.000 I know nothing about. 05:22.000 --> 05:24.000 And that was the plan. 05:24.000 --> 05:31.000 We knew that basically the entire point of doing this was to make it softer, disaster recoverable. 05:31.000 --> 05:32.000 So I had a plan. 05:32.000 --> 05:33.000 We had the machine. 05:33.000 --> 05:34.000 Everything's installed on it. 05:34.000 --> 05:36.000 I have a backup hard drive. 05:36.000 --> 05:38.000 And everything's in it on it. 05:38.000 --> 05:40.000 So I can basically at any point boot from it. 05:40.000 --> 05:44.000 And it's going to have exactly the same setup reproducible all of this stuff. 05:44.000 --> 05:49.000 The night before the conference, like before we did the setup. 05:49.000 --> 05:52.000 I decided as that's not that's not good enough. 05:52.000 --> 05:58.000 And I exposed my own binary cache from my home computer to the one in the conference room. 05:58.000 --> 06:04.000 So in case we need to rebuild everything, at least we can save the compile time. 06:04.000 --> 06:05.000 So we used Nick serve. 06:05.000 --> 06:08.000 So we were kind of backed up in a lot of ways. 06:08.000 --> 06:11.000 And of course, as things go with conferences, things broke. 06:11.000 --> 06:17.000 Like Friday afternoon, like late evening, things broke with the computer did not start at all. 06:17.000 --> 06:23.000 There is out that the problem was like our boot loader disappeared, which is like happens. 06:23.000 --> 06:27.000 And the best thing about it is that we kind of figure out what was going on. 06:27.000 --> 06:29.000 But the best thing is because it's Nick's. 06:29.000 --> 06:32.000 We don't have to know how and why it's broken. 06:32.000 --> 06:36.000 I just booted from Nick'sOS Tom Drive. 06:36.000 --> 06:41.000 And I downloaded the flake and I said, hey, I wanted to rebuild that flake on that machine. 06:41.000 --> 06:43.000 And I said, oh, I see that thing. 06:43.000 --> 06:46.000 It took like literally three seconds and it fixed it. 06:46.000 --> 06:48.000 And we rebooted and it was all working. 06:48.000 --> 06:53.000 So basically, it seemed like our investment of doing the setup in Nick'sOS worked. 06:53.000 --> 07:01.000 And a fun fact is that, yeah, I was wondering, I was just lucky that I had a thumb drive in boot. 07:01.000 --> 07:04.000 And I asked around, like, hey, does anyone have a flash drive? 07:04.000 --> 07:07.000 Turns out, on a Linux conference, like 20 people have one. 07:07.000 --> 07:11.000 So how many people have a Linux in their pocket? 07:11.000 --> 07:12.000 Okay, good. 07:12.000 --> 07:15.000 We're in safe hands, so if something goes wrong here, we can fix it. 07:15.000 --> 07:20.000 And the other thing is, we were all prepared for all the software problems that we may occur 07:20.000 --> 07:23.000 because at any point, we can just rebuild everything. 07:23.000 --> 07:26.000 And we know that we're going to get to a state where it works. 07:26.000 --> 07:27.000 And I asked, oh, hey, I know. 07:27.000 --> 07:29.000 We're all backed up with the software. 07:29.000 --> 07:31.000 What's going to happen if the hardware fails? 07:31.000 --> 07:34.000 And he said, well, we're going to cry. 07:34.000 --> 07:37.000 So now, it's going to tell you how we're going to solve this problem. 07:37.000 --> 07:38.000 Yeah. 07:38.000 --> 07:43.000 So one of the good things about deploying software 07:43.000 --> 07:48.000 with nixes that it's reproducible, like when it breaks, you can just get a new one. 07:48.000 --> 07:51.000 Well, we can just apply that to hardware. 07:51.000 --> 07:55.000 And that's what we do at false them for. 07:55.000 --> 07:58.000 Okay, thank you. 07:58.000 --> 08:05.000 So at false them, we use these boxes to stream video from every single room. 08:05.000 --> 08:13.000 So what if we combined this reproducible hardware that's easy to make and open source. 08:13.000 --> 08:18.000 And we have 70 of those that can be replaced when something breaks. 08:18.000 --> 08:25.000 With software that's also reproducible and can be used and rebuilt. 08:25.000 --> 08:28.000 Whenever there is something going wrong. 08:28.000 --> 08:34.000 Well, the false them video box gives us that opportunity. 08:34.000 --> 08:39.000 And so why not run nixOS on it? 08:39.000 --> 08:48.000 And so for the new revision of the false them video box that we're planning to make for false them next year. 08:48.000 --> 09:00.000 We tried just building an image of makesOS, so the system that we made for open-fest for the false them video box. 09:00.000 --> 09:03.000 And it turns out that it just works. 09:03.000 --> 09:11.000 You just have to change a few parameters to make the image build on this target hardware. 09:11.000 --> 09:15.000 That's a little bit more constrained and different. 09:15.000 --> 09:20.000 And it boots and it discovers like the capture cards. 09:20.000 --> 09:26.000 And they appear at the correct places in the device chain. 09:26.000 --> 09:40.000 And all we have to do was package all the software that runs on the video box to actually make use of the custom hardware there. 09:40.000 --> 09:54.000 And that wasn't really any difficult because all of the software is already packaged in the respective programming languages package managers. 09:54.000 --> 10:08.000 And nix just has a very affordable ways of packaging something that's already packaged for example written in go or in Python or in something similar. 10:08.000 --> 10:13.000 So basically that's what we did with the false them box. 10:13.000 --> 10:23.000 And maybe tomorrow one room in false them may or may not run nixOS for its video stream. 10:23.000 --> 10:27.000 And you may or may not notice it breaking or not. 10:27.000 --> 10:28.000 I don't know. 10:28.000 --> 10:41.000 But anyway, what we did for deployment to this repeatable environment is that we generated the disk image. 10:41.000 --> 10:52.000 We first did that with nixOS generators and just flashed it onto the drive of the system. 10:52.000 --> 10:56.000 And then for subsequent. 10:56.000 --> 11:06.000 For subsequent builds, we just deploy the game with deployers or nixOS rebuilds which deploy. 11:06.000 --> 11:17.000 But we discovered a tiny problem with that which is that nixOS generators actually does do really simple things. 11:17.000 --> 11:29.000 It adds some custom nixOS modules to the install so that the target disk is supported. 11:29.000 --> 11:43.000 For example, if you're building for a nix86 system nixOS generators will insert something that will have base hardware support for x86 something like that. 11:43.000 --> 11:57.000 And then it just runs something that's already there a function that's already in nix packages that creates an image for this particular system. 11:57.000 --> 12:04.000 But if you read it, load that nixOS configuration remotely with something like deployers. 12:04.000 --> 12:12.000 Then the custom stuff that gets generated by nixOS generators isn't included. 12:12.000 --> 12:20.000 And so we rendered our systems and bootable the first few times until we figured out what was going wrong. 12:20.000 --> 12:23.000 And then we found out what is going wrong. 12:23.000 --> 12:30.000 And I just couldn't think of more idiomatic way to fix it. 12:30.000 --> 12:38.000 So I just ditched nixOS generators and wrote an even stupider to called deployonmatic. 12:38.000 --> 12:53.000 That simply does the two aforementioned things and also injects the modules that depend on the targets inside the system that gets deployed. 12:53.000 --> 13:08.000 So in the end, we got quite a reproducible system that can be used on multiple hardware instances that we have. 13:08.000 --> 13:13.000 That works on the false them video box. It uses another software for video mixing. 13:13.000 --> 13:22.000 That's not the one that's used on the much more powerful PC that we used that open first. 13:22.000 --> 13:29.000 But the core operating system settings are the same in each case. 13:29.000 --> 13:49.000 And nixOS really makes it easy to share all the bits that are common between the two installs and have the benefit of actually making a fix in one place and having that fix be available in the other place. 13:49.000 --> 13:56.000 So yeah, thanks to the whole nixOS community for making this possible. 13:56.000 --> 14:09.000 And yeah, I hope we will continue using nixOS for video streaming and developing this tool more. 14:09.000 --> 14:16.000 Thank you.