LELex FridmanMay 21, 2026· 4:18:22

FFmpeg: The Incredible Technology Behind Video on the Internet | Lex Fridman Podcast #496

Jean-Baptiste Kempf (VLC lead) and Kieran Kunhya (FFmpeg contributor) trace the evolution of video codecs from H.264 to AV1, revealing how handwritten assembly in projects like Dav1d achieves 62x speedups over C. They recount reverse-engineering GoToMeeting's codec, the 2011 FFmpeg-Libav split, and the burnout crisis in open-source, arguing that security researchers must contribute patches, not just CVEs. The pair also explain VLC's zero-trust parsing, the importance of archival codecs, and why assembly remains essential for real-time video at scale.

  1. 0:00Intro
  2. 5:29VLC & Decoding
  3. 19:20Codecs & Containers
  4. 30:07FFmpeg
  5. 51:07Open Source
  6. 1:10:18Twitter Drama
  7. 1:32:28Assembly
  8. 2:25:27Rust
  9. 2:34:43Forks & Burnout
  10. 2:49:22Codec Mastery
  11. 3:11:04Future & Security
  12. 4:17:00Outro

Transcript

Intro0:00

Jean-Baptiste Kempf0:00

The important is, is your code good? We care about excellent code. We don't care who you are. Like maybe you're a dog, I don't care, right? I don't care where you come from. I need to look at your code.

Oh, yeah, but I'm engineer at this very large company in, in, in Italy, in Germany, in the US. We don't care. We care about the quality of your code because this is what defines our community and which means that we have a lot of people who contribute who are some very different backgrounds and, and, and very introverts.

Sure. But that's okay, right?

Lex Fridman0:32

FFmpeg is probably one of the biggest CPU users in the world. Everything we've just said in the past couple of minutes, every sentence is someone's lifetime's work. There are books about every sentence. So the level of complexity in many cases is inordinate.

Jean-Baptiste Kempf0:46

FFmpeg has one hundred thousand lines of assembly for all the codecs.

Lex Fridman0:50

For all codecs. Mm-hmm.

Jean-Baptiste Kempf0:51

And just this one has two hundred and forty thousand. Every cycle matters. We are talking about probably three billion devices which are going to decode video nonstop because, for example, thirty percent of the video from Netflix are now in everyone, fifty percent of YouTube.

Lex Fridman1:08

This is what peak video codecs should look like. Seventy-nine point nine percent assembly, nineteen point six percent C, and, uh, zero point five percent other.

Jean-Baptiste Kempf1:19

And, and what's incredible is with those tweets, which is factual, people get crazy.

Lex Fridman1:26

For the last two years they go crazy, "No, intrinsics is fine. The compiler-

Jean-Baptiste Kempf1:29

You can optimize your compiler. Auto-vectorization, it's your fault. You don't understand. And we've tried that forever, right?

Lex Fridman1:36

For two years, and two years later, showing hundreds of examples of, of handwritten assembly. No, no, no, you're doing it wrong. The compiler can do this. The intelligence agencies tried to like say, "Can you put a backdoor in VLC?"

Jean-Baptiste Kempf1:49

Yeah. Yes. Two of them.

Lex Fridman1:50

Well, what did you say?

Jean-Baptiste Kempf1:52

No. Well, I was a lot less polite.

Lex Fridman1:55

Basically saying, "Hell no."

Jean-Baptiste Kempf1:56

Like if we had to compromise our software, we would shut it down. This is clear.

Lex Fridman2:01

Any tweets, uh, Kieran, you regret?

Kieran Kunhya2:04

Tweets I regret?

Lex Fridman2:06

Or is it like that, how does the French song go? Regret nothing.

Jean-Baptiste Kempf2:09

Don't regret anything. No, it's because regrets are attacks on your mind.

Lex Fridman2:17

The following is a conversation all about FFmpeg and VLC with Jean-Baptiste Kempf and Kieran Kunhya. FFmpeg is an open source software system that is the invisible backbone behind YouTube, Netflix, Chrome, VLC, Discord, and basically every platform that touches video or audio on the internet.

It can decode, encode, transcode, stream, and play almost any video or audio format ever created. To me, it is one of the most incredible software systems ever developed, and it's all done by volunteers. VLC is also a legendary piece of software.

It is an open source media player that plays basically anything you throw at it, any format, any platform, no ads, no tracking. It has been downloaded over six billion times, and again, for me, it has been one of my favorite pieces of software ever with the most legendary logo, which I of course had to honor in this conversation by wearing the VLC traffic cone hat the whole time.

So again, above all else, thank you to the incredible volunteer engineers who put their heart and soul into this code that has been used and loved by billions of people. Thank you. And about the two great engineers and human beings I'm, uh, talking to in this episode, Jean-Baptiste is the president of VideoLAN and is a key figure behind VLC and FFmpeg.

Kieran is a longtime codec engineer, FFmpeg contributor, and the man behind the now infamous FFmpeg account on Twitter/X that I recommend everybody follow for the memes and for the unapologetic celebration of open source and great low-level software engineering.

Let me also say that it's inspiring and humbling that so much of modern civilization rests on software built by people who are not chasing fame or money, but are obsessed with the craft of engineering. We live in a world where billions of people consume video every day without ever thinking about the invisible machinery underneath it.

But that machinery matters. Open source infrastructure matters. It is one of the great examples of human beings quietly collaborating across borders to build something useful, durable, and elegant for the rest of us. And so this conversation is not just about codecs and media pipelines.

It is also about the deeper spirit of engineering and generosity that makes projects like FFmpeg possible. Again, I can never say it enough. Thank you. This is the Let's Freedom podcast. To support it, please check out our sponsors in the description where you can also find links to contact me, ask questions, give feedback, and so on.

And now, dear friends, here's Jean-Baptiste Kempf and Kieran Kunhya. So the legend goes VLC can open everything. What's the weirdest thing That you know that it can open

VLC & Decoding5:29

Jean-Baptiste Kempf5:43

You know, there is a ton of people who are using VLC to record VHS videos, right? Like, it's just like you plug it with a capture card and you can basically record VHS video.

Lex Fridman5:52

Well, how does that work?

Jean-Baptiste Kempf5:54

Basically, it's, you know, those type of capture card where you can put a Peritel in-

Lex Fridman5:58

Mm-hmm

Jean-Baptiste Kempf5:58

... or, or RGA, and you put that, and actually VLC can play those type of cards, and there is a module which allows to control directly some those VCR camcorders. We support DVD audios lately, right? We spent the, the summer working on DVD audio support, and like there is no, no one's making any DVD audio support.

There is a custom encryption schemes.

Lex Fridman6:19

What about Lucasfilm?

Jean-Baptiste Kempf6:20

Oh, yeah, and there is, of course, all the weird codecs support, game codecs supported by, by FFmpeg.

Kieran Kunhya6:25

The one Star Wars video game, the first ten-second opening sequence, someone has gone and implemented that and made sure that's bit exact on one disc that existed at one time of one little sequence in the game.

Jean-Baptiste Kempf6:37

A- and then funnily, there, there was a, at, at one VideoLAN conference, we made a competition to me- make the weirdest and most horrible file ever-

Lex Fridman6:44

Mm-hmm

Jean-Baptiste Kempf6:44

... and see if VLC could play it.

Lex Fridman6:46

What did it end up being? What's the file?

Jean-Baptiste Kempf6:48

It was an MKV file made by Derek-

Lex Fridman6:52

Yeah

Jean-Baptiste Kempf6:52

... which each of the frame was changing resolution, aspect ratio- ... rotation, and, and, and it was like-

Lex Fridman6:59

Did it work?

Jean-Baptiste Kempf7:00

Yes. And there was another one where the whole video was actually animated subtitles, right? SSA, right? So-

Lex Fridman7:08

Yeah. I remember that, yeah

Jean-Baptiste Kempf7:09

... each, each, this one was-

Lex Fridman7:10

And it-

Jean-Baptiste Kempf7:10

So each, each frame was a black frame, but on top of that there was a, a, a subtitle that was animated for each frame.

Kieran Kunhya7:17

There was a file that's a valid zip and a valid MP3 at the same time or something like that, so

Jean-Baptiste Kempf7:21

So yeah, we'd made a competition of stupid files.

Lex Fridman7:24

And it worked. It opened all of the stupid files.

Jean-Baptiste Kempf7:27

Yes.

Lex Fridman7:27

By the way, uh, for people who are not familiar, I am wearing a hat. Would it be fair to say this is the best worst logo of all time, the cone?

Jean-Baptiste Kempf7:37

Yeah, by far, right? The logo of VLC is so iconic, right? Like, we are a team with a small number of people, and, and the icon is known everywhere. I go to middle of nowhere in India or in China, people know the cone, right?

And, and 25% of the website traffic that comes to, uh, our main website is cone player, right? So, so many people don't know VLC, right? They know the cone player.

Lex Fridman8:00

That's the thing that Google for is cone player.

Jean-Baptiste Kempf8:02

Yeah. They, they go on Google and they, they put cone player and, and they download VLC, right? So that's iconic. A- and once we tried to change it as a joke, right? We said it was going to be a, a type of, um, uh, caterpillar construction, and, and we said that during April 1st.

Lex Fridman8:17

Mm-hmm.

Jean-Baptiste Kempf8:18

And we had around 10,000 emails saying, "No, don't change the logo," and so on, right? So it's so iconic, right? It's so distinctive, right? If you want to do a video player, you're going to put a play button on a TV, right?

And that's a YouTube, YouTube logo, right? It's unoriginal. This one is orange, right?

Lex Fridman8:34

Yeah.

Jean-Baptiste Kempf8:34

It's very bright. Uh, and, and it's weird.

Lex Fridman8:37

And it's ridiculous, and it's absurd, and it's hilarious. It becomes meme, and meme becomes culture.

Jean-Baptiste Kempf8:42

And you keep it. And you know about it. And you know that in 20 years, like, you still have, going to have the cones and remember, oh yeah, that was a video player.

Lex Fridman8:50

Yeah. And we'll talk about, you know, the, the mission of FFmpeg being a kinda the archival aspect of it. So you can think about 1,000 years from now we'll have all these videos that only VLC can open. Humans, human civilization has already destroyed itself multiple times, and the only thing that will remain is this like, you know, the, the cockroaches will be crawling around and it'll be the VLC logo-

Jean-Baptiste Kempf9:12

Hmm

Lex Fridman9:12

... with the ar- some of the archival footage that VLC can open. And the aliens will show up and they'll p-press play, and they'll get to see it all.

Jean-Baptiste Kempf9:19

Well, really, really hope so, right? But there is also so many memes where people say, "Well, I'm sure I can put a pancake inside my DVD drive and VLC will play it." And they-

Lex Fridman9:26

Can they?

Jean-Baptiste Kempf9:26

No, we tried. It doesn't. Um-

Lex Fridman9:28

Doesn't?

Jean-Baptiste Kempf9:28

But we actually have a video of us trying that. Uh, it didn't work.

Lex Fridman9:32

A codec for physical reality, I don't know what that would even look like.

Jean-Baptiste Kempf9:34

There was a guy who did that, right? He, he, he, he printed a small cone, right? Like the, the ones we, we distribute as goodies, and inside he put an RFID chip, um, which was his way of playing a movie, right?

Lex Fridman9:47

Yeah.

Jean-Baptiste Kempf9:47

And so he put this on a RFID player, and when he put that, it was playing like the last Star Wars and so on. So instead of having like DVD boxes, he had like VLC cones all around, and he plugged that a- and that was like physical objects.

Lex Fridman10:00

So the thing that we're talking about is everything around video codecs, video encoding, video decoding, video streaming, video player client that I'm wearing on my head, the entire ecosystem enabling free media. Uh, we'll talk about FFmpeg, we'll talk about VideoLAN, VLC, and all the other incredible video technology, uh, that is used probably by billions of people.

So JB, you're the lead developer behind the legendary VLC player. Kieran, amongst many other things, you're lead developer behind the legendary FFmpeg handle on Twitter. And, uh, both of you have spicy opinions, I would say. So today we wanna talk about FFmpeg and VLC.

Uh, for context, for people who are not aware, and I'm sure basically everybody listening to this have used these two technologies probably regularly without knowing it. So FFmpeg underlies basically most video on the internet, including YouTube, Netflix, Chrome, Firefox, of course VLC, and countless other video platforms.

It is estimated that over 90% of video processing workflows online and offline involve FFmpeg. VLC has been downloaded at least 6.5 billion times. But likely that number, 'cause it's impossible to really count the number, uh, is much higher than that.

Virtually any operating system supports virtually any media format, the limitation being it can't open pancakes. So, uh, can we just lay out some of the basics to, to help people understand what's involved in all of this? So when we press play On a video player like VLC, what happens?

What-- How does it go from the, the file or the stream to the pixels on the screen and the sound on the speaker? What are the big stages to be aware of?

Jean-Baptiste Kempf12:01

So there are several stages, right? The first stage is to get from an address, right, which is the cap- type of URL, to give you a byte of streams, right? So this would be, for example, HTTP, file, DVD, right?

You give the path to the media, and it gives you a, a stream of data.

Kieran Kunhya12:20

The stream needs to be cut up by what's known as the container, the demultiplexer or demux. Um, we'll try and keep the jargon light throughout this, but, um, it needs to go and start demarcating video and audio frames.

So it just gets data from the operating system blocks at a time and needs to start cutting these frames up into compressed data. It then needs to start doing simple parsing of the video frames-

Lex Fridman12:41

Mm-hmm

Kieran Kunhya12:41

... mainly to figure out whether that codec is GPU decodable or needs to fall back to software. We're very sort of used to assuming the GPU will play all of these things. There'll be hardware acceleration. I think it's up to forty-five percent of files are not GPU decodable.

So these need to be probed. They need to be detected. There can be variants of a given codec, some of which are decodable on the GPU. Different vendors of GPU might have different capabilities, so those need to be detected.

So if, if it's GPU-capable, you pass it through to the GPU black box. So now if there's a software fallback, that means in the beginning is, is to first do deentropy coding, so removing the mathematical coding of the bit stream.

So this uses capabilities such as Huffman coding or arithmetic coding to actually decompress the mathematical layer of the bit stream. We then need to start reading the syntax elements for intra prediction. So intra prediction are like still images of the video, so your iframes.

Lex Fridman13:40

Mm-hmm.

Kieran Kunhya13:40

So this works and operates in the spatial domain. So you do your intra prediction spatial domain. You, you have a residual because your prediction isn't quite matching that of reality. So you've made a prediction, but then there's a little bit left, and that's what's known as the residual.

This is stored in the frequency domain, and these are quantized to decompact their space. We then need to do the inverse transform to bring them back to the spatial domain and apply these residuals.

Lex Fridman14:06

So a lot of the process of the decoding is this thing is compressed.

Kieran Kunhya14:10

Yes.

Jean-Baptiste Kempf14:10

Yes.

Lex Fridman14:11

And you have to predict the highest quality thing that's supposed to go there. Iframe-

Kieran Kunhya14:16

Yeah

Lex Fridman14:16

... is the best representation you have spatially.

Kieran Kunhya14:19

Yes.

Jean-Baptiste Kempf14:19

Yes.

Lex Fridman14:19

And then you, uh, and then there's a lot of temporal compression that can happen depending on the codec, and then you're predicting. You're predicting what the reality that was captured in this rawest form.

Jean-Baptiste Kempf14:30

Yeah, because what, what people don't realize is that the compression on video and audio is one hundred times, right? Like, people don't realize how compressed we, we do, right? For audio, you move, you compress by, when you go from normal audio to MP3, you compress by ten times, right?

When, when you move to video, you need one hundred times, two hundred times, right? So you need to remove all the details, but that you don't care about. Because all the compressions that we do, and that's very important, people forget about that, is to be viewed by humans, right?

Lex Fridman15:02

Mm-hmm.

Jean-Baptiste Kempf15:02

So all the codecs, either for audio, mimic basically how your ear works, right? And, and a lot of things about, like, the, the, the response on the ear and same for, for your eyes, right? And, and so for example, on video, we don't work on RGB, right?

Everyone expect to work in RGB. We don't, right? We move to YUV, which is basically one is luminance, brightness, and the other are colors. And this matches your eyes, where inside your eyes you have the cones and the buttons, right?

With some of them look on brightness and more on, on the other on colors, right? So we need to compress a lot, and so we need to degrade. But in order to degrade, we need to match the human perception, and this is why it's so difficult.

And then we need to use the maximum power, mathematical power, uh, very complex technologies. Uh, we move to the frequency domain, as Kieran said. We do a ton of dequantizing and, and in order to get the best compression, but it still looks good.

Lex Fridman15:59

You're trying to compress in order to maximize the highest quality thing for human perception.

Jean-Baptiste Kempf16:05

That is correct. And that is correct. And this is very important, right? Compression is not like a zip, right? A zip, you have data in, you get data out, right? And you try with all the, the zip compression to arrive with, uh, uh, the limit.

Here we are degrading the signal, right? And so we need to degrade both the audio and the video signal in the best way possible. A- and we can do that, but it involves, first, a, a lot of theoretical knowledge about how it works, the eye works, but it, a lot of mathematical, uh, change, a lot of mathematical tricks, right?

For example, when you move to RGB and you do go to YUV, for example, what we do very often is that we scale down the resolution of the color compared to the brightness. And most of the time, and just this without compression, it divides the size by two.

But most people don't see it, right? Um, and so on and so on, right? Uh, and then you go to very complex mathematical, uh, change. So of course, uh, Fourier's transform, which de facto are not Fourier transform. They are like, um, discrete cosinus transform, but that's the same idea.

So frequency domain, um, we split the video by blocks, right? So that's why when it's wrongly decoded, you see those blocks and badly encoded, you see those blocks, a- and so on, to arrive to compression states that are insanely high, right?

And each generation of the codec is like thirty percent less-

Lex Fridman17:28

Mm-hmm

Jean-Baptiste Kempf17:29

... for the same quality, right? And this requires amount of power, um, of computational power that are huge.

Kieran Kunhya17:36

No, no, but you should, you should elaborate. It's thirty percent better, but an order of magnitude, perhaps, perhaps even two orders of magnitude more compression power. That, that's the big difference.

Lex Fridman17:46

What do you mean by compression power?

Kieran Kunhya17:47

Sorry, CPU power to achieve that level of compression.

Lex Fridman17:49

Oh, yeah. So and you have to be able to leverage the CPU and sometimes GPU, like you mentioned. And then we should mention that a lot of this programming Uh, is done at the lowest possible-

Jean-Baptiste Kempf18:01

Yeah

Lex Fridman18:01

... stack, whether it's C and of course, as, as the legendary-

Jean-Baptiste Kempf18:05

Yeah

Lex Fridman18:05

... Twitter handle, um, re-emphasizes over and over a lot of assembly.

Jean-Baptiste Kempf18:10

So what happens is globally is that you have an address, right? Which gives you, uh, with the operating system a stream of bytes, so a stream of data, right? And this is the first step. And the second step arise with demuxing, where you're going to separate audio, video, subtitle in type of different tracks.

And then on each of those tracks, you're going to decompress them, decode them, either audio with an audio codec, video to video codec, and subtitle to subtitle codec. Um, and once you've decompressed those type of things, you have raw images, raw, and then you're going to talk with your, uh, graphic card in your screen and display that.

And same for the audio, you're going to talk to your audio card, which then is going to go, um, in analog to, to your audio speakers.

Kieran Kunhya18:50

And everything we've just said in the past couple of minutes, every sentence is someone's lifetime's work. There are books about-

Lex Fridman18:57

Mm-hmm

Kieran Kunhya18:57

... every sentence. So the level of complexity, in many cases, is, is inordinate. You know, it's, it's, it's... Every sentence has thousands of people working on this-

Lex Fridman19:06

Mm-hmm

Kieran Kunhya19:07

... in, in the industry as a whole, books written about it. So there's a lot of detail, there's a lot of subtleties, there's a lot of both academic and practical realities, um, both of which matter.

Codecs & Containers19:20

Lex Fridman19:21

Uh, we mentioned codecs, but I don't think you mentioned, uh, containers. So what, what's the actual containers for some of the stuff we're talking about? So people are familiar with MP4, uh, MOV, MKV. So anyway, what, what are containers versus, uh, the thing that goes inside?

Jean-Baptiste Kempf19:41

So the container is what we call also the muxer, right? When I say demuxing, it means de-containerizing, right? So a- actually, if you look, mux, mul- multiplexer and demultiplexer, right? Mux and demux are those. And same, a codec is actually coder, decoder, right?

Lex Fridman19:58

Mm-hmm.

Jean-Baptiste Kempf19:59

Um, and, um, so containers are this collection of multiple tracks, right? So it's a, what normal people call the file format, but it's a bit more, um, um, subtle than that. But the most known one, of course, is MP4, but, uh, when I started, it was AVI, right?

AVI was the, the video format from-

Lex Fridman20:18

Mm-hmm

Jean-Baptiste Kempf20:18

... from, uh, Microsoft, and, uh, MOV, M-O-V, which became MP4, was a format from Apple. Um, in the open source community, uh, one of the person that is still active on VideoLAN is called Steve Lhomme and sta- started this Matroska format, which is, like, a bit more complex and, and, and more future, uh, proof.

Um, and, um, there are so many others.

Lex Fridman20:38

So, I mean, there's a, it's a pretty common thing, and m- maybe it'll even happen in this conversation, that people confuse container and the codec, right? So confuse MP4 and H.264, for example. Is that a horrible violation?

Jean-Baptiste Kempf20:52

No, it's not, because technically, the name of H.264 is MPEG-4 Part 10. Because MPEG-4 is actually a meta specification which has several things in it, right? There is the Part 2. Uh, so there is, like, audio codecs, right?

AAC, de facto is MP4 audio-

Lex Fridman21:12

Mm-hmm

Jean-Baptiste Kempf21:12

... something. There is, uh, actually several video codecs, right? Inside the MPEG-4 specification. One of them is MPEG-4 Part 10, called also AVC, called also H.264.

Lex Fridman21:23

Mm-hmm.

Jean-Baptiste Kempf21:23

Right? So it's completely the fault of the industry to, to, to, to make things difficult to understand. So that's very difficult so that people then don't understand why sometimes you talk about MPEG-4 Part 10, where you mean H.264, and why it's not MP4.

Lex Fridman21:38

So you can technically shove in all kinds of different codecs inside containers and horribly so.

Kieran Kunhya21:45

But broadly speaking, though, MP4 is understood to generally be H.264 plus AAC audio. Ninety-nine percent of the time, that's that, and that, the, the rest are de minimis, the small effects, you know, edge effects really compared to that.

So it's not the end of the world. There, there are people who do get annoyed by that. But also in reality, something like VLC, just to point out, the file may say .MP4, but it may be something completely different, and that's one of the challenges both FFmpeg and VLC have is the real world is a completely different place to a three-letter file format.

Jean-Baptiste Kempf22:18

And this is very important to say, right? Like, for example, in VLC and in FFmpeg, we discard the file format, right? We, we look into the file to understand what's in it, because so many people, like, they say, "Oh, it's a video, it should must be MP4," but technically it's an MOV or maybe it's a MKV, right?

So we analyze in real time everything that we have, and we don't trust-

Lex Fridman22:41

Mm-hmm

Jean-Baptiste Kempf22:41

... uh, the, the, the format.

Lex Fridman22:43

So what information does the fact that it's .MP4 give you?

Jean-Baptiste Kempf22:46

It helps, right? It gives you a hint, right? Just like, oh, it, it's finished by .MP4. I will start first by opening, probing it with the MP4 container demuxer to see, well, it should be that. But I don't trust it, and if I'm lost, I say, "Okay, maybe I'm going to try it."

So it bumps the priority of the module.

Lex Fridman23:07

So how do you get to, uh, just to take a bit of a tangent there. You know, the dumb thing is if you try the MP4, but it turns out it's a different codec than you would have expected, uh, most players just break there.

Jean-Baptiste Kempf23:22

Yes.

Kieran Kunhya23:22

Yes.

Lex Fridman23:23

So how do you not break? There's just, uh, philosophically, I'm sure there's a bunch of stumbling blocks along the way where you, y- it's easier to just break and stop, freak out. That's it. How does VLC not?

Jean-Baptiste Kempf23:35

This is why VLC is popular. Um, but the reason is because actually VLC was, is just a client of a streaming solution called VideoLAN from, from, from very long time ago, from the late '90s. And when you're playing video, which are on UDP, right, in network, they might be damaged, right?

So you don't trust your inputs, and this is very important into the security, is that you don't trust your inputs. So- Everything in VLC is prepared to, um, work with broken files.

Lex Fridman24:06

Mm-hmm.

Jean-Baptiste Kempf24:07

And it's a philosophical idea from the beginning, and everything is engineered into that. A-and it's a culture, right? And so, for example... And VLC became very popular on that because a long time ago when people were, uh, pirating content, um, which they do a lot less, uh, today, um-

Lex Fridman24:23

And none of us ever have done so, no

Jean-Baptiste Kempf24:25

... No, of course not. Um, the metadata to play some files like AVI is at, at the end of the file, right? And when you're downloading, you don't have that, right? So VLC was just like, "Hey, this file is broken, but I'm still going to try to interpret it."

And this was very useful.

Lex Fridman24:42

We hinted at the awesomeness of the various different stages. We hinted at the awesomeness of codecs, the depth and the richness and the complexity of everything involved there. What-- Let's try to define what is a video codec? What, what's involved there?

What, what does it mean to compress something? You already started to hint at it-

Jean-Baptiste Kempf25:00

Sure

Lex Fridman25:00

... but can, can we elaborate a little bit more?

Kieran Kunhya25:02

So there's a huge amount of redundancy in any video, uh, both spatial and temporal. And the point of any video codec is to remove this redundant data, use mathematical properties as part of this reduction process. So more often than not, using several orders of magnitude more compute to compress, because that's more costly versus both costly both financially and in CPU resources-

Lex Fridman25:23

Mm-hmm

Kieran Kunhya25:24

... versus the decompression. So it's asymmetric in that respect. Uh, often the case because compression is done once, but there could be lots of viewers of another file.

Lex Fridman25:33

Mm-hmm.

Kieran Kunhya25:33

So to take that information and compress it by 100X, 200X, removing redundant information and using mathematical properties to make that small, but also have properties such as error resilience. So as, as JB suggested, VLC in the beginning was, was used to play UDP network feeds, and UDP network feeds lose packets.

And so some of the design goals of a codec is also to be recoverable.

Lex Fridman25:58

Mm-hmm.

Kieran Kunhya25:58

You, you need to actually be able to join a stream. It's not necessarily a file. You need to join, get on the decoding process, and start decoding.

Jean-Baptiste Kempf26:06

A-a-and, and to give a more image to, to, to, to people who are not familiar, right? Like, when you're going to see any type of movie, right? You're going to see the camera is going to pan, right, and, and, and travel.

And you realize that, for example, all the background is the same from, for like a minute, right?

Lex Fridman26:23

Mm-hmm.

Jean-Baptiste Kempf26:24

Or 30 seconds, right? So you can reuse the cloud that you see, uh, uh, on the background, you can reuse that from a frame to another, right?

Lex Fridman26:31

Mm-hmm.

Jean-Baptiste Kempf26:31

And so it's, gets the more, the more memory you have, the more power, the more comparisons you can make, right? And so the more compressed you can be. And most of the modern codecs are basically doing that.

Lex Fridman26:45

So just to make it even more explicit. So what is video? Video is a bunch of pixels, often RGB. You have three values, and you have a grid of pixels, and you have, let's say, 24 or 30 or 60, uh, frames a second, and you just have all these pixels repeating and showing different stuff-

Kieran Kunhya27:08

Mm-hmm

Lex Fridman27:09

... 30 times a second. And so the question, the philosophical, the technical question is, how can I compress all of that, store all of that at 100X?

Kieran Kunhya27:21

Yep.

Jean-Baptiste Kempf27:21

Or 1000X, right?

Lex Fridman27:22

1000X.

Jean-Baptiste Kempf27:23

The, the target is 1000X, right?

Lex Fridman27:24

And the goal is when you say redundancy, what is redundant? Meaning stuff at best that humans wouldn't notice if it was missing.

Jean-Baptiste Kempf27:35

So for example, you have a picture of a cloud, right? And from the next frame, they're still going to be the same cloud, so it's redundant. You could just put it once and not do it, right? Or you have a, a, a black background behind me, for example.

The black is the same on the whole picture, right? So you can say, "Well, you know, in this picture, take the pixels that you have on the top left and the one on the top right. I'm not going to give the value.

I'm just going to tell you it's the same at the top left." And then you can say for frame one, um, reuse something from the previous frame or the previous, previous frame, and so on and so on, right?

So th- you could basically, it's unlimited, but then it's limited in terms of memory or in terms of compute power. Because, for example, if you need to compare pixels on 200 frames in the past on 4K resolutions, it's a huge amount of compute.

Lex Fridman28:26

And then when you're showing it, you have to do the decompress of all of that. So you, is it the codec, the, has the encoding and the decoding is a, is a coupled process that you're developing?

Jean-Baptiste Kempf28:38

Yes, exactly right. And those are two different, um, uh, trade-offs, right? Are you going to compress more? Uh, but then it might be more difficult to, to, to decode. Um, are you going to comp- to make it a codec that is more complex to encode and easier to decode?

Are you going to make a codec that is easier to encode because you need to be fast, but then the, the client side, the, the player is going to spend more time? That's why you have so many different type of codecs, is that it's not always easy.

A-and to make it even more complex, modern codecs like AV1, AV2, or VVC are actually not codecs. They are a collection of tools, right? There are multiple tools, multiple codecs in the same codec to, depending on the image, get the more compression.

Kieran Kunhya29:22

So just to elaborate, codecs like AV1, VVC have a much wide, have a wide audience. It could be a screen share content, it could be video, it could be animation. All of these require different coding tools. So what happens these days is a collection of tools are put in and called AV1 and called AV2, called VVC to allow for different use cases.

So you may be on Zoom and sharing your PowerPoint, and then you need to show the audience a video. That codec needs to start changing its tool set depending on the content to compress in a different way.

Lex Fridman29:59

And like you said, there's a, a bunch of incredible engineers behind each part of that, each part of the tools that make up AV1, for example.

Kieran Kunhya30:06

Sure.

Lex Fridman30:07

Uh, so we've, uh, kind of danced around it. We talked about VLC, the logo, the hat. Uh, let's talk about FFmpeg. What, what is FFmpeg exactly?

FFmpeg30:07

Jean-Baptiste Kempf30:18

FFmpeg is basically the low-level libraries for codec, so compressions and decompression, muxers and demuxers, and filters. It's-- The core is this, and then you have a several tool which allow you to create a type of pipeline to process any type of video files.

Uh, and it's used as a library absolutely inside everything from VLC to Chrome to your smart TVs, to basically any video y- that you see online, um, you usually use FFmpeg. And FFmpeg in it has all those type of tools, and sometimes depend on other libraries like x264, uh, libvpx, and others, right?

So, so it's really now the de facto, um, tool to process images.

Kieran Kunhya31:06

From a philosophical level, I think it's incredible that your home videos, your, your grandmother's home videos, and trillion-dollar corporations effectively are on a level playing field using the same technology stack.

Jean-Baptiste Kempf31:19

Mm-hmm.

Kieran Kunhya31:19

Uh, it's, it's-- it wouldn't be a surprise, you know, these big companies just have 3,000-line FFmpeg commands.

Jean-Baptiste Kempf31:27

Mm-hmm.

Kieran Kunhya31:28

There are some that use the API, but there are some that just have long command lines.

Lex Fridman31:32

So yeah, there's a bunch of tools, like literally command line tool, FFmpeg, of course, FFprobe. There's libraries, libavcodec, libavformat, libavfilter. But the FFmpeg on the command line-

Kieran Kunhya31:47

Yeah

Lex Fridman31:47

... is, like, legendary because you can cut-- Like, there's so many parameters. You can customize everything to hell.

Jean-Baptiste Kempf31:54

It's a language. It's an actual language.

Lex Fridman31:55

It's an actual om- yeah, you could think of it as a programming language.

Jean-Baptiste Kempf31:58

Yeah, of course, I'm sure. Because, so most of the people, they're going to take FFmpeg file in, file out, and specify the format, right? But you can-- We've seen thousands of characters, and we've seen also, like, people, like, doing, um, programming, um, uh, generation of command lines to, to, to make FFmpeg.

There is a ton of people who are using AI to generate command lines for FFmpeg because you have no idea what it is. But you can do, specify so many filters, right, uh, on command line, right? So, um, FFmpeg is this collection of toolbox for multimedia processing that everyone, everyone uses, and everyone that is watching your videos are also using, right?

You, you're on YouTube. Well, it's FFmpeg on, on the client side. Well, the, your server side, on the server side. The client side is probably Chrome. Well, you're using FFmpeg also.

Lex Fridman32:47

Mm-hmm.

Jean-Baptiste Kempf32:47

And, and you're using OBS to record. Well, it's FFmpeg, right? You're using a ton of important, like, big box, professional boxes. Well, it's very possible that inside some part of FFmpeg is running.

Lex Fridman32:58

I mean, there, there's like so many, just to give people an idea, like I, I use FFmpeg a lot on, on everything. Just trivial stuff like, uh, take a video, add an intro video and an outro video, and fade one into the other like, uh, what is it called?

Dip to black, like where it, it dips and then shows the next video and does the same thing with audio. Uh, there's like a cross dissolve of the audio. It's a quiet, it quiets the audio and makes it loud again.

And then there's a bunch of stuff like, uh, showing the captions on screen hard, like baking the captions in. You can customize the font. You can do all kinds of layering of audio and video. There's a million things and, of course, all of that works like magically with basically any codec.

Like anything you, you can shove in on the audio and the video side, it works.

Jean-Baptiste Kempf33:53

But it's, it's like if you, if you look at, for example, you can do things that you would do with Adobe After Effects-

Lex Fridman34:00

Mm-hmm

Jean-Baptiste Kempf34:00

... in command line on FFmpeg, right? It's, a- and it's very interesting because, for example, for, for, for imagings, there is not such tool. There is a few tools, but not with the breadth of FFmpeg.

Lex Fridman34:11

So ImageMagick has a similar kind of-

Jean-Baptiste Kempf34:14

Yes, but you will not-

Lex Fridman34:14

... spirit, but it-

Jean-Baptiste Kempf34:15

... do some filters, complex filters.

Lex Fridman34:17

Yeah.

Jean-Baptiste Kempf34:17

You don't have the equivalent of Photoshop-

Lex Fridman34:19

No

Jean-Baptiste Kempf34:19

... in command line, right? But you, for video, you have FFmpeg in command line.

Lex Fridman34:23

Yeah. It's incredible. I mean, it's like an, it's an example of a thing when a bunch of great people get together and they get a vision, and they stick by that vision for many years, which is incredible.

Jean-Baptiste Kempf34:34

And the vision behind, and the same for VLC and FFmpeg, is that we make every- everything that is very complex easy to use for the normal people, for everyone, right?

Lex Fridman34:46

Mm-hmm.

Jean-Baptiste Kempf34:46

Our goal is to make something that is insanely complex technically and make it easy to use, right? And, and people, they use VLC, they drop a file. They don't realize how complex the file is, but they, they play it.

Or, or people put any type of thing inside FFmpeg with complex filters, and it just works like magically, right?

Lex Fridman35:04

Mm-hmm.

Jean-Baptiste Kempf35:04

And people... And this is our mission, right? Make very complex things.

Kieran Kunhya35:08

We wouldn't be here and, and you wouldn't be here if this required, you know, a traditional television studio setup.

Jean-Baptiste Kempf35:16

Mm-hmm.

Kieran Kunhya35:16

It, it's tools like FFmpeg that democratized this. The, the, the podcast and streaming revolution, the YouTube revolution-

Jean-Baptiste Kempf35:22

Mm-hmm

Kieran Kunhya35:23

... was caused. You know, FFmpeg was a big player in that because it, it democratized this technology that was once in the, in the '90s, for example, you needed equipment that cost hundreds of thousands of dollars to do compression.

It was the size of a car, and now everybody has that at almost an exact level playing field, and that's something that's so remarkable.

Lex Fridman35:43

It gave voice to a lot of people, and we, uh, just to clarify, we say you, you wouldn't be here, not the human, but the podcast.

Kieran Kunhya35:49

The podcast, sorry. You, you as the... Sorry.

Lex Fridman35:51

I would still... VLC did not have anything to do on a biological level- ... at creating me as a human.

Jean-Baptiste Kempf35:57

But, but it's like a, you realize also everything move from text to images and images to video, right?

Lex Fridman36:02

Yeah.

Jean-Baptiste Kempf36:02

Look, look at social networks. Video is everywhere. It's the most powerful, um, medium there is, right? And, and when you see Shorts and, and Ins- Reels and, and TikTok, right? It's amazingly powerful to, to, to give... Video is amazing for that, right?

But the complexity is important.

Lex Fridman36:21

It's what people don't realize. I mean, this is really It gave power to the individual all across the world. That's real freedom. And I think, I can't believe it, but we still haven't mentioned the actual obvious thing for people who are not familiar, which it's open source, and there's a open source community of users and developers behind it.

So it's really, it's a movement. So, like, we'll talk a bunch in a bunch of different ways about the community behind it. But, uh, can you speak to the open source element? So when we say what is FFmpeg, it's an open source project.

Jean-Baptiste Kempf36:57

Yeah. So FFmpeg, VLC, x264, VideoLAN, everything we do is fully open source. And for the people who don't understand how open source is, my usual analogy is about a chocolate cheesecake, right? Um, usually for you, when you want to buy your cheesecake, you go to a bakery, they give you the cheesecake.

Um, the other one way of having a cheesecake is have your grandma give you a recipe of how to make that. When we do open source, we give you the chocolate cake, and we give you the recipe to actually remake the same cake, but at the same times tell you how to build the oven and also how you're allowed to modify the recipe and resell it to someone else.

Lex Fridman37:35

Yeah.

Jean-Baptiste Kempf37:36

And this is because software is just a very long recipe of small instruction. Computers are not very clever. They go very, very fast. So a normal program has tens of billions of instruction instead of the tens when you have your chocolate recipe.

So a lot of the software industry was about selling software, like, like where you just have like the final cheesecake. In open source, we make- we give you everything, and that manage to get a lot of people work together, right?

Because then you decide that you're going to make the best program, the best recipe for video, and you create communities in, um, FFmpeg. Since the beginning of FFmpeg, probably two thousand to three thousand-

Lex Fridman38:17

Yeah. In the thousand, yeah

Jean-Baptiste Kempf38:17

... people have contributed from, from the beginning, right? And then it's exactly like the Linux kernel, right? The Linux kernel has probably ten thousand people contributing everywhere, and they get together, well, mostly online, right? So they v-virtually get together to create the best tool for something.

And on FFmpeg and VLC, it's just like, well, this codec doesn't work, so I'm going to work on the codec, and I'm going to add the support for this file inside FFmpeg, so it will be beneficial to everyone.

Because again, we work for the greater good. We work for everyone, and that is what open source is.

Lex Fridman38:55

And we, we should mention, depending on the licensing, uh, you could probably build a billion-dollar, maybe even a trillion-dollar company around basic- as a wrapper to-

Jean-Baptiste Kempf39:07

Well, yes-

Lex Fridman39:08

Yeah

Jean-Baptiste Kempf39:08

... people do.

Lex Fridman39:09

Yeah.

Jean-Baptiste Kempf39:09

People do, right? Uh, there was a lot of, uh, um, problems with, uh, mostly, uh, cloud providers who are basically running some open source tools, um, in, in the cloud and just give you, uh, the API to access to that.

And there was a lot of, uh, um, databases like Mongo or Elastic who changed their license in order to avoid those type of, uh, of scenarios.

Kieran Kunhya39:32

This is a question we get a lot in FFmpeg is, "Why don't you do that?" And you can't. We have, we have thousands of contributors, some of whom aren't even alive anymore.

Lex Fridman39:40

Mm-hmm.

Kieran Kunhya39:40

It, it- You would need all of their agreement to do that, and, and JB will go maybe a bit later and talk about how challenging that process was in VLC to do the re-licensing.

Jean-Baptiste Kempf39:49

The license is a social contract in terms of Rousseau de facto of the community. The community does not agree on much beside the license. People go around, discuss around because of the license, and that also allow those license fork, right?

Sometimes the community splits, but it's possible because of the license and to merge back.

Lex Fridman40:12

Mm-hmm.

Jean-Baptiste Kempf40:12

And we've seen that so many times, right? GCC and GC, um, and EGCC in the past. Uh, we have seen, for example, all the web browsers, right? They started as web, like KHTML, which became WebKit and then which becomes Blink, right?

So open source license is like the, the core of the community and, um, people are coming from all around the world, very different type of, uh, religion, um, political borders. They, they work in the same way on a project to solve a specific problem, and the specific problem we're working on is to make multimedia easy for everyone.

Lex Fridman40:50

Uh, looking it up on Perplexity here, looking at the different open source licenses. Most major open source licenses fall into two buckets: permissive, very few conditions, and copyleft, share-alike requirements for derivatives. Below is a brief practical summary of the main ones you'll see in the wild.

MIT license, BSD, ISC, uh, Apache, uh, GNU GPL, GNU AGPL. Where's LGPL? Yeah, LGPL. Let's see. There's the Mo- the Mozilla Public License. There's Eclipse Public License. It goes on. There's a lot of variety. I mean, I think, I think the really popular ones is MIT, GPL, LGPL-

Jean-Baptiste Kempf41:34

Yeah. And BSD. BSD

Lex Fridman41:37

... and BSD, Apache. Sometimes you'll see-

Jean-Baptiste Kempf41:38

Apache as well. Unlicense

Lex Fridman41:40

Unlicense. That's an option. Attempts to dedicate code to the public domain with a fallback permissive license.

Jean-Baptiste Kempf41:44

There are many licenses for many different thing. What people don't understand that public domain is something that doesn't exist worldwide, right? So it's, um, all the open source licensing u-use the copyright law, right, the international copyright law, in order to give rights on how you use the software or how you modify.

It's de facto a, a copyright license contract that you give to the end user or to the developer. And so you have like the first one, which are basically very permissive, MIT, BSD. You give the code and basically you do whatever you want, right?

You take it, you want, you modify, you do what you want. Um, and this is, uh, popular for, uh, uh, JavaScript and the type of, uh, BSD operating system.

Lex Fridman42:29

So some of them, one, one of the parameters is whether they require attribution, meaning if you use the code, you have to say-

Jean-Baptiste Kempf42:36

Yes. So in those type of permissive license, some you need to say if you use it, which is called attribution, and some you don't. And then there is a The other part of license which are copy left, where you need to give back to the community your modifications and with different string attached.

Um, some weak, uh, copy left license, like, um, the Mozilla Public License, to some which are a bit stronger, uh, like a GPL, or even very strong like AGPL. So all of those are different, um, type of licensing that depends on what your goal are and how you want to structure your community, which is why I spoke about social contract, because this is very important to understand.

Um, FFmpeg and VLC are mostly GPL or LGPL. Uh, the Linux kernel is GPL, uh, but Android is Apache. Uh, a ton of, uh, JavaScript framework that are using are mostly MIT. Um, all the BSD kernels, OpenBSD, NetBSD are of course BSD.

Um, and, and so the-- it's philoso-philosophical change on how you want people to contribute back basically.

Lex Fridman43:45

Mm-hmm. So there's, uh, I think you talked about that, uh, you've moved at one point from GPL to LGPL on certain parts of the project. What, what... Can you describe the difference between the two, and what does it take to move to, I guess, a more permissive-- So that direction is more permissive.

LGPL is more permissive than GPL.

Jean-Baptiste Kempf44:04

Yeah. So you have to realize that you can always go from more permissive to less permissive, right? Because of course, those license are basically statement. So if you restrict, you can always restrict more, right? So i-in a GPL project, you can take MIT code, but you cannot do the opposite, right?

Because there are more constraint to, to match. Um, uh, indeed, in fact, I changed the core of LibVLC, which is the engine of VLC-

Lex Fridman44:33

Mm-hmm

Jean-Baptiste Kempf44:34

... from, um, GPL to LGPL. Uh, and there were two reasons, uh, to do that. The first one is that so people can use, um, the VLC engine, LibVLC, into third-party applications. So a lot of applications which are playing video on your phone or on your tablet are actually VLC engine in it, which is calling FFmpeg in it.

Lex Fridman44:55

Yeah.

Jean-Baptiste Kempf44:55

Um, so that was one of the way to create, uh, one of the company I created, which is doing consulting and integration of those types o- of application where you integrate VLC into third-party solutions, um, like inside game engines or stuff like that.

With GPL, you couldn't do that because that means you needed to open source everything, and those are, uh, for a lot of, like, commercial companies who don't want that.

Lex Fridman45:18

So you can create a company with LGPL, you can create a company around it.

Jean-Baptiste Kempf45:22

Yes.

Lex Fridman45:23

You can do a commercial thing, you don't have to open source it.

Jean-Baptiste Kempf45:24

Yes.

Lex Fridman45:24

So that's a big, big leap.

Kieran Kunhya45:26

So you could play video in your game.

Jean-Baptiste Kempf45:27

Yes.

Kieran Kunhya45:28

The pro- the problem is I, I'm a game developer, and I want to play some videos-

Jean-Baptiste Kempf45:32

Mm-hmm

Kieran Kunhya45:32

... and I don't want to be forced to open source the entire game just to play those videos. So that's where the, the consulting business, the LibVLC LGPL-

Jean-Baptiste Kempf45:40

Mm-hmm

Kieran Kunhya45:40

... allows you to do that. The LGPL, the library GPL as it used to be known, allows you to do that.

Jean-Baptiste Kempf45:45

And FFmpeg is exactly desi- the same. It force-- LGPL forces you to give back what you change on this component, this-

Lex Fridman45:52

Yeah

Jean-Baptiste Kempf45:52

... library, which is why it's l-library GPL.

Lex Fridman45:55

Mm-hmm.

Jean-Baptiste Kempf45:55

And so you can use FFmpeg as LGPL into, like, any type of application, even non-open source, but you need to g-give back the modification you did on FFmpeg. Same on LibVLC.

Lex Fridman46:07

Is it limiting from an open source perspective to go GPL? Because if you-- if your, uh, library, if your code is GPL, it means you're not... You, you, you're basically discouraging companies from building a business around it.

Jean-Baptiste Kempf46:23

Yes.

Lex Fridman46:23

Right? Is that... Is that fair to say?

Jean-Baptiste Kempf46:24

It depends on... It depends on the company, but the company whose business model requires the source, the, the application to be closed source, yes, it's limited. So that's why, for example, I moved to LGPL. The second reason, um, is a, a bit more obscure, is that the, the terms of condition of the, uh, app store, the Apple App Store for iOS makes it very complex to have GPL application on it, while it's easier to have LGPL applications on it.

So VLC on Windows and on Mac, uh, and on Linux is GPL. The core is LGPL, but on iOS, uh, the iPhone version and the Apple TV version is a type of different license called the MPL. Um, and yes, I, I went and changed the license and it was a long story.

Lex Fridman47:09

Yeah. So I, I think basically to change the license you have to contact all the contributors.

Jean-Baptiste Kempf47:13

Yes. I-I-It's very important to understand that open source projects are what we call in the US copyright, uh, law joint work or in, um, civil law, um, collective works or collaborative works. Is that you work all together in term the same goal, and then it creates one software, which is one release.

Um, but the copyright is kept by all the individuals. Some open source project don't do that. They force copyright assignment, but this is not what we do. We're communities. So everyone has basically copyright on what they changed. Um, and this copyright stays even if at the end your, your contribution was deleted because the new contribution was based on your previous one, right?

So if you want to properly re-license, you need to find all the contributors. A-And at that time, I had to contact more than three hundred and fifty people. And sometimes, well, they're just an email, right? So it's-- you need to actually track down.

I, I actually like travel to some place to go someone that I was like, sorry, that I'd found online to see a... to go to their job and say, "Well, you l-licensed that. Can you-- Do you want to change from GPL to LGPL?"

Most of the times they don't even care. They wanted to help VLC. But also it, it brought me to very complex situation. I arrived to the work of a, a person who was a factory vo- worker.

Lex Fridman48:31

Mm-hmm.

Jean-Baptiste Kempf48:31

Um, and I said, "Well, I need to you to sign that," because it was his son who died who actually wrote the code, right?

Lex Fridman48:40

Mm-hmm.

Jean-Baptiste Kempf48:40

So I had to explain all those type of open source meaning, and no, I was not a company trying to rip out the two line or five line that that guy did-

Lex Fridman48:49

Mm-hmm

Jean-Baptiste Kempf48:49

... but was useful, and the whole community agreed on that, and he had no idea I was a factory worker. This com-- A-And I was a lot younger, right? Like, uh, it was m- fourteen years ago, and Like, like I was almost in tears, right?

It's ve-very difficult, right? We are talking about lives of people and he explaining, and we went talk about the photo of this guy, right? So it's important to do it right and to do it correctly. Um, but yes, that means tracking down everything because every contribution works.

Kieran Kunhya49:18

Mm-hmm.

Jean-Baptiste Kempf49:19

There are some project who don't respect that, and we do re-licensing a bit, like aggressively.

Kieran Kunhya49:24

Mm-hmm.

Jean-Baptiste Kempf49:24

But as I said, it destroyed the whole heart of the community because it's-- we o-only agree on the, on the license, so that's important.

Kieran Kunhya49:31

I would emphasize the community is such a wide-ranging group of people. There's people in a Syrian war zone with electricity part-time. There's, there's all people from all walks of life-

Jean-Baptiste Kempf49:44

Mm-hmm

Kieran Kunhya49:45

... rich, poor, young, old. Um, so it's quite remarkable to get, you know, a group of people aligned on something. And that's an achievement in itself.

Lex Fridman49:56

Yeah. It's incredible. And a lot of them are introverts, so you coming, coming to find them and getting them and getting them to answer an email might be quite, quite difficult.

Jean-Baptiste Kempf50:06

Most of us are introverts, right? You, you need to be more precise. You have extremely introverts, extremely, extremely introverts and introverts, right?

Lex Fridman50:13

Yeah.

Jean-Baptiste Kempf50:13

It's just like a whole spectrum of different people. It doesn't matter. The important is, is your code good?

Lex Fridman50:19

Mm-hmm.

Jean-Baptiste Kempf50:20

Is your code great? Is your technology great? We care about excellent code. We don't care who you are. Sorry, it's just like we have no idea to check. We cannot check, right? Like, maybe you're a dog. I don't care, right?

I don't care where you come from. I need to look at your code. And this is important because people don't understand that, and they come to the community and send them some patches, and they get rejected, and they don't like that because, I mean, you're just like, "Sorry, it's not up to our standards."

"Oh, yeah, but I'm engineer at this very large company in, in, in, in Italy, in Germany, in the US." We don't care. We care about the quality of your code because this is what defines our community, and which means that we have a lot of people who contribute who are some very different backgrounds and, and, and very introverts, sure.

But that's okay, right?

Open Source51:07

Lex Fridman51:08

So one, one of the legends of the community is, uh, of course, Linus Torvalds, who, uh, created Linux and is a longtime maintainer of the Linux kernel. As the legend goes, he can be pretty harsh on this meritocratic process of reviewing the code and saying it's not good enough.

Can, can you just speak to, to the legend of Linus Torvalds?

Jean-Baptiste Kempf51:30

Linus is one of a kind, right? And, and I would even go and say that what he did on Git is more interesting than what he did on the Linux kernel.

Lex Fridman51:40

Mm-hmm.

Jean-Baptiste Kempf51:40

He's very harsh, but what people don't see is usually when he's harsh to, it's people who are maintainer of part of the kernel, right? So they know him, right? So he's not very harsh like that to everyone. The thing is, what he created in his room is basically powering every server online, right?

Even at Microsoft cloud called Azure, I'm quite sure seventy, eighty percent of the servers are running Linux. All your Android phones are running Linux. What he did, um, with the power of open, of open source, sure, is amazing.

Um, and yes, the quality of the Linux kernel is very high, and yes, it's difficult, but we cannot compromise on that. We cannot compromise on quality because in the end, and you have to understand that, is the core community of VLC is five people.

The core community of FFmpeg is ten to fifteen, and we are the ones who are going to maintain your code, right?

Lex Fridman52:38

Mm-hmm.

Jean-Baptiste Kempf52:38

Because one thousand contributors in the timeline and just ten staying, it's one percent chance w- that someone comes and stays. One percent. So you will have change of job, change of wives, you have children, you have accident in life, you're going to change jobs, whatever.

You're not going to s- come back. It's most li-likely. So we are the one going to ma-maintain your code. It needs to be maintainable. It needs to be excellent. And yes, sometimes that means that you need to rework your work because it was good, but it's not excellent.

And we need excellence because we are very few to maintain something that is critical for the whole.

Lex Fridman53:16

But we should also mention that there is some, some spiciness, some harshness to the language that's sometimes used when you're, uh, keeping this high bar of excellence. Uh, is there something to say to that?

Jean-Baptiste Kempf53:27

It, it's true, right? Um, it's also the fact that, for example, what we're doing is low level, it's extremely technical. Uh, you get into this community, the tone gets, um, very like a type of... It's a subculture, right?

So people who arrive from the external are basically not known to the subculture. Most of those people around FFmpeg and VLC, we do VideoLAN DevDays, VDD, uh, every, every year. They are so fun in real life, and they love it.

Lex Fridman53:55

Mm-hmm.

Jean-Baptiste Kempf53:55

But it's true that you're online and sometimes, like, the, the tone, you don't realize how it is. Uh, but that's okay.

Lex Fridman54:01

It's a culture. I mean, you, you get this in the gaming culture. There's pretty harsh, intense, the way people communicate, and it's-- everyone understands that the way you show love and respect just looks different in different communities. Sometimes people...

It de- it depends. If it's a book club, usually people are going to be much sweeter. If it's an open source project that's very high stakes and used by millions of people-

Jean-Baptiste Kempf54:25

But it's very not often insults l- that you see, for example, in the gaming, right? Uh, so Linus' tone is a bit unusual even for the open source community. It's more like, it's more harsh on the result, saying, "No, this is not good.

This is crap." Th-those type of things that you will see.

Lex Fridman54:40

Try not to make it about the person, make it about the code.

Jean-Baptiste Kempf54:43

Yeah.

Kieran Kunhya54:43

Yes. It's very, very matter of fact, and I think you've got to look at it in terms of, you know, the famous FFmpeg is developed almost entirely by volunteers, and that's true, and you've got to imagine someone's done a hard day's work at their day job.

They come home, you know, terseness might be a thing, you know, it... And, and that's not something to take personally

Lex Fridman55:02

You're tired, you're busy, but you still care about this open source stuff.

Jean-Baptiste Kempf55:06

Yeah.

Lex Fridman55:06

But you may not be able to explain and, and handhold someone on every subtle detail.

Jean-Baptiste Kempf55:10

And also you have to realize that most people don't speak English as native language.

Lex Fridman55:16

Mm-hmm.

Jean-Baptiste Kempf55:16

A- and, and this is especially for, for open source projects like FFmpeg and VLC, which are mostly centered out of Europe. Sometimes like, um, people who are from the US or, or just like are very not happy about the tone, but most of the time it's also like they don't know better, right?

It's difficult. The language is... English is a difficult language. There is so many subtleties and tones and so on that you don't have, right?

Lex Fridman55:40

Mm-hmm.

Jean-Baptiste Kempf55:41

So, um, often it's also difficult in those type of community about like different cultures and languages.

Lex Fridman55:46

So as the legend goes, JB, you, uh, repeatedly turned down millions of dollars to, uh, keep VLC open source free for everyone without ads. So take me through the reasoning behind that decision of leaving millions of dollars on the table.

Jean-Baptiste Kempf56:07

Yeah, that's like almost a meme, right, on, on Reddit or-

Lex Fridman56:09

There literally is a meme on Reddit.

Jean-Baptiste Kempf56:11

9GAG and yeah, yeah, I see there's-

Lex Fridman56:14

You

looking like a wizard in the, in the VLC hat on Reddit. "This is, uh, JB, the creator of VLC media player. He refused tens of millions of dollars in order to keep VLC ads free. Thanks, Jean-Baptiste Kempf." You can even summon him on Reddit.

Jean-Baptiste Kempf56:34

Yeah. And usually if you see, right, it's usually like people tag me, right? And, and- ... and then there is me, and then like I say, "Good morning."

Lex Fridman56:40

Good.

Jean-Baptiste Kempf56:40

I got 24K upvotes, which is great, right? My karma on Reddit is amazing. At least on that account. Um, so the question is, needs to be answered first, it, what is a story about VLC, right? Um, because yes, this is true, I refused dozens of millions of dollars, yes, several time.

Yes, I could be a multimillionaire and be somewhere on the beach. Um, but I did not do it because I thought it was not moral, and it was not the right thing to do. And this is very important for myself, is to be like, I work for the greater good, I work for people, and I don't want...

It's not just by my, by myself. But the reason is also because I, I did not feel that I'm completely legitimate to do that, and let me explain to you why. VLC story is a very weird story. In France, we have university, and we have a type of top colleges, um, and those top of excellency schools are engineering school, business schools, and basically lawyers a- and medical, right?

But they're outside of university, and in order to enter those, you spend two years working like crazy math, physics to enter those best engineering school. One of the school is called the École CentraleParis. It has changed name since, but it was called the École CentraleParis.

And because it was Centrale, they had to move it because it was too small after the World War II, and, and they moved it, they wanted to move it to the central of France in a place called Clermont-Ferrand.

And the alumni decided that this was not okay, right? It is a, the school that Eiffel, right, the, the one who did the Eiffel Tower, attended to, right? So they said, "No, no, we are amazing, great school. We cannot do that."

And so they bought a piece of land south of Paris, uh, very near Paris. Um, and it was a campus managed by a nonprofit of the alumnis, okay? Because of that, everything on the campus was managed by student.

M- the university did nothing, right? So, uh, radio, uh, TV, uh, supermarket, uh, library, um, defining who was going t- into which rooms. Um, everything was managed by the student.

Lex Fridman58:48

That's amazing. That's an amazing experiment, that it all, all didn't go to hell quickly. It somehow flourished.

Jean-Baptiste Kempf58:56

It worked great, and I learned so much, um, in my life doing those side activities, right? Because you're, you're 22, and you need to run your campus, else you don't have electricity, right?

Lex Fridman59:05

Mm-hmm.

Jean-Baptiste Kempf59:05

So you care about that, right? But anyway, in the '80s, um, they did a full experiments of deploying a network, uh, mostly sponsored by IBM and 3Com, which was a token ring network. So token ring is something that probably almost no one knows about anymore.

It's a networking technology where you don't have routers, right?

Lex Fridman59:27

Mm-hmm.

Jean-Baptiste Kempf59:27

Everyone is linked. Um, it's type, like really a ring, and when you want to send a message, you talk to your neighbor who's going to put the message to the next one, who's going to put the things to the next one, in terms of ring.

The issue with token ring is, of course, is that it's very slow because every computer on the network needs to open the message, see if it's okay. Is it for me? No, it's not, and then send it back, like a token which is traveling around the ring.

In the '80s, you're doing some Telnet and sending mails as university. That's okay, right? But starts the '90s, a- and the '90s, um, and start video games, and when you have li- high latency in video games, basically you die, right?

So in 1994, 1995, around Doom and Duke Nukem coming around, they want a faster network. So the students go and see the university and say, "You know what? We want a faster network. We need to work," which, also play video games.

Um, and the university tells them that basically, "Oh, I'm sorry. We cannot help you because you understand the campus is not ours. You manage it, so do something. And you should see some basically partners of this c- university and basically go away."

And they go, and they actually go and see, um, the, the, the CIO of, uh, Bouygues, which is a large, uh, French company and who's doing some TVs, uh, in France. And he says, "Well, you know what? The future of video is satellite."

Well, today we know it's not, but at least it was a good idea. In 1995, the first of satellite d- dish, and he says that instead of having like one satellite dish and a big decoder for each of the students, which are 1,500, what about you build, like you put a n- Enormous dish and only one decoder, and you send the video directly on the network.

Lex Fridman1:01:15

Mm-hmm.

Jean-Baptiste Kempf1:01:16

And that required a very fast network. Today, it's obvious, but at the time was, like, the first to do video streaming. So they build this project, which was called Network 2000. Of course, right, we are in the '90s, right?

Everything is- ... futuristic is called 2000, like-

Lex Fridman1:01:31

Yeah, 2000, yeah.

Jean-Baptiste Kempf1:01:32

And so they do the Network 2000 project. It's completely hacked. It crashes after 45 seconds. That's okay. The demo is 40 seconds. It leaks memory. That's okay. They put 64 megabyte of RAM instead of the 8 or 16 you have, and the demo should have stopped there, and that was the Network 2000 project by the students.

Lex Fridman1:01:50

What was the format of the video that they had to work with?

Jean-Baptiste Kempf1:01:52

MPEG-2 because satellite is MPEG-2 TS for transport, MPEG-2 video, and MPEG-2 audio at that time. And the project should have stopped there. Everyone was happy. They had, like, amazing ATM network at 155, 55 megabits per second. They had probably one of the best network in Europe at that time, and they stopped the project.

Six months or a year later, two students arrive and say, "Well, you know what? Maybe other people care about video streamed on a local network," and they create the VideoLAN project, VideoLAN. And one of them is called Christophe Massot, that is a good friend of, uh, both Kieran and me, and they start the project.

It's not even open source yet, and they spend around three years to get the school to agree to make it open source. Because the, the university wanted to get some-- Because of the IP and copyright of the students, wanted to basically monetize these MPEG-2 decoders.

Lex Fridman1:02:47

Just to be clear, so what's the main application? Streaming on a local network?

Jean-Baptiste Kempf1:02:51

It was streaming on a local network.

Lex Fridman1:02:53

By the way, that's just, like, to state the obvious. This is before YouTube. This is before-

Jean-Baptiste Kempf1:02:57

Ten years before YouTube. You have a Pentium 60 or 75, right? Y-y-you, the main machine was 4886DX at 33 megahertz, right?

Kieran Kunhya1:03:05

Bear in mind, tele-television was the main form of video at the time. You could get new channels. In the '90s, having even one new channel when you, you grew up with four channels, having a fifth or a sixth-

Lex Fridman1:03:14

Mm-hmm

Kieran Kunhya1:03:15

... was a big deal, and so having this satellite service with, you know, dozens, even hundreds of channels was so groundbreaking.

Lex Fridman1:03:22

Mm-hmm.

Jean-Baptiste Kempf1:03:22

Especially because this is university where you had ton of different nationalities, right? So there was a ton of people who wanted... So the-- In the end, they had, like, several dishes on different type of satellite, right? Because, for example, a lot of people were coming from, uh, the Maghreb or the Middle East, and, and they, they, so they went to different type of, uh, uh, of satellites.

Anyway, the solution w-worked great, and they started the VideoLAN project. The VideoLAN project has several s- and, and some are completely crazy solutions, like one h-how to create multicast on an unicast network, but let's not come to that.

It's too, too complex. But VideoLAN client part is what became VLC.

Lex Fridman1:04:02

Mm-hmm.

Jean-Baptiste Kempf1:04:03

Actually, they basically strong-armed the, the university to force it to open source because university did not understand that. And in 2001, it's still early. But basically, yes, the university agreed early 2001 to make it open source. I joined the project in 2003 because that's when I joined the university.

So the first thing is I'm not the one who created VLC because actually no one did, right?

Lex Fridman1:04:27

Just kind of naturally emerged from the VideoLAN project. And we should mention that, like, again, you, you, you said it just, but to make it clear, VideoLAN, uh, as what it became was at the time was a set of technologies around video, and the VLC, what you called the client, that's the thing that most normies, uh-

Jean-Baptiste Kempf1:04:47

That is correct, and-

Lex Fridman1:04:48

... think of, like, as the thing, which is, like, the thing that pops up when you click on a video and you play it.

Jean-Baptiste Kempf1:04:53

So I arrive in 2003, and then I will create, uh, the open source, um, nonprofit organization called VideoLAN, and I took everything out of the university to create it an, a nonprofit project and something sustainable. It's-- Yes, it's true that I spent more time than anyone on VLC and VideoLAN.

That is sure. Um, but it's a continuity of a previous project, VideoLAN, the student project, which is a continuity of the Network 2000 project, which is a continuity of that and that.

Lex Fridman1:05:23

I'm sure there's moments along the way there you were thinking of, like, what is the future of this from an open source perspective? 'Cause as, as the internet is blowing up, and there is companies... I mean, for people who don't remember, like, there's companies making huge amounts of money.

Jean-Baptiste Kempf1:05:40

A-and I can tell you that in 2005, the project should have died, um, and I made it to continue the project. Uh, at some point, we were only two active developers. Um, and I thought it was great technology and was useful, and it will be useful, and, and, and I made that my, my, my life and my, my time.

Um, and I made that grow from a few hundreds of thousand of users, millions of users to what we have now, which is probably billions of, uh, version of VLC around the world and used everywhere. Um, so that's a bit the story of VLC.

There is ton of very funny story around that. Many people from, uh, around the world working on it, like you said, in Syria or middle of nowhere in India. But along the way, I got several offers, which were either to bundle, uh, toolbars, right?

You remember those horrible toolbars-

Lex Fridman1:06:36

Oh, yeah

Jean-Baptiste Kempf1:06:36

... which were basically spyware, or changing your web browser or your search engine or even, like, advertisement inside VLC. And I didn't like that, right? I am-- And, and people don't understand that. It's not-- I'm not against money, right?

I'm very happy to make money. I created several startups and, and one I hope that is going to work very well. It's the fact that I believe that you need to win money ethically. There is a right way of doing that, and, and doing sneaky advertisement or stealing data is not the correct way, right?

Lex Fridman1:07:10

Mm-hmm.

Jean-Baptiste Kempf1:07:11

For example, if Netflix arrived at some point and say, "Well, we want to put Netflix inside VLC," probably the story would have been different, right? But they didn't. The only people who came to us were shady ads company.

Lex Fridman1:07:22

Mm-hmm.

Jean-Baptiste Kempf1:07:22

And if I do that, right, I would have a ton of money, right? And then three years later, project is gone, right? Someone forks it and, and something else happens.

Lex Fridman1:07:32

So it's not even necessarily ads or any of that, it's the shadiness of the-

Jean-Baptiste Kempf1:07:36

Yeah

Lex Fridman1:07:36

... dishonesty of the-- So you had a good radar, you had a good threshold of like, no, this compromises the spirit of what this is supposed to represent.

Jean-Baptiste Kempf1:07:46

But also it's, it's for me, right? I'm, I'm like very selfishly, I need to go to bed at night and be happy about what I've done, right? Maybe it's my upbringing, um, uh, maybe it's my parents' fault or, or whatever, right?

But I believe there is right and wrong, right? And this was the right decision at the time. It still is. I want to be proud of what I've been doing. And like, if I had sold out, I would have betrayed so many other people's work.

Lex Fridman1:08:14

Yeah. Well, I should say me and, uh, most of the internet thank you for that decision. It's inspiring, uh, for others, uh, I think that, um, that are pushing the open source movement forward, that it's okay to do these kinds of huge sacrifices if you believe it's right.

And I think in that case it was right and it was the reason that VLC became as successful as it was 'cause it, it, it's an embodiment, it's a symbol of like, you know, freedom and what the open source community can create.

Jean-Baptiste Kempf1:08:46

Yeah, and be a service for so many people around the world, and this is important.

Kieran Kunhya1:08:50

We, we should emphasize in the 2000s it was really normal to download a program and it secretly installs some spyware.

Lex Fridman1:08:56

Yeah.

Kieran Kunhya1:08:56

It was, it was buried in very faint text or in the license text box that nobody reads that at the bottom-

Lex Fridman1:09:03

Yeah

Kieran Kunhya1:09:03

... oh, I will be installing this toolbar-

Lex Fridman1:09:05

Yeah

Kieran Kunhya1:09:05

... and changing all these things. And it was, it was very common to have to, you know, you install a program to do something at the time of any sort.

Lex Fridman1:09:11

To put yourself in the mind of a developer at that time, I think it's very easy, to everybody listening to this, it's very easy at that time to convince yourself to take a few thousand dollars-

Kieran Kunhya1:09:24

Mm-hmm

Lex Fridman1:09:24

... a few thousand dollars to do it.

Kieran Kunhya1:09:26

Yeah.

Lex Fridman1:09:27

To, to say no to much more money-

Jean-Baptiste Kempf1:09:30

Yes

Lex Fridman1:09:30

... takes guts and takes vision.

Jean-Baptiste Kempf1:09:34

The last offer I had was obscene, and they say, "Yeah, but imagine with all that money you could build something new open source," right? It was like the mind trick was, it was difficult-

Lex Fridman1:09:48

Yeah

Jean-Baptiste Kempf1:09:48

... but for me it was just like, no, this doesn't work like that or this is not the right thing, so I don't do it. Uh, uh, uh, and again, right, it's not that I don't like money or, or whatever, it's just like it wasn't right.

Lex Fridman1:10:01

Well, once again, thank you from me and from the rest of the internet. Let me talk a little bit more about the open source movement, about the fact that, as you say over and over and over and over, FFmpeg, uh, is, uh, and many open source projects are built by volunteers.

So, uh, there's a bit of drama recently, uh, Kieran, on the interwebs, on Twitter. Uh, you have a spicy style on Twitter that I think articulates and celebrates all the incredible developers and, uh, development and the, uh, the code, especially Assembly that's involved in, uh, building some of these codecs and building some of this incredible technology.

Twitter Drama1:10:18

Lex Fridman1:10:42

But that brings us to the, a bit of a debacle that happened. Tell me the full saga of what happened with the Google security engineers.

Kieran Kunhya1:10:51

Just to be clear, Google are one of the biggest supporters of open source out there. They have been for a long time. It's just, I think some things kind of went a bit overboard this time. So FFmpeg itself, and, and this is not like a secret, it's on the homepage, you know, the, it processes untrusted data.

There can be security issues when you parse untrusted data. That's very normal. But recently what changed was Google started using AI to create security reports on an open source project, FFmpeg. Volunteers had to deal with that. They did-- They provided very limited funding, and they even went to the media first announcing how good their AI was before the issues could be fixed.

Lex Fridman1:11:30

And this is in the public forum.

Kieran Kunhya1:11:32

Yeah. This is all public.

Lex Fridman1:11:32

So reporting, reporting an issue, using AI to find an issue in the code, which is a security vulnerability, and then reporting that publicly before you're able to fix it.

Kieran Kunhya1:11:41

Yeah. It's announcing how good their I- AI is. That they provided a standard 90-day industry deadline, um, without poten- without really understanding the nature of volunteer-driven development. In addition, this vulnerability was on an obscure 1990s game codec. Um, the way-- And f- and let's look at it from their standpoint to begin with.

Let, let's, um, you know-

Lex Fridman1:12:05

Yeah. Can you steer me in their case?

Kieran Kunhya1:12:06

Yeah, sure. They have substantial resources working on the security of open source projects that, you know, are ubiquitous and they've used, you know, a lot of compute to do that and very expensive and very capable security researchers, um, to do that.

And that, that's their viewpoint is they are contributing by doing that. But I think that's where opinions differ. Um, it, it, it opened up a lot of interesting fissures, uh, I would say. Um,

it does seem that there's a portion of the security community that, um, look at themselves a bit like building architects that never have to go to site. You know, going to site is something that is a little bit beneath them, the actual day-to-day construction.

They're there to do their security things and it's someone else's problem. The security industry also kind of has a very aggressive tone towards things. The, the language they use is extremely aggressive. They use very strong language like, "You will get popped."

Um, so and to, to Joe Public, get popped, you know, means something quite bad. Um, for them it means to get hacked. The way I would look at it personally is a little bit like the padlock on your home.

Um, not everyone-- The padlock on your home or, you know, the lock on your home is there to, to protect against the capabilities of, of what it's there to protect. It's not there to protect nuclear secrets. It's not there to protect Fort Knox, and it could be looked at that they're using AI at a level of scale to go and pick those locks and then say, "Hey, your lock's, your lock's not secure.

You need to deal with this." Whereas actually they're the ones with resources to be able to, to fix this. But that seems to not be something either they'll contribute to in terms of patches or in terms of financially.

And the scale of AI is kind of the issue. The, the, the bug reports are very wordy. They're very, very... It, it's almost a denial of service by AI-generated bug reports on very niche codecs. Um, and the other issue the security community has is everything is marked high priority.

You're going to... You know, this is the most important thing in the world, and you need to deal with this. High, high, high, vulnerable, scary, scary, scary on a game codec used on one disk in 1993.

Lex Fridman1:14:23

Yeah.

Kieran Kunhya1:14:24

And that, that's where the dichotomy lies. Going around telling everyone that their padlock's not safe, well, that's a hobby project of somebody. The, the safety of that codec is consummate to what that person thinks. It's their hobby. It's good that they're security analyzing it, but it doesn't need a big scary warning, "This is a critical vulnerability."

Um, may also, may, may recently also, um, see that, um, there was another quote unquote vulnerability. It wasn't at Google in this case, but, um, a filter could overflow and have an integer overflow, and one of your pixels could be the wrong color, and this was marked high, 7.5 severity in red.

And at some point, the security industry needs to realize you can't keep crying wolf like this because this just leads to people, you know, the equivalent thereof of putting password stickers on their PC. You know, you can't just keep crying wolf every day, and, and I appreciate, you know, that's their modus operandi is to create as much scare and fear.

But from the Google standpoint, at the end of the day, they need to contribute either financially or with patches. Google uses FFmpeg at, at a scale probably you or I couldn't even contemplate, millions of CPU cores. And yes, they contribute in areas mostly regarding their own products, so VP9, AV1.

But in a wider sense, there's a disproportionate level of contribution. Yes, they fund students. Yes, they fund Summer of Code. And I think, uh, so Alex Strange is a former FFmpeg developer, um, I think posting in a personal capacity.

Lex Fridman1:16:03

So he, uh, posted about security engineers on, uh, Hacker News. Uh, his post reads: "The problem with security reports in general is security people are rampant self-promoters," in parentheses, "Linus once called them something worse. Imagine you're a humble volunteer open source developer.

If a security researcher finds a bug in your code, they're going to make up a cute name for it, start a website with a logo. Google is going to give them a million dollar bounty. They're going to go to DEF CON and get a prize, and I assume go to some kind of secret security people orgy where everyone is dressed like they're in The Matrix.

Nobody is going to do any of this for you when you fix it." Uh,

so basically commenting on the sort of the incentives for the different, uh, people involved and misaligned.

Jean-Baptiste Kempf1:17:02

The problem here is, is the disproportion of means on discovery compared to patching it, right? And this is the biggest issue, right? Um, a- and after that debacle, Google did some changes-

Kieran Kunhya1:17:16

They are now starting to send patches, which is, yeah

Jean-Baptiste Kempf1:17:17

... And they also now have reward tools for fixing issues. So it, it has changed a bit because of that, uh, debacle, so it's good, right? But we've seen, and we talk about Google, but we have seen like some, some other large companies saying, "Oh, you need to fix this bug because it's critical in our product."

Lex Fridman1:17:34

Can you explain the XZ fiasco? The FFmpeg tweet reads: "The XZ fiasco has shown how a dependence on unpaid volunteers can cause major problems. Trillion dollar corporations expect free and urgent support from volunteers. Microsoft, Microsoft Teams posted on a bug tracker full of volunteers that their issue is high priority.

After politely requesting a support contract from Microsoft for long-term maintenance, they offered a one-time payment of a few thousand dollars instead. This is unacceptable. We didn't make it up. This is what Microsoft, Microsoft Teams actually did." And then they, uh, you give the image and the details and all that kind of stuff showing that these trillion dollar companies are not giving much money, not giving much support.

Kieran Kunhya1:18:25

They think, they think an open source project is a traditional vendor that they have an SLA. They think a public bug tracker is actually, you know, a, a third party vendor's Jira where you can do all of these things.

It, it, it's not. It is there to report bugs. I think the thing that made this particularly heinous was the name dropping of Microsoft, the name dropping this is a visible product. If this was, if this was a just a general bug report, I think that would have made it a lot better.

Lex Fridman1:18:52

Yeah, so they literally said like this is a big deal because a lot of people are using it in Microsoft. I wonder what happens psychologically. So I think what happens in these companies, maybe you can correct me, is they...

Y- you're, you're right. They just think of FFmpeg as like a vendor that Microsoft surely is paying a huge amount of money to.

Kieran Kunhya1:19:14

Mm-hmm.

Lex Fridman1:19:14

They kind of assume that in their interaction and nobody anywhere on the stack is going like, "Wait a minute. Shouldn't we be giving like millions of dollars to FFmpeg?"

Jean-Baptiste Kempf1:19:25

And this is a very big problem in, in large... Like we're talking about some companies, but it's the same everywhere, right? Um, a lot of those companies Like the, the- when we talk to that person, right? He was just like a, a manager on one project in Microsoft Teams, right?

He had, like never really, mm, discussed with open source community. He had no idea, right? It was like, uh, and... But the problem is that usually there is what we call OSPOs, right? Open source program offices in those type of companies, and they are the ones who are supposed to discuss with open source vendors.

Lex Fridman1:19:59

Mm-hmm.

Jean-Baptiste Kempf1:19:59

Um, or, or v- open source communities. But like they often don't explain that correctly internally, right? And here it's just like, we are not your supplier. If you want me to be your supplier, I'm very happy, right? I will send you a contract and SLAs.

Like I created f- five companies who are doing that around open source projects, so that's okay.

Lex Fridman1:20:20

We should say that some, some of the spicy tweets that Kieran you're behind and some of the debacle produced results.

Jean-Baptiste Kempf1:20:28

Yes.

Lex Fridman1:20:28

Positive results.

Kieran Kunhya1:20:30

Donations have increased substantially. They're still not enough to cover even a single full-time developer, but on both a, you know, awareness level and a technical level, there's substantially more technical awareness and sort of awareness of the importance of FFmpeg as a result, as a result of X and, and what's happened.

I can say, you know, it, it, it solved its purpose. People realize the level of importance FFmpeg has.

Jean-Baptiste Kempf1:20:56

And on VideoLAN it's the same, right? Like for example, a, a very simple example. For more than a year, we couldn't update VLC on Android because of a bug on the Play Store, on Android Play Store, right? The only way we got someone to answer was to put an very spicy, as you say, um, tweet saying that we are going to stop distributing VLC for Android, right?

And we have around 100 million people using that. Um, and now then someone from Android actually came and discussed to us, right? Um, we had the same issue with, with, uh, Microsoft or, or like saying that we were going to stop distributing VLC on the Windows Store.

And unfortunately, we are so small that the only very strong power we have to solve those issues is blaming on social network because it snowballs and now they listen to us. But so as large companies often have difficulty talking to us.

Like for example, VLC, right, is probably one of the top 10 software used on Windows. I am not part of Microsoft ISV programs, right? I don't have a point of contact at Microsoft, right? Well, I'm sure any other software, Adobe, Spotify, has a co- a point of contact.

I don't have that, right? So raising awareness works. It's sometimes very spicy, lot of drama. Well, X and Twitter are okay for that, but it's efficient.

Lex Fridman1:22:31

Uh, so everybody listening to this should go, uh, follow FFmpeg on Twitter, on X, follow VideoLAN on Twitter, on X. Uh, go donate. Donate-

Kieran Kunhya1:22:44

Thank you

Lex Fridman1:22:44

... to FFmpeg.

Kieran Kunhya1:22:45

And thank you, Lex. Over the years, several years, you've been a supporter of, you know, FFmpeg and VideoLAN on X, you know, sh- giving us shout-outs, appreciating, you know, what we do.

Lex Fridman1:22:56

FFmpeg for life.

Jean-Baptiste Kempf1:22:57

And for example, like, um, Tim Sweeney, Carmack, and a few others, like very high-level people have raised also the awareness on, on our, uh, X accounts, and that helped a lot also.

Kieran Kunhya1:23:09

Karpathy as well.

Jean-Baptiste Kempf1:23:10

Karpathy, yes.

Kieran Kunhya1:23:10

Karpathy as well, yeah.

Lex Fridman1:23:12

Yeah. I mean, also, you know, outside of the fact that so many people use it, it's so impactful on the world, and it's also a great representation of a great open source project. Like the value of Assembly and C and making sure that like you take programming seriously for real world systems.

Kieran Kunhya1:23:31

It's not just that. We, we'll talk about Assembly later I'm sure, because that's its whole topic in itself. But it's also celebrating people like Andreas Reinhardt who do maintenance. It is, I believe, unpaid, as I believe as a volunteer.

He's doing massive refactorings. Uh, Andreas Reinhardt and Anton Kern of rewriting FFmpeg.C with threading. Celebrating those guys, celebrating the untold labor that's gone into this that actually doesn't change anything from the user standpoint. The files are exactly the same, but wow, the, the, the airplane has been rebuilt whilst it's in the air.

Lex Fridman1:24:04

Christian Garcia said, "As a teenager running this account," referring to the FFmpeg a-account, and you responded, "Teenagers have written more Assembly in FFmpeg than Google engineers." But also just pointing out that there's a lot of incredible contributors who are teenagers.

Kieran Kunhya1:24:20

Like JB said, we don't care who you are, where you're from, what you do. Teenagers have written thousands of lines of Assembly, um, over the years. Give a shout out back in the days to Daniel Kang. So also highlighting the work of people like Ruikai Peng.

This is a 16-year-old, some of his first contributions to FFmpeg, actually doing and putting some of these quote-unquote security researchers to shame by act- by actually finding issues and fixing them and being 16. There's no barriers. There's no barriers to you have to study on, at college under this person and understand these.

It's if you can learn C, and let's be honest, it's from, it's from the K&R book, Learn C. Uh, you can learn Assembly. We'll talk about that maybe a bit later. You can contribute to world-class technologies.

Jean-Baptiste Kempf1:25:07

In VLC, um, one of the oldest contributors called Felix, he's the one doing everything on Mac and iOS. He's starting working on VLC. He was 16. Um, we had a guy called Edward Wong, who used to be a Google Summer of Code student who stayed for three years around VideoLAN.

He was 14, right? Um, and, and part of Google Summer of Code and Google Code-in, which were programs where, uh, basically we have students or high school. Um, we wrote a ton of Assembly for x264 a- and for VLC and for FFmpeg, right?

So everyone can contribute.

Kieran Kunhya1:25:42

And he also did a good job because he didn't play the alarmist, um, CVE heist, create a CVE, which is like, um, a public exposure of security and do these big, scary red 7.5 pri-priority. He just fixed an issue in Git after three days and just fixed it.

He didn't need to go and play a big security drama about it, and I think I posted, you know, the kids are all right. Whereas- ... there's, there's, there's, you know, there is a por- I'm not saying all security people do this, but there is a portion of the security community, as Alex said, that likes to hype themselves up by creating drama.

They would've happily raised, "This is a high priority CVE 8.0 or whatever," on a, on a issue that actually was in Git. It wasn't even in a release. It was in development, and three days later was fixed.

Lex Fridman1:26:28

Well, I just wanna put a little bit of love out there, even to the bigger community. Uh, much love and respect to Google engineers. Like you said, they're, uh, uh, some of the, the best software engineers in the world, and they do contribute a lot-

Kieran Kunhya1:26:43

Yes

Lex Fridman1:26:43

... even on the security front. And also, you know, I'm a big fan of Theo. Much love to Theo. He was part of this, uh, debacle and drama a little bit. I think when you just zoom out on the grand arc of human history, the drama contributed positively to everybody involved.

Donations went up. It brought more attention to the topic-

Kieran Kunhya1:27:05

Yeah

Lex Fridman1:27:05

... allowed, uh, everybody to bicker in a way that ultimately, uh, got them to figure out what FFmpeg is all about.

Kieran Kunhya1:27:12

So the way, the way we looked at this is, like, it's a rap battle at the end of the day, you know? No, but it is, it is.

Lex Fridman1:27:17

It is. It is.

Kieran Kunhya1:27:17

We say stuff. We say stuff.

Lex Fridman1:27:19

Yeah.

Kieran Kunhya1:27:20

But we can, we can leave it on. X is a perfect place for, you know, international rap battle. We-- You say stuff. I say stuff about your mama, but it doesn't mean, you know, I'm g- I have an actual personal issue with her.

Lex Fridman1:27:29

Yeah.

Kieran Kunhya1:27:30

A- and that's what it looks like. The, the Theo situation, you know, JB can maybe expand, went a little bit too far and there was a little... But, you know, it, it's just a bit of fun. It's just a bit of rap battle.

It's a bit, it's WWE. You know, everyone's having a bit of fun on X.

Lex Fridman1:27:43

Mm.

Kieran Kunhya1:27:43

It, it doesn't need to be taken seriously. You know, the, the teenagers thing, you know, that... So that, that guy was a Google employee saying, "Hey, you know, there are other ways to run an open source business." You know, go, and then it's like, oh, man, just have a bit of fun, you know.

Lex Fridman1:27:54

Yeah.

Kieran Kunhya1:27:55

That's what the point of this account is. And, and furthermore, if you can teach people about the ways of open source projects, assembly, et cetera, by doing that, I think there's a lot to be offered here. It's not dunking on people for dunking's sake.

It's showing actually the story that I think X learnt is these are not big corporate open source projects. This is not Kubernetes where there's, you know, hundreds, maybe thousands of people-

Lex Fridman1:28:16

Oh

Kieran Kunhya1:28:16

... paid to develop this stuff. These are just people in their basements in their spare time, and if you can address that topic in a fun and entertaining way-

Lex Fridman1:28:24

Mm

Kieran Kunhya1:28:24

... I think that, that, that's the good thing, and that's, that's the value of X and then the reach we have.

Lex Fridman1:28:29

A- and, and to be honest, right, like even on, at Google, Google is one entity, but so many different people, right? And, and some, a- and there is a ton of Google engineer we work with, um, all the time, and even, like, Google from YouTube to Chrome to Chrome Media to the rest of Google, those are very different type of entities.

But what we do is efficient. And, and for example, uh, for, for, for Theo, right? It went a bit too far. I had him, like I, I calmed everyone down. I had him on the phone. We say, "Okay," like, "This goes too far," and so on.

But in the end, um, yeah, it's a rap battle, but it's positive for the project. It... Like, the awareness we have on open source and, and I mean true open source from communities, right? Not... Is increased dramatically in the last two years, and this is useful.

Kieran Kunhya1:29:19

Uh, what do you think motivates all the incredible contributors that we've been talking about? Like, what's the, what's the engine? It's so interesting to see.

Lex Fridman1:29:27

So-

Kieran Kunhya1:29:27

Like you said, they're sitting in the basement. What's the driver? What's the engine there?

Lex Fridman1:29:30

There are many, uh, drivers, but weirdly the main one is that what we do in multimedia plays videos, and video is cool, right? And, and for example, we have so many people in the community who arrive because they loved watching anime, right?

A- and this is, like, the advice when people ask me, "What should I work on in open source? How do I start?" And my quest- my answer is always the same. Work on something you love.

Kieran Kunhya1:29:56

Mm-hmm.

Lex Fridman1:29:57

I am working on VLC because I love movies, right? And I love watching the same movies over and over, even if my wife hates me when I do that, right? But because it's interesting, right? Because it's a topic that you like, right?

The first, that's the first thing where people come to usually to VLC and FFmpeg. The second thing is that technically we, because we search for excellent, this is the best school ever, right? This is the best school ever of programming.

If you're good in C, in FFmpeg, if you know how to write assembly, I assure you you're going to be one of the best programmers ever, even if you're working on writing TypeScript, because this is the most amazing thing to do.

And you will, like, have to get reviews by some of the most seasoned programmer ever who are going to look at every part of your code and tell you why it's not great. It's like we are the best teachers that you've ever had in programming, right?

Kieran Kunhya1:30:53

Andrew Kelly started Zig. He was an FFmpeg developer and started Zig after-

Lex Fridman1:30:57

Mm-hmm

Kieran Kunhya1:30:57

... his FFmpeg school. I mean, it, it's the place to learn so many aspects of programming in the real world, in a thing used by billions of people. You have nowhere to hide. You have to be open and honest about your flaws and, and how you can learn and be better.

Lex Fridman1:31:13

And what is also interesting in multimedia is that you have 16 milliseconds to display a frame. It's not like a game engine where you can basically slow down and wait a frame. Like, so it's, you need to be good, right?

There is no choice, else you don't have your video. It, and, and because of how codecs, if you miss a frame, you're going to destroy the look of the video, right? So you need to be good. You need to be perfect to have the right thing.

But also is that it's not just pure programming in the mathematical fence, right? A lot of people don't understand, but, um-

Jean-Baptiste Kempf1:31:48

In order to program correctly on the open source multimedia community, you need to understand how computer works. And, and when you write assembly, you need to understand about, uh, CPU pipelining, right? You need to understand how SIMD works, how the ALU works, right?

You need to understand wh- how IO works, right? And this is what I think that is missing to a lot of engineers and software engineers today, is understanding what we call computer architecture. Um, and, like, seriously, like, some of the debates is like, "Should we use this assembly call or this one?"

And people say, "Well, no, it's going to be, like, three cycle on this, uh, type of CPU and this one," and has massive impact on the output, right?

Kieran Kunhya1:32:28

We should expand. FFmpeg is probably one of the biggest CPU users in the world. There's probab- it's probably running-

Assembly1:32:28

Jean-Baptiste Kempf1:32:33

Mm-hmm

Kieran Kunhya1:32:34

... as we speak easily 100 mi- order of magnitude 100 million, maybe even a billion CPUs as we speak. So every instruction matters. There's not... The, the, the impact, a- at least in terms of CPU, is massive for everything that we do.

Jean-Baptiste Kempf1:32:51

So first you come because it's an interesting subject, then you stay because it's excellent, and in the end, you're very proud of it because it's on the end of everyone. Like, so many people like, "Oh, I'm working for whatever consulting company, and I'm doing some

portal to download invoices for your PG&E." Wow, great. Like, so many w- jobs are like that. You're not going to, to tell that to your grandma. But if you go to see your grandma and say, "I do this so that you can play video on your laptop," they understand.

And this is very important, right? Because you're working on VLC, FFmpeg, H.264. It's in the end of hundreds of million of people, and you have an impact. Um, and so you can be proud of yourself. And so I think that in addition to great, doing a great resume, all those things are why people contribute.

Kieran Kunhya1:33:42

Yeah, th- those are side effects. My favorite quote on this topic is, uh, John Collinson. He said, "The world is a museum of passion projects." You know, everything out there is, is a passion project. And open source multimedia and open source in general, you can just do that so much faster.

There's such a faster network effect, you know.

Jean-Baptiste Kempf1:33:58

Mm-hmm.

Kieran Kunhya1:34:00

I can open a cafe, and that can be my passion project, but I have to get building codes, I have to build a building, I have to find a th- uh, find a location, I have to do all the, you know, all sorts of things.

Well, in the software world, that passion project can be, can move quickly, it can be amplified by the network effect, and that amplification can be more than the, the, the sum of, the sum of the parts. You know, you can be, you can find people interested in extremely obscure things and have a network effect and make something that is truly amazing.

Lex Fridman1:34:31

And, uh, on that topic of passion projects, uh, Tim Sweeney actually said in a reply to a tweet that was, uh, complimenting JB, he said, quote, "Many things in the world only happen because an awesome person decides to do it.

This is the case with VLC." And that speaks to something interesting to me, that it does seem that a small number of people, sometimes one person, can create something incredible in the software world. Like you said this over and over and over.

I think JavaScript is an incredible thing created by, by, uh, initially a single person. The, some of the programming languages like Python and C and Java, like just one person has this vision, has this design, and brings it sometimes over a weekend is the initial spark.

Jean-Baptiste Kempf1:35:19

Yes. Linus built Git in two weeks.

Kieran Kunhya1:35:22

Yeah.

Jean-Baptiste Kempf1:35:23

Wow.

Kieran Kunhya1:35:23

Yeah.

Lex Fridman1:35:23

Yeah, it changed the world, Git. I mean, it really changed the world.

Kieran Kunhya1:35:26

Linus' passion project. "Hey, I- uploading this tarball to an FTP, like, deal with it."

Jean-Baptiste Kempf1:35:30

But for me, it's not just in software, right? And I believe in, in, in individuals that are going to change the world, right? And it's with a good, as you said, vision, right? I want to do that. Um, it is useful.

It will be useful. And whether it's going to, like, build train or cars or rockets or something, like I, I believe people who believe in themself and have a vision can have a huge impact for humanity.

Lex Fridman1:35:56

Let's actually z- uh, zoom out before we zoom back in. We'll just keep going up and down the, the stack. So, uh, you know, we've been talking back and forth VLC and FFmpeg. Kieran, you said that FFmpeg and, uh, VideoLAN, VLC coexist, and there's no central point of importance.

It's a kind of what you call the binary star system.

Kieran Kunhya1:36:18

Yeah.

Lex Fridman1:36:18

Uh, they succeed because of each other. Can you explain the difference, how they interact? What is the-

Kieran Kunhya1:36:25

Sure.

Lex Fridman1:36:25

Are they competitors?

Kieran Kunhya1:36:26

I don't, I don't think they're competitors. I think, I think the simple answer is, the short answer before I go into detail is VLC is to FFmpeg as Android is to Linux. So they depend on each other, but they, they coexist because of each other.

So they are a binary star system is the analogy I used.

Lex Fridman1:36:43

By the way, I feel horrible that I just recently learned that Alpha Centauri, the closest star system to us, is a triple star system.

Jean-Baptiste Kempf1:36:51

And, and when you start doing the physics, it's a nightmare, right?

Lex Fridman1:36:54

Yeah.

Kieran Kunhya1:36:54

Oh, yeah.

Lex Fridman1:36:54

But, but, but like-

Kieran Kunhya1:36:55

Hence the three-body problem. But anyway. So a lot of FFmpeg pipelines involve the X.264 project, which is a VideoLAN project. I w- I would put a finger in the air that's, and say 80-plus percent of those pipelines are dependent on a VideoLAN project.

VLC, obviously, as we've discussed, a VideoLAN project, uses FFmpeg, gives it reach, exposure to weird files, uh, historically used some donation money to fund FFmpe- FFmpeg development, and we'll talk a bit maybe about some of the reverse engineering later.

So it's a binary star system. They, they work and feed off each other. Many of the developers are shared. There's no central location. It's a virtuous cycle working together.

Lex Fridman1:37:36

And we should mention that X.264 is the encoder for H.264 video standard. So H.264 is the standard.

Kieran Kunhya1:37:44

Yes.

Lex Fridman1:37:46

X.264-

Kieran Kunhya1:37:46

Is the implementation, open source implementation of the standard

Lex Fridman1:37:49

... that's used by basically everybody-

Kieran Kunhya1:37:51

Yeah

Lex Fridman1:37:51

... for everything.

Kieran Kunhya1:37:52

Yeah

Lex Fridman1:37:52

It's that, that is the main driver of this. When you think of an MP4 file that has H264 codec in it-

Kieran Kunhya1:38:00

If it, if it came from a software environment like a data center or somewhere, the chances are it was created with H264.

Lex Fridman1:38:06

And that's under the flag of, uh, VideoLAN.

Kieran Kunhya1:38:09

That's a VideoLAN project. So in the VideoLAN graphic, it sits in the VideoLAN world.

Lex Fridman1:38:14

And VideoLAN has a, says a bunch of stuff in it. Go to the VideoLAN website, there's a bunch of icons.

Jean-Baptiste Kempf1:38:21

Like if you look, there is so many libraries, right? Um, libdvdcss-

Lex Fridman1:38:28

Yes

Jean-Baptiste Kempf1:38:28

... libdvnav, libdvpsi, libvlc of course, vlc-unity, libbluray.

Lex Fridman1:38:36

Libbluray.

Jean-Baptiste Kempf1:38:38

Uh, yeah, there's many more.

Kieran Kunhya1:38:39

A- and there is so many more, right?

Jean-Baptiste Kempf1:38:40

Yeah.

Kieran Kunhya1:38:41

Lately, lately the David project that we might talk about is the last project from VideoLAN. It's everywhere, right? And we do- we have a lib spatial audio lately that we announced. We have a-

Lex Fridman1:38:51

CheckASM

Kieran Kunhya1:38:52

... CheckA- CheckASM-

Lex Fridman1:38:53

We'll talk about that later

Kieran Kunhya1:38:53

... which is like an insane project-

Lex Fridman1:38:55

Nice

Kieran Kunhya1:38:56

... but amazing. Um, so a- and H264 is one of those VideoLAN project. And my opinion, for example, is that H264 was, is the most amazing encoder ever designed, and this helped the adoption of FFmpeg. A lot of people and large companies went through FFmpeg because they wanted to use H264, and H264 increased the popularity on FFmpeg.

But also VLC had its popularity because it's played so many files that were done by FFmpeg, right? So it's, it's many project that are interwind a- and work together. Yeah. Unfortunately, there's a, there's a thing on X where, um, VLC is mentioned and there's people, "A quick reminder that it's FFmpeg inside doing the actual work."

And that, and that's, like I said, it, it's not... That- that's not the case. The, the- we work together.

Jean-Baptiste Kempf1:39:47

And, and to give you an idea, right? When I compiled VLC for Windows, I compiled around 16 million lines of code, right? One million of those are inside the VLC repository, and FFmpeg in total is probably two, around two, right?

But so it means that so many dependencies are outside. And if you also look at FFmpeg per se, FFmpeg also is integrating third-party libraries like H264, but Libopus and so many others, right? So we all depend on each other.

Lex Fridman1:40:16

Uh, yeah, that's why I was, uh, hoping to do this episode as we are doing that just, uh, kinda joins FFmpeg and VLC-

Kieran Kunhya1:40:23

Yeah

Lex Fridman1:40:23

... 'cause it's really, it's, it's really two, two of the same, like you said, b- uh, binary star system, and we're all just orbiting it. Uh, can we give a shout-out to some of the people along the way?

We th- didn't really quite talk about the history of FFmpeg, so, uh, m- maybe can, can you tell me about Fabrice? Can you tell me about Michael Niedermayer? Can, can you tell me about some of the key figures here?

Kieran Kunhya1:40:46

Let's just talk about the, the eras of FFmpeg, 'cause there, there's key eras that, and key people that made this possible. Um, Fabrice Bellard, as you mentioned, creating the concept, and then probably in the 2000 era, I would call the era, eras tour of FFmpeg is the 2000 era was Michael Niedermayer.

So key things he got done was exhaustive support for DivX and Xvid at the time, and all sorts of weird variants of what's known as MPEG-4 Part 2. So this predates the MPEG-4 Part 10 that we're used to.

So this was 2000 era video codecs where there were, oh, flavor after flavor of weird, weird decoders.

Lex Fridman1:41:26

Mm.

Kieran Kunhya1:41:27

At the time in the 2000s, you needed a new player to play every different type of file format. So there was Windows Media Player to play Windows Media formats. There was RealPlayer to play RealMedia formats. And those were the other, the other key thing in FFmpeg at the time were native decoders for those.

I actually do remember being a teenager, I must have been, figuring out there was this one player that could play, could decode these files without having separate bloated players. 'Cause at the time when you downloaded RealPlayer, there was a ton of other stuff in there, a ton of ads, a ton of other things, and just having a simple library that was fast led to that.

And then I think 2008 was a, 2008 onwards was a big change because that's when H264 got its maturity and, and I think something hopefully we'll talk about a bit more. This was the beginning of high definition video.

So H264 was the key decoder of that. So I'd call that the late 2000 and 2010s, and that's when the big reverse engineers came along and really did astonishing work. The beginning was a single player that could play Xvid, DivX, Windows Media, and RealPlayer was already in a massive achievement in itself without codec packs, without weird stuff you had to download that had weird ads and weird spyware.

Jean-Baptiste Kempf1:42:44

VLC 1.0 was out on those times, 2000, 2009, 2010.

Kieran Kunhya1:42:49

Yeah.

Jean-Baptiste Kempf1:42:50

And this is, like, where it exploded.

Lex Fridman1:42:53

Yeah, without codec packs, it just works-

Kieran Kunhya1:42:56

Yeah

Lex Fridman1:42:56

... across all these different-

Jean-Baptiste Kempf1:42:58

It, de facto, it's just like all the codecs packs are FFmpeg inside VLC, plus we have other modules for all the type of codecs.

Kieran Kunhya1:43:04

But at, at the time that wasn't, is there were weird... In the 2000s, there were weird codec packs with DLLs coming from this place, DLLs coming that-

Jean-Baptiste Kempf1:43:11

With a lot of spyware

Kieran Kunhya1:43:11

... with spyware, with you know what. You, it wasn't reliable, you didn't know, and having a single player that was open source or single playback module/player that could do this that was open source. But I think the thing to emphasize is this task in the 2000s that Michael did was, was Sisyphean.

It was really, the number of edge cases are, were beyond comprehension in terms of you could have a Chinese CCTV system that did one weird variant of MPEG-4 Part 2, mem- what's known as MPEG-4 ASP, and that was a weird variant, and you had to fix that without breaking everybody else-

Jean-Baptiste Kempf1:43:44

Mm-hmm

Kieran Kunhya1:43:45

... times a million.

Lex Fridman1:43:45

So that's, uh, so you said that- that's where a lot of the reverse engineering was happening.

Kieran Kunhya1:43:49

It start, it started in the 2000s with the Windows Media stuff-

Lex Fridman1:43:52

Yeah

Kieran Kunhya1:43:52

... 'cause that was proprietary. It started with the RealMedia, so with Benjamin Larsson.

Jean-Baptiste Kempf1:43:57

Kostya Shishkov.

Kieran Kunhya1:43:57

Kostya Shishkov, that era. Those were the key, that was the key groundwork. And then in, in the 2010s was kind of the Paul Maheral, Kostya era building, doing, doing some of the most difficult codecs. Um, JB maybe can talk about GoToMeeting 4 and GoToMeeting 5, and-

Lex Fridman1:44:13

What? What's the, what's the GoToMeeting-

Jean-Baptiste Kempf1:44:15

So, so, so, so, so, like, let-let's talk about this amazing Ukrainian guy called Kostya, who was, uh, at that time living in Germany and who was in love with Sweden, right? He-- And the guy was the most... He, he's like, like, like a lot of the people in the community are very clever.

He's one of those who are, like, borderline geniuses, right?

Kieran Kunhya1:44:40

Mm-hmm.

Jean-Baptiste Kempf1:44:41

He was able to reverse engineering extremely complex codecs, um, and he, he does that, and we do a to- a bit of engineers with Kieran, but clearly not at this level.

Kieran Kunhya1:44:51

No, no, yeah.

Jean-Baptiste Kempf1:44:51

Um, he reverse engineered binary blobs, which are 20 megabytes?

Kieran Kunhya1:44:57

Yeah, so just for reference, uh, um, one megabyte binary blob to reverse engineer is probably order of magnitude a month of work, and this guy is doing 20, 30 megabyte blobs. Maybe we'll talk about that in a minute, about the subtleties of how you do that.

But this guy is doing it for very difficult and very obscure codecs.

Jean-Baptiste Kempf1:45:13

And, and did that for fun, right?

Kieran Kunhya1:45:15

Yeah.

Jean-Baptiste Kempf1:45:16

And, and, um, so GoToMeeting, uh, was a big problem with VLC because that was like the number f- number one, uh, feature request for a long time, so I put a bounty. A-and the guy at some point said, "Okay, JB, I'm going to do it."

And in a matter of two months, and then he explained how he did it. He was just like, "Oh, I looked at the code, like this looked like a, a, a DCT that I used to see on WMV and so on."

He did that, and the funniest part is that the code he's w-written is a ton of jokes. And there is, there is a ton of JB, right, my name, and, and Kempf, um, and Kempf and Kostya, uh, jokes inside the code.

The code is beautiful, right?

Lex Fridman1:45:57

So one of the things I, I, I wanna comment is, uh, I've gotten a chance to speak to some of the developers, some of the as- as- assembly language level, uh, uh, people, and they all always make everything sound like it's kinda easy.

There's a, a kind of humility because, um, maybe just the level of what's required to do this stuff is so high that everything else seems easy, I guess, is the lesson to take away from that.

Jean-Baptiste Kempf1:46:24

So in the community, like some of the most impressive people are the ones doing reverse engineering-

Lex Fridman1:46:28

Yeah

Jean-Baptiste Kempf1:46:28

... and the other ones doing the assembly folds, right?

Lex Fridman1:46:31

Mm-hmm.

Jean-Baptiste Kempf1:46:31

Um, and both of those type of people are amazing. Um, x264, for example, became amazing because, uh, of a, a guy called, uh, Lorraine Merritt-

Kieran Kunhya1:46:42

Yeah

Jean-Baptiste Kempf1:46:42

... who is, was from the University of Washington, I think.

Kieran Kunhya1:46:45

At the time, yeah.

Jean-Baptiste Kempf1:46:45

And who was like, who made everything great and fast doing a ton of assembly.

Kieran Kunhya1:46:51

Yeah.

Jean-Baptiste Kempf1:46:51

Um, uh, yeah. So this is like the, the, the, the golden era, I guess, where so many things got done.

Kieran Kunhya1:46:57

Yeah, if you look at Kostya, for example, he looked at the world as a binary specification. He, he didn't need documentation or anything. It's, "I have a binary and I can figure all of this out." And, and he, he regularly used the phrase binary specification.

Ah, you know, it's not a problem. And he went and he would go away, and he would come back and he, he would do interesting stuff.

Lex Fridman1:47:15

Can you, uh, actually speak to the details or any, any add color and texture to what it takes to reverse engineer a blob?

Kieran Kunhya1:47:22

Yeah. So, so let's look at GoToMeeting, for example, is a good one because, um, I record a meeting, uh, on GoToMeeting, for example. How do I play it back without needing this GoToMeeting player? There may not even be a player.

I may, I may need to send a recording of a meeting to someone that doesn't have a player or whatever. So fi-first of all, there's a ton of other stuff there. There's a, a actual video conferencing client. You need to go and find...

It may be easy, it may not be easy to find the actual module doing the decompression. You need a way to actually dump the YUV data from the module. So often it rever- it involves opening in a disassembler, trying to guess where the hooks are to incorporate that module and run that module natively to decode a sample file.

So figure out where this module is doing the decoding process and, and find a way to hook in and output the raw YUV data, 'cause you will need that-

Lex Fridman1:48:16

Mm-hmm

Kieran Kunhya1:48:17

... as a point of comparison for when you actually do the reverse engineering, 'cause you'll need to be bit exact or in some cases close to bit exact. And then you, you open up your disassembler, use a lot of intuition to go and figure out, you know, where the DCT is, where's entropy coding.

There, there is a kind of, not a rule book, but there's always a pattern of some sort. Um, for example, GoToMeeting, you know it will be a sc- a lot of screen codec tools. There's also different variants. So often I think there's what?

GoToMeeting 4, 5.

Jean-Baptiste Kempf1:48:47

No, 2, 3, 4, I think.

Kieran Kunhya1:48:48

2, 3, 4.

Jean-Baptiste Kempf1:48:49

Yeah.

Lex Fridman1:48:49

So as you mentioned here, going to Perplexity, GoToMeeting uses its own proprietary codec for older s- recorded sessions historically stored in WMV files that require a special decoder to play properly on Windows. Without this decoder installed, Windows Media Player and some editors cannot decode the video track, so you may only hear audio or see a black screen.

Boy, do I remember that. But this is reverse engineering that.

Jean-Baptiste Kempf1:49:17

This is key, right? Because the GoToMeeting is something that not many people know anymore, right? Well, you know about Zoom and, and Teams and so on, but like now let's fast-forward 10 years, 15 years, and like this is a Gotomeeting.exe for Windows 32 bits, right?

Which is like, oh yeah, but I'm on Android, I'm on an iPad, I'm somewhere else, right? How are you going to do that? I'm going to be on RISC-V, on Arm. Those are blocked, but there are tons of files we need to f- support for the future, and this is why those type of work are in- exceptionally useful for humanity.

Lex Fridman1:49:52

I just have to say though, that reverse engineering process is mind-blowing.

Kieran Kunhya1:49:56

Yep.

Lex Fridman1:49:56

It's crazy. It's like, it's a kinda like, you know, I've been reading a lot in the interview archeologists. I mean, you, you just have so little signal. Yes, yes, you know over time you get so much experience, you understand the structure of the original code, so you can kind of start inferring basics.

Kieran Kunhya1:50:15

Yeah.

Lex Fridman1:50:15

But you're like- Like, like, like archaeologists with a little brush trying to reconstruct the entire human civilization

Jean-Baptiste Kempf1:50:22

Kieran is too humble, but Kieran has done some reverse engineering also.

Kieran Kunhya1:50:25

Of, of CineForm, yeah, at the time, um.

Lex Fridman1:50:27

CineForm, nice.

Kieran Kunhya1:50:28

Yeah, at the time before, um, actually led to the open sourcing of that work. Um, so in parallel to doing the binary side, you obviously have samples. In many cases, you don't have many samples, um, so you have to figure out what all the different flavors are, and you may have a...

So CineForm, for example, is actually a collection of different approaches and toolkits within that codec 'cause often it, it grows naturally. And, and the hard part is finding the sample that gets you kind of somewhere to start without having to implement 10 different other things.

So start there. I think thankfully at the time I found a sample by pure chance that had a lot of flat blocks. It was animation, so that really helped a lot because it wasn't using particularly complex coding tools, et cetera, and you could kind of get somewhere and then, and then build up and build up until you figure, "Hey, here's a few bits here.

I missed this. I missed this, this if branch that it does," and go, "Oh."

Lex Fridman1:51:18

So when we say samples, you mean sample videos.

Kieran Kunhya1:51:20

Yes.

Lex Fridman1:51:20

And then, and then you're tracking, trying to infer, like, what is this codec doing-

Kieran Kunhya1:51:25

Yes

Lex Fridman1:51:25

... by observing the sample and then looking at what, at the lo- at, at the machine lo-

Kieran Kunhya1:51:31

The machine code saying-

Lex Fridman1:51:32

At the machine code

Kieran Kunhya1:51:32

... "Ah, I have byte, this byte is six. Take this branch." And in a different sample, oh, it's-

Lex Fridman1:51:37

That's nuts, man.

Jean-Baptiste Kempf1:51:38

And, and, and, and, and-

Lex Fridman1:51:38

That is nuts

Jean-Baptiste Kempf1:51:39

... so you see, this is nuts. Then you go to things like GoToMeeting.

Kieran Kunhya1:51:42

Yeah, yeah.

Jean-Baptiste Kempf1:51:43

It's like-

Kieran Kunhya1:51:44

Mine was easy, right?

Jean-Baptiste Kempf1:51:45

... ima- imagine-

Lex Fridman1:51:45

Yeah, right

Jean-Baptiste Kempf1:51:46

... two order of magnitude of more complexity. A guy alone somewhere in Germany doing that.

Lex Fridman1:51:54

Yeah.

Jean-Baptiste Kempf1:51:54

And for a long time, you work, you're in a black box because a decoder, for a long time, because there is so many step from the entropy decoding, the intra prediction, the motion prediction, the IDCT, and so on.

For a long time, you don't see anything, right? So you're debugging purely in memory.

Kieran Kunhya1:52:10

Debugging guesswork, and you may have the buffer that the coefficients are stored in completely wrong, and so you may be going down a complete rabbit hole thinking it's this, and then, oh damn, that's not, that's, that's something else, and-

Jean-Baptiste Kempf1:52:21

And you're doing that on binaries that are tens of megabytes, millions of instructions, right?

Kieran Kunhya1:52:28

So you're stepping through the debugger, like one by one, you know, instruction by instruction going, "Hey, this instruction changes this. This does this."

Jean-Baptiste Kempf1:52:35

Pausing the program on the CPU level. Like it's-

Kieran Kunhya1:52:37

Pausing it, yeah, on the CPU level, watching what's going on, trying to figure out.

Jean-Baptiste Kempf1:52:39

S- sometimes you need to, like, be in a VM, so yeah, that you can pause the VM.

Kieran Kunhya1:52:43

Yeah, pause the VM, dump the memory, 'cause there could, some of the codecs could have encryption. There could be, um, like a DRM on there. So you need to dump the memory from a virtual machine.

Jean-Baptiste Kempf1:52:52

Like, when I joined Décodage Central Paris in 2003, John Lesch Johansen basically broke the DVD specification and created DCSS, showed us how he was breaking a DRM, which was MP4 FairPlay from Apple. What he did on his laptop, and I was young, I was 21, was just like mind-blowing because he was basically debugging Windows in- inside a type of VM with ex...

Like, wow.

Lex Fridman1:53:18

It's incredible. It's mind-blowing and inspiring. Does it get, like from your experience and from what you've seen in the community, does it get discouraging? Does it get-

Kieran Kunhya1:53:26

People help you. People send you samples. People are keen. Sometimes you don't have access to an encoder, so this is even more difficult because you just, you just ask and you have to ask for samples. I remember VideoLAN used to tweet for samples at one stage.

"Hey, I need this obscure sample," and-

Jean-Baptiste Kempf1:53:42

For a long time I was, "Oh, I need this codec and I need this codec."

Kieran Kunhya1:53:45

And, and, and if you were really lucky, you would find like... If you were un, if you were unlucky, you'd get like one or two, you'd get nothing or you'd get one or two, and then there would... Sometimes you'd find a goldmine.

It's like, "Yeah, my company has 100,000 of these files because we're dependent on it for some reas-" Um, and so those are the, those are kind of the best if, if, because then they can test bit exactness across the huge range of coding tools.

Lex Fridman1:54:06

Can you explain bit exactness?

Kieran Kunhya1:54:08

Bit exactness, so, um, most but not all video codecs, certainly from about the 2000s onwards, have a bit exact definition, so every implementation must produce exactly the same bits, bit for bit, in exactly the same data that comes out of a decoder.

Lex Fridman1:54:26

For like a large number of samples?

Kieran Kunhya1:54:29

For a given sample. So Lex's implementation, JB's implementation, and my implementation of H.264 must match bit exactly. That wasn't the case in the '90s of MPEG-2, probably fair to say one of the biggest mistakes the video industry made, and I think people who were in the room in '92, I don't think, most, both of us were in diapers, I suspect.

But, um, have acknowledged, um, I, I would give a shout-out to Yuri Resnick. He's acknowledged that was one of the big mistakes of the era.

Lex Fridman1:54:56

And you're saying the encoders needed to be able to run tests and then the, the, the bit exactness. I mean, that's a nice thing to guarantee.

Kieran Kunhya1:55:05

Yeah.

Lex Fridman1:55:05

Like, there's a parallel sort of development here on, uh, the way the, the web browser works, which is, you know, takes HTML and displays it and there's no bit exactness there across the different engines.

Kieran Kunhya1:55:16

I would, I would point out actually FFmpeg is unique in the sense that it's, it has been a winner-takes-all scenario. You have... Brow- browsers is a good analogy because it has to parse a lot of different content and render it in a particular way like a decoder.

But there still are multiple browser engines. There's Firefox's one, there's Chrome's one, there's a few Japanese ones that are pretty decent. That's not been the case in multimedia in general, um, across a wide range of codecs. FFmpeg has kind of won it all, I suppose, in a sense because of, because of the fact that you can get every new codec added is actually worth more than the value of that codec itself because it makes the whole thing better.

Lex Fridman1:55:53

Man, this is really cool. Uh, going to Perplexity, Yuri Resnick is a multimedia and signal processing researcher, got his PhD in computer science from Kyiv University with over 150 papers and more than 80 granted US patents, contributor to major multimedia standards including H.264, MPEG-4, AVC-H.265, uh, MPEG-4 ALS, G.718, and-

Jean-Baptiste Kempf1:56:17

G.71 is telco stuff. Telco.

Lex Fridman1:56:19

Oh. And so he was more connected to company-

Jean-Baptiste Kempf1:56:22

Real audio, real video, right?

Kieran Kunhya1:56:23

Yeah.

Lex Fridman1:56:23

Oh, yeah.

Jean-Baptiste Kempf1:56:24

That was very important at that time.

Lex Fridman1:56:25

Xencoder, Brightcove, Context. This, man, I need to hang out with Yuri. He's legit.

Kieran Kunhya1:56:30

Yeah.

Jean-Baptiste Kempf1:56:31

And he's like one of the most nice person-

Kieran Kunhya1:56:33

Slack guy, yeah

Jean-Baptiste Kempf1:56:34

... ever, right? Like, uh, like, um, for example, for, for my n- for my startup, uh, that I'm doing right now called Kyber, right? I met Yuri, uh, because I met him every year at the Mile High Video, uh, Conference, which is in Denver.

Um, and he w- he gave me like so much good ideas and, and good things. He's like really amazing person.

Kieran Kunhya1:56:53

He tell, he tells us how, how, you know- How great it is to be, you know, even know us. And then we just like, you know, you look at that and it's, I think it's the, I think, I think it's the other way around, Yuri

Lex Fridman1:57:02

That reminds me of a thing that you, uh, mentioned to me about FATE testing and, like, the insanely rigorous process that's used to test everything that's incorporated into, um, into FFmpeg. Can you take me through the testing process?

Kieran Kunhya1:57:15

Yeah. So FFmpeg has a system called FATE, FFmpeg Automated Testing Environment.

Lex Fridman1:57:19

Mm-hmm.

Kieran Kunhya1:57:19

Because FFmpeg runs on so many different OSs and can be compiled with so many different compilers, there's been a crazy number of configurations. So you can see the absurd combination of, um, compiler variants, operating system variants, instruction sets.

You can see at the top macOS has tons of different variants because it has iOS, it has tvOS.

Lex Fridman1:57:43

Well, I'm looking at a page fate.ffmpeg.org 81 minutes ago, 76 minutes ago, looking at the different architectures, the operating systems, the different compilers, Apple Clang version, uh-

Kieran Kunhya1:57:58

Combinations are crazy

Lex Fridman1:57:58

... the combination is insane. RISC.

Kieran Kunhya1:58:00

So these are all run by volunteers, so these are all volunteer systems. The, the ones at the top, for example, the Macs I host in my office, for example, uh, host all sorts of different stuff. Other people host other things.

So it's really there to make sure, um, c- because FFmpeg does quite complex C code, for example, you do have miscompilations. So the compiler will sometimes compile C code incorrectly. For example, this happens once in a while.

Lex Fridman1:58:25

Oh, there's like, there's a log of all the compilations.

Kieran Kunhya1:58:29

Yeah, log of all the compilations, all the tests. I think one of the other ones will show all the tests passing.

Jean-Baptiste Kempf1:58:33

If you click, you can see all the tests-

Kieran Kunhya1:58:35

Yep

Jean-Baptiste Kempf1:58:36

... back. All tests successful.

Kieran Kunhya1:58:38

In logs test, yeah. So you see all those tests are passing

of all the different codecs, all the different filter transformations, all the- The, the level of scale is, is quite crazy.

Lex Fridman1:58:50

Oh, that's nuts.

Kieran Kunhya1:58:50

On all the combinations. It's, it's not just a matrix at this point. It's like a pivot table of different combinations.

Lex Fridman1:58:56

That's nuts.

Kieran Kunhya1:58:57

And it, it's a key part of what we do because you, you may be able to test something locally, you make a change, but actually that breaks GCC version 11 on Mac or something like that, and you're able to then fix that.

We also have miscompilation, so the C code, sometimes the compiler can have a bug in it where it creates the wrong output, and that can have quite a big effect sometimes on a vid- on a video because of the way frames have dependencies.

Even a small change in the output can, can cascade to actually quite big glitches.

Jean-Baptiste Kempf1:59:28

You see PowerPC, you see RISC, you see ARM.

Kieran Kunhya1:59:31

There was PowerPC, there was RISC, there was weird stuff in the past like DEC Alpha. There was-

Jean-Baptiste Kempf1:59:35

You see Visual Studio, different versions of Clang or GCC

Kieran Kunhya1:59:37

... Visual Studio, Intel compiler, Apple Clang, you name it.

Lex Fridman1:59:41

What are some of the pain points? Like maybe do you have emotional triggers, uh, maybe nightmares about a particular operating system, a particular container, codec combination of-

Kieran Kunhya1:59:54

I mean, for, for me, it's really easy because, uh, so I, I have a day job. Um, my company builds... The company I started builds, um, equipment for broadcasting sports matches between TV stadiums and studios, for example. We have to work with 10-bit video, and 10-bit video has, um, a set of challenges that you can't process 10-bit data natively on a CPU.

So that means you have to stick it in, um, 16 bits. So that means you have six wasted bits. So there's different packing formats to actually pack the data more efficiently because when you send that over a network, you lose...

'Cause you need to, you need to save that 40%. For example, on PCI Express, you may only have bus bandwidth to do that. And so I think internally we have about... Some, some are, some are industry ones and some are internal to our own hardware that we build.

We have a, I think a 5-by-5 or 6-by-6 matrix of every single format to every single other format conversion. In fact, one, one of them I sent you, and they're all written in handwritten assembly, and they're all written, and they all support different CPU generations.

So this is really traumatic, handling all these different combinations times a million.

Jean-Baptiste Kempf2:01:02

By the way, the company you're talking about is Open Broadcast System.

Kieran Kunhya2:01:04

Yeah, so no, no relation to the free OBS streaming service.

Lex Fridman2:01:07

Yeah. Yeah.

Kieran Kunhya2:01:08

Um, but JB and I have started companies broadly speaking around the FFmpeg VLC ethos, so that's really low-level work. So, so in most companies, this, this wouldn't be written in assembly. C- It would be accepted that C's, C is fast.

Um, as you can see from that, C is not fast. Um-

Lex Fridman2:01:26

Uh, so here it says 62 times faster than C.

Kieran Kunhya2:01:31

Yeah. So it's taking those, the ethos of doing low-level programming, real-time programming, and take- using that for commercial applications, and JB and I have started companies around that, in many cases hiring developers from the open source community to use that ethos and, and so that, that's a great example of, of some of the things we're doing.

In most companies, it would be say, "Oh, I'll write this in C and it's fast and we're done." But actually you can get a lot better.

Jean-Baptiste Kempf2:02:00

For me, like some of the headaches we have is around some OS that are difficult to support, right? Because, um, uh, if you look at VLC and thanks to FATE and FFmpeg, we run on... The last version of VLC runs on Windows XP and still run there and runs on Windows 11.

Um, we work on macOS 10.7 to the la-latest macOS, whatever it is, right? Uh, 26. Um, we work on iOS since iOS 9, well, we are actually iOS 26, right? We support, um, we support, uh, many types of Linuxes, BSD, Solaris.

The last version still runs on OS2, right? Like there is maybe 10 users of OS2 in the world, and one of them is maintaining VLC. Then you realize that this very small team around VLC and using FFmpeg codecs and, and all the other ones support more OSs than Microsoft or Google or Apple, and they have infinite amount of, uh, of, uh, power and resources.

But for example, the worst is iOS. Um, for, in order to build on iOS 9, we need to do some very clever mixing of several version of the Xcode IDE and SDK from Apple, from several version, and do a type of Frankenstein version of that so that we can still support iOS 9, which is not supported at all by the, the compiler of, uh, uh, of, uh, Apple in order to still run on Arm32, um, on iOS 9.

And you've seen on Fate that it was still supporting iOS 9, right? So, so, um, my headaches are mostly related to the, the support of so many OSs. And it's important because, like, we receive so many people saying, "Hey, thank you.

I still have my iPad 2 to watch movies, and it still works on iOS 9," right? And it's also an impact of, like, not forcing people to buy new hardware when it works fine if you optimize it correctly, which brings us to what we were saying about Assembly.

It's also fighting, like, the fact that you need to buy something new nonstop, uh, while you could optimize more, which is a lost art.

Lex Fridman2:04:19

You gotta tell me about this lost art or this, uh-

Jean-Baptiste Kempf2:04:24

Yeah

Lex Fridman2:04:24

... the, the carriers of the flame of Assembly. What, uh, what is, what, what is Assembly? Why is it beautiful?

Jean-Baptiste Kempf2:04:32

Yeah.

Lex Fridman2:04:32

Why is it challenging? How does it work?

Kieran Kunhya2:04:34

So when you write Assembly code, you write this using the instructions the actual processor is using directly. So most of the time you would write in a language, let's take C as a good example. The compiler would use that to create, um, Assembly language and machine code instructions for you based off your C code.

And th- there's a specific flavor of Assembly that we use in FFmpeg that's called SIMD, SIMD, single instruction, multiple data. So this means, for example, say, say I want to add five to a number in scalar Assembly, so this is what's known as, you work on an individual element.

So I wanna have a number of-- I have the number 10 and I want to add five. I use the add instruction and I add five to 10 and I get 15. With SIMD, with SIMD, I can have a whole vector of 16 different numbers that could all be different.

If I want to add five to that, I can, I can run one instruction and that one instruction sums all 16 elements. And that, as you can imagine, lends itself very well to video. Video, uh, video is, you know, a pixel grid, so I can perform operations on multiple pixels at the same time.

The key thing that we do differently in FFmpeg is we don't use any abstractions or any major abstractions on top of that. So there's a part of the world that uses what's known as intrinsics. So these are C functions that behave very similarly but not quite the same to writing Assembly by hand.

So the registers that data i- uh, is stored in on the CPU, the compiler allocates those for you. And so the key thing to understand was when we write SIMD is we have a 10x, and not percentage, 10x to 50x speed improvement.

That, that function is 62x, um-

Lex Fridman2:06:22

That's nuts

Kieran Kunhya2:06:23

... on the FFmpeg account, as you know, posts and tweets a lot about that to try and say, "Hey, we're doing this stuff."

Lex Fridman2:06:29

You are a person who sees the beauty in Assembly, but it's also extremely useful for these kinds of application to actually-

Kieran Kunhya2:06:36

Yes

Lex Fridman2:06:36

... significantly outperform even C, which is crazy.

Jean-Baptiste Kempf2:06:40

It is necessary.

Kieran Kunhya2:06:42

Yes.

Jean-Baptiste Kempf2:06:42

Right? Because, like, one of the projects, um, that we need to talk about is called David, right? So David is a decoder for the format, uh, that was done by Alliance for OpenMedia, uh, which is an, a video decoder called AV1.

Lex Fridman2:06:58

So it-- For people who don't know, we've been talking about H.264. AV1 is another hugely popular standard and codec that is increasingly taking over, uh, the internet.

Jean-Baptiste Kempf2:07:13

And when this format was launched, uh, many people said, especially even from the Alliance for OpenMedia, right, which is Google, Netflix, Amazon, uh, Mozilla, say, "Well, this format is so complex it must be done in hardware to do decoding," right?

And well, I arrived, uh, with a few other people, uh, mostly, um, Ronald, uh, Henrik, and Martin, and we said, "We need to have an extremely good software decoder, uh, because it's going to take time to have hardware."

And so we wrote this project, which is beyond insane. Um, we are talking about 30,000 line of C, but 240,000 lines of handwritten Assembly, right?

Lex Fridman2:07:57

Handwritten Assembly, 240,000 lines. That's incredible. That mean, I mean, some of the stuff we're talking about is probably the biggest Assembly, uh, code bases.

Jean-Baptiste Kempf2:08:10

To give you an idea, and Kieran can correct me, but I think the FFmpeg has 100,000 lines of Assembly for all the codecs.

Kieran Kunhya2:08:17

For all codecs. Mm-hmm.

Jean-Baptiste Kempf2:08:18

And just this one has 240,000. Um, it's a VideoLAN project, of course. Um, and it is optimized at the maximum because the motto when we're starting the project is every cycle matters, right? Every cycle matters because David is used in VLC and in some software AV1 playback stacks.

We are talking about probably three billion devices which are going to decode video nonstop because, for example, 30% of the video from Netflix are now in AV1, 50% of YouTube, right? So, and you often don't have a hardware decoder because not many devices have a hardware decoder.

And with David, we realized that with one or two cores you were able to decode 720p correctly. So it is, like, literally-

Kieran Kunhya2:09:08

Yeah, that's David

Jean-Baptiste Kempf2:09:09

... incredible, right?

Kieran Kunhya2:09:10

That's David. Look at that legs.

Lex Fridman2:09:11

Yeah. So this is, uh, another spicy tweet from you. "This is what peak video codec should look like."

Kieran Kunhya2:09:18

79.9% assembly, 19.6% C, and, uh, 0.5% other

Jean-Baptiste Kempf2:09:26

And, and what's incredible is with those tweets, which is factual, people get crazy. They are unhappy, right? They say-

Kieran Kunhya2:09:34

For year-- For the last two years, they go crazy. "No, intrinsics is fine. The compiler is..." Oh, they go, "I have never-"

Jean-Baptiste Kempf2:09:38

"You can optimize your compiler. Auto-vectorization, it's your fault. You don't understand." And we've tried that forever, right?

Kieran Kunhya2:09:45

For two years, and two years later, showing hundreds of examples of, of handwritten assembly. "No, no, no, you're doing it wrong. The compiler can do this." So w-we should actually just articulate a little clearer. So the intuition there from the software engineering folks, when you have code like, okay, let's just take an example, C++, there's a compiler that's doing a lot of the optimization.

Jean-Baptiste Kempf2:10:06

Yes.

Kieran Kunhya2:10:07

And the presumption is if you have a good enough compiler, if you continue to improve the compiler, you're going to generate code-

Jean-Baptiste Kempf2:10:13

Yeah

Kieran Kunhya2:10:14

... that can perform like optimal performance. You cannot possibly beat it.

Jean-Baptiste Kempf2:10:19

Yeah. Yes.

Kieran Kunhya2:10:19

And you're consistently challenging that thought that if you do-

Jean-Baptiste Kempf2:10:21

By orders of magnitude.

Kieran Kunhya2:10:22

By orders of magnitude-

Jean-Baptiste Kempf2:10:24

Yeah

Kieran Kunhya2:10:24

... handcrafted assembly can outperform C.

Jean-Baptiste Kempf2:10:27

The two things that they tell us is, yeah, but modern compilers have auto-vectorization, right? Because SIMD that we're doing is vectorization, and like it's not even close, right? It's not even close, right? It's not like 5%, 10% slower.

It's multiple times slower.

Kieran Kunhya2:10:43

So can we... I don't know if you can say something philosophically, 'cause there's a lot of, there's a lot of great software engineers, great engineers, great machine learning people. Karpathy will listen to this and say, "What's the intuition he's supposed to get from this?

What are we supposed to..."

Jean-Baptiste Kempf2:10:57

Karpathy learned assembly because of the tweets, by the way. I just- He start... He, he went, he's like, "Oh, I think this is a movement."

Kieran Kunhya2:11:02

He's like, "Let me figure out what's happening here."

Jean-Baptiste Kempf2:11:02

No, no, he, and, and you know the way he documents his work and so. Philosophically, what's important to realize is that we passed the time where hardware was going so much faster, right? We're at the end of the Moore law.

We have limitation for, uh, for AI, for memory. You need to go down in the stack and optimize more to get more power from what you have because our request for power, CPU power, GPU power are exploding while the hardware is not exploding in speed, right?

Kieran Kunhya2:11:35

Mm-hmm. Yeah.

Jean-Baptiste Kempf2:11:35

So you-- What people do is that they add more cores, right? But that's basically like at some point you can have 250 cores, right? So what we do is to take every inch of the machine-

Kieran Kunhya2:11:47

Not just that, not just that. We, we abuse the machine. We, we, we go and use, we use the machine in ways that the, that the creator didn't expect. Sometimes we use an instruction that's completely unrelated to what we do.

We use a cryptography instruction in video processing to do nothing related.

Jean-Baptiste Kempf2:12:02

And one of other things that we do, for example, uh, in David, which is a bit crazy, is that we don't use the function calling convention from the operating system.

Kieran Kunhya2:12:14

We should explain that.

Jean-Baptiste Kempf2:12:14

That is extremely complex.

Kieran Kunhya2:12:16

Yeah.

Jean-Baptiste Kempf2:12:16

But basically, usually when you do move from one function in, in code to another, there is a way to save the registry, the state of the CPU to enter another function. Um, and this is like standard.

Kieran Kunhya2:12:28

It's a bit complex. I would, I would simplify this a bit. So, so David does things to abuse the calling convention. You could define the calling convention as I've written a function, and I want to call another function.

How is the data shared between the functions? Because there, there's a convention, what's known as a calling convention, and what David does for optimal reasons is create its own calling convention sometimes. So if I wanna call Lex Fridman's library, we got, we've got to agree on a convention so that I can share data with you in the assembly language space.

And one of the challenges in assembly is, uh, every operating s- well, not every operating system, but there are, well, at least four that I can think of on x86, Li- Linux 32-bit, Windows 32-bit, Windows 64, Linux 64.

They all have their own calling conventions. And so one of the amazing things Lorin Merritt did, who we talked about before, was create a very lightweight abstraction layer, so you could write your assembly code once, and it handled all the calling convention stuff for you, which was always a problem because you had to manage four different variants.

But David takes this even further that for speed reasons, it does its own calling convention, um, within itself to bypass the kind of rules, the rules of, the rules of sort of, of functions and say, "Okay, actually, I'm gonna call a function this way because I know it's within my library."

Does it have to be special to every single operating system? Well, if it's custom, no. But the, the, the challenge is in general, yes, and in terms of, in terms of each instruction set. So the thing to also emphasize is we do this on every instruction set.

So every instruction set has its own handwritten assembly, which is even more crazy, and that, that, that has, um, that matrix has got bigger in recent years because of RISC-V, because of ARM64, because of the new, uh, SVE.

There's SME. X86 has AVX-512, AVX. So we do runtime processor detection. We see what the machine FFmpeg is running on or David's running on is capable of, because you could be on a laptop from 2008 where this isn't there.

Runtime detection, we set function pointers accordingly.

Jean-Baptiste Kempf2:14:32

Mm-hmm.

Kieran Kunhya2:14:32

And then from then on, off you go. Or you could be on a machine with RISC-V.

Jean-Baptiste Kempf2:14:36

Yes. And in all that, we don't even respect the calling convention of the operating system in order to be faster, because we know that we are going to be called from within our binary, so we can share data without saving all the registry in the common way, because that can lead to loading and saving registry on the L1 and L2 CPU and gets us faster.

So that's why I said that understanding CPU architecture, computer architecture is key, and this is also why it's handwritten. I don't know anyone. I've never heard any other project than David doing that. This is what Kieran calls it, calls it an art, right?

It is an art.

Kieran Kunhya2:15:15

I think, I think in a, in a mass world, there isn't something on billions of devices. I, I know there are some specialist industries. I know in high-frequency trading they take this really seriously, where they're receiving feeds from a market, and they need to react within X number of microseconds, and so the instructions matter.

But that's not a mass, you know, a mass-produced thing that's on a billion devices. That's hyper-specialized running on hyper-specialized hardware. We're running on all hardware from- Sorry to linger on it, but, like, that, that's a really counterintuitive, almost like revolutionary

Lex Fridman2:15:46

The idea here that there's a huge amount of value to assembly. Like what are we supposed to take away from that? Like what-- You know, there's a bunch of people listening to this, they're basically like, sorry, f-for myself included, you know, I, I programmed for many, many years in C, C++ going up the standards of C++, fell in love with C++ even in the meta program and so on, and then transitioned more and more because of machine learning about 15 years ago to Python.

Jean-Baptiste Kempf2:16:12

Yeah.

Lex Fridman2:16:12

And so like for me in this Python world, JavaScript world, now vibe coding where I'm just using natural language sitting in my jacuzzi drinking a drink and just talking to the computer re- like, like record stops, why is the value w- to go back all the way down to the low level?

Like what's the intuition?

Jean-Baptiste Kempf2:16:32

Because you can get more power per dollar invested, right? And sometimes it's going to be a problem that is limited by your hardware. A, a, a good analogy is what you see in quanti- quantization in, in LLMs, right?

And people are doing, "Oh, I'm going to do that in FP8 or FP, FP4," or some k- some crazy things like Microsoft Phi who did in 1.5 because you're constrained by memory, because you're constrained by the machine you can run.

Because at some point, uh, we are doing real time, and I believe this is going to happen on AI inference also, is that at some point you need to ge- get faster, and you cannot always get harder, uh, more powerful hardware, right?

So you need to analyze code and see where, like where is the mission critical, where is the things that are called nonstops. And for example, David is a good example. It's going to be run billions of hours per day.

Lex Fridman2:17:29

Yeah.

Jean-Baptiste Kempf2:17:29

That makes sense. It doesn't make sense to be on the glue of FFmpeg-

Lex Fridman2:17:34

No

Jean-Baptiste Kempf2:17:34

... uh, CLI. It makes sense over there.

Lex Fridman2:17:36

Yeah, this has to do, also we'll talk about it more, but uh, your, uh, new effort, your new company, Kyber, is doing that kind of thing for ultra-low latency, so the slogan being every millisecond counts. And when you actually extremely highly constrained in some dimension-

Jean-Baptiste Kempf2:17:53

We are also arriving at a point where we've done so many great things, but the hardware is getting back to us, right? Because cost is increasing, because we need more power, and so you're limited by either, uh, your CPU, your RAM, or your networking, and you need to optimize, and this is where value is going to be.

Especially because like doing AI is going to help do the programming of like business, right? And so the core thing that you will not be able to, uh, vibe code are optimization for the hardware to be as fast as is possible.

Lex Fridman2:18:31

I'd love to talk to you about who and how should learn assembly. But first, I think we need a bathroom break. Quick ten-second thank you to our sponsors. Check them out in the description. It really is the best way to support this podcast.

Go to lexfridman.com/sponsors. And now back to the episode. All right, and we're back. There's this, uh, nice repo with the assembly lessons. First of all, do you think, uh, developers should learn how to program in assembly, and how would you go about learning it?

What is this ASM-lessons?

Kieran Kunhya2:19:08

So I, I personally wasn't happy with the way assembly is taught in books and online, 'cause it's very grammar-focused, and you don't in general learn a language from learning the grammar and the structure. Y- y- you learn a language by asking someone what their name is, and you start from there, and you go and solve real problems, uh, that you have when you want to communicate.

You don't, you don't learn sentence structure, and this is the interrogative and the adverb, and all, all the assembly books seem to be doing like that, going through every instruction, even ones that aren't really relevant, explaining what they all do and how they...

It, it actually doesn't really change much. So, and the other problem that we have in our community is assembly is taught sort of hand to hand, like person to person, like blacksmithing one by one. That's, that's the only logical sort of analogy, and that doesn't really scale online.

It doesn't, um, do other things. So this, this le- this, this-- I started a set of assembly lessons in the, in the way it's done in FFmpeg, which is a little bit different to the way assembly in general for...

I don't know. I'm trying to think the other good big use case of assembly is in embedded devices, in really, really low power, cheap devices, and that's completely different to what we're doing here. I think it would be good if you could highlight the requirements, which are quite simple.

It's high school mathematics and C, and actually not even C. Really, really it's pointers. To emphasize, yes, we've talked about how brilliant this stuff is, but high schoolers like Daniel Kang have written, um, assembly in FFmpeg. I think there's been contributions because of these lessons.

So it's really about trying to s- to get this dying art to continue, because we've shown it's possible with David to produce something amazing.

Lex Fridman2:20:46

Mm-hmm.

Kieran Kunhya2:20:47

There's still a lot of codecs in FFmpeg that are only maybe partially assembly, um, assembly optimized. And so it really, it really starts with basics and continues, explains a lot of the jargon, a lot of the syntax. It doesn't really try and explain to you, you know, interrupt handlers and interrupt instructions and all of these different jump targets.

It actually makes this really vector-focused.

Lex Fridman2:21:09

And, uh, describes all kinds of registers, uh, general purpose registers, vector registers, uh, really nice examples. Oh, this is cool.

Kieran Kunhya2:21:19

It's a classic. Yeah, it's a classic example of FFmpeg. But, um, some of this assembly language is, is, is really beautiful, and I, and I think it's beautiful because it's kind of like flying a Spitfire. It's really aviation at its purest, but also pushing the aircraft beyond what the designer thought was possible.

So we're abusing, for example, sometimes cryptography instructions to do certain things, and there's a level of beauty in art where it's really you and the processor.

Lex Fridman2:21:46

Mm-hmm.

Kieran Kunhya2:21:46

There's, there's, there's nothing in between. It, it's you and the, the, the joystick of the cockpit and y- and you, you move that joystick and it's physically connected to the ailerons, and you can push that plane beyond what it can normally do, and th- there's a level of, yeah, beauty and am- amazingness to go that.

But I don't think the sort of person by person assembly that someone taught me and I've taught multiple people is gonna work long run because of the particular flavor and the way that we do it.

Lex Fridman2:22:17

It's literally, uh, no, I should... I was gonna say wizards handing it down. Um, I realize I look like a wizard-

Kieran Kunhya2:22:23

Yeah

Lex Fridman2:22:23

... wearing this hat, but you're basically just like the sages, the wise sages handing-

Kieran Kunhya2:22:28

Yeah

Lex Fridman2:22:28

... down the craft. Can, can I ask about LLMs? Like-

Kieran Kunhya2:22:31

Yeah

Lex Fridman2:22:31

... can they help?

Kieran Kunhya2:22:32

They had more of an understanding than I expected, but they are still... I've asked it questions, and it still goes and starts hallucinating. Not hallucinating, but making modifications, and then I go, "Is it bit exact? No, fix it."

And then it just goes and does the same thing, and i- it's going, it... There isn't the corpus of information like Stack Overflow to work on.

Jean-Baptiste Kempf2:22:53

There is not enough data to train on. Um, and this is the biggest issue. Um, I, I started my career actually doing some, uh, assembly for Itanium, right? So the Itanium is a dead, um, processor type, right? Which was done by Intel and HP a, a long time ago when they wanted to do 64 bits.

Uh, well, they lost, and then we got AMD who did it, AMD 64, which became x86-64. But Itanium was extremely interesting in the sense that, um, those were processors who had a ton of computing power to do floats, FMAs, which is similar to what we need now for, for LLMs, right?

And you could pack three operations per line that could be loaded. So basically, you had an output of basically six billion of operation per second, but the bus, um, the, the memory bus only allowed 1.5, right? So your, your CPU was four times faster, so you had to do crazy things to, to pack things in memory or reuse the registered, and those type of semantics, no language could do that, right?

So, um, like I, I, I have the Itanium programming, uh, book because Intel did amazing books, but that's exactly what Kieran says. If you don't know what you're, you're, you're going to do, it's impossible to read, right? It's a ton of jargon and so on.

While those lessons are amazing because they are targeted to a real problem, and you can do it yourself.

Kieran Kunhya2:24:22

And people have. People have. There are patches, and they said, "Oh, I studied your lessons, and, um, here's my first changes."

Lex Fridman2:24:26

That's amazing.

Jean-Baptiste Kempf2:24:27

And part of that, um, in the lessons is, is a framework called x86Inc, written by, uh, Lorraine when, when he was working on X264, and it allows you to do more things about that to create a type of like, uh, not caring too much about different calling convention.

And we had a lot of students who, uh, gave code to X264 using, uh, that a long time ago, right? So it's really doable, and I believe it's, um, necessary to understand, uh, assembly language, even if you don't do it much, to understand what's going on inside your computer, and that will make you a better programmer.

And I assure you that because doing that, you will understand some of the architecture of the memory inside your, your computer, right? Understanding register, L1, L2, L3, RAMs, uh, SSDs, disk, and so on, um, which are very important because then you have a good programming culture that will make you a better programmer.

Rust2:25:27

Lex Fridman2:25:27

Uh, what do you think about the Rust programming language? 'Cause that's a bit of a meme.

Jean-Baptiste Kempf2:25:31

We have very different opinions with Kieran.

Kieran Kunhya2:25:33

I, I think it's valuable what they're doing in terms of memory safety as a concept.

Lex Fridman2:25:38

Can it achieve the s- some of the speed up that assembly achieves?

Kieran Kunhya2:25:42

Oh, not, not assembly by hand, no. I think that that's a given. C potentially, but I see it very... It has a very big Esperanto vibe, uh, about it. It's like we're gonna solve this, and we're doing this in a particular way.

Lex Fridman2:25:55

Meaning it's a bit too utopian?

Kieran Kunhya2:25:57

There's a lot of focus on the self-importance rather sol- than solving real world problems. It reminds me of the Sinclair C5. Sir Clive Sinclair of Sinclair Computers built a car, and he said, "Oh, everyone will be traveling around in, in, uh, one of these electric cars."

And it was, um... Rust reminds me of that where I think the community doesn't, the community doesn't quite understand that in order to get people to move, you have to build something that's as good as, if not better than what you have now.

Um, yes, people are doing Rust rewrites, but if they're, if they only, if they only do 85, 90% of the feature set of what, what we need, like things like core utils, that last 1% takes 99% of the time.

Um, to, to use Elon's famous quote, "Prototypes are easy." Like this kind of stuff is easy, but this... To get a real electric car, you have to make a car as good as, if not better than what we have now, and Rust isn't in that stage yet.

I think we... I don't think anyone would object to seeing Rust code in FFmpeg, but it needs to work as well and support the same unit testing as everything else. It needs to be flawless. It, it can't just randomly break.

They can't just randomly break ABI when they want to. It needs to, it needs to have, I think, more... I think it still has only one compiler implementation.

Jean-Baptiste Kempf2:27:12

Yes.

Kieran Kunhya2:27:12

So it- it's got to be as good as, if not better. And saying, "Hey, here's my utopia of memory safety," isn't enough, even though we all, we probably all agree that that's the goal.

Jean-Baptiste Kempf2:27:25

So, um, I've done a ton of Rust, and the two major topics I had was adding Rust modules inside VLC. One of the reasons VLC got popular, um, and which was one of the main architectural decision, is that VLC is a very small core and a ton of modules, right?

And so you can write modules in C, in C++, in Objective-C, and anything that is basically interoperable with C. And, and, and so we ch- we, we did some Rust modules, and so I have experience on that, and, and I wrote some of it.

And also, like my, my new startup, uh, called Kyber, is an open source project mainly done in Rust. Um, what Rust is extremely good in, in the sense that, um- It's a better C++ that cares about memory and allows you to do things about memory ownership that no one else can do so far.

However, it's great when you start a new project from scratch and you do everything in Rust, but it's very not good when you interop with ex-existing part. And some part of the Rust community believes that they need to rewrite everything, and everything will be better with Rust.

And, and the answer is like, no. Like, I'm almost always in all my years of being engineer, manager, CTO of startup and so on, don't rewrite, right?

Lex Fridman2:28:48

Is that-- That's the, that's the initial instinct for a lot of people when they show up to a code base, uh, probably before LLMs, is like b- probably because they don't understand the, the, the wisdom of the way things have been done in the past.

They say, "Well, we need to rewrite it." Hence why there's a thousand JavaScript frameworks.

Jean-Baptiste Kempf2:29:07

But the reason is the following, and this is very important to understand. It is an order of magnitude easier to write code than read code.

Lex Fridman2:29:17

Yeah.

Jean-Baptiste Kempf2:29:17

And you see that also with LLM. They can write code, but analyzing is a lot-

Lex Fridman2:29:22

Mm

Jean-Baptiste Kempf2:29:23

... more difficult. And so when you arrive a-and when you arrive to a very complex piece of code, right? You, you don't understand it, right? Um, because it's so much more effort to understand the code from someone else because you don't have the thought process.

Um, a-and often I joke about, um, some, some languages, uh, mostly, uh, Perl, for example, um, which has very complex syntax. And imagine I am at my maximum intellectual efficiency in programming, right? And I write the best code ever.

I will not be able to understanding myself six months later, right?

Lex Fridman2:29:59

Mm.

Jean-Baptiste Kempf2:29:59

Because reading code is more difficult. So very often you arrive, you don't understand all the wisdom, all the business logic, the reasons that were done that is maybe not documented. And you say, "Well, I'm going to rewrite it."

And the thing is, no, you don't, right? Because that's, as Kieran said, right? I'm going to rewrite core utils in Rust, and then of course you arrive very quickly at 80%, um, then 90% takes a bit more time, and then you got the last ones, right?

On the other side, right? So for new projects, it's great. Everything related to parsing files, uh, networking, uh, because of the memory, uh, checker, memory checker, it's amazing, and there is nothing else. To answer a bit differently for us, imagine I take a, a piece of software like, uh, David or x264, right?

Which has a ton of runtime in assembly, right? Um, I rewrite the C part in Rust, right? So it's more secure. Yes. But then you arrive into the assembly, and you can jump anywhere in the memory because we are doing handwritten assembly.

So even if I rewrite the C part in Rust, for security reason, you, you break all the security when you rewri- you write handwritten assembly because we can jump anywhere. So in my opinion, we need to do something that is, um, secure assembly, right?

So which is compile time, check the assembly, which is similar to the check assembly projects that we're doing on, on David and x264 with VideoLAN, is to start instrumenting your assembly at compile time to check that it's not jumping anywhere in the memory.

Because else you might rewrite a part of C in Rust, but if you want to have the same performances, you're going to have inline assembly, and so you destroy your whole security model. Um, so that's a bit what I think about Rust.

Kieran Kunhya2:31:51

No, I, I just wanna... I, I would say on a personal level, I'm so in awe about the assembly. I actually-- Once in a... It never gets old, the speed improvements to show 62 X. Uh, so there are months on a personal level, I, I run our internal test suite at work and just see I'm still in awe at the gains we have.

Lex Fridman2:32:11

Well, there, there's a source of joy and happiness for programming for different reasons. But I think one of the gr-greatest happiness is, is in the optimization of code.

Kieran Kunhya2:32:21

Yeah.

Lex Fridman2:32:21

And it sounds like you're like at the cutting edge of that.

Kieran Kunhya2:32:25

I was like, "Whoa, that was cool."

Jean-Baptiste Kempf2:32:26

And in the community, I want to speak about two people who are wizards of assembly, right? The two of them are actually working, uh, living i-in north of Europe, uh, Sweden a-and, uh, and Finland. And, um, Henrik Gramner knows so much about Intel x86 assembly that when we ask questions at Intel about things, they tell like, "Why are you asking us Intel?

You have Henrik. Henrik knows better." He knows all the cycles of almost all the SIMD instruction by all the CPU generation. "Oh, yes, this is a P4, this is a Nehalem, this is a Core 2," et cetera. That person is like the best person on assembly in the world.

Kieran Kunhya2:33:12

Yes.

Jean-Baptiste Kempf2:33:12

And he's the nicest person that you've seen, like very... He, he arrive, you don't see, he's amazing. And the other one is, is called Martin, Martin Storsjo, and he's... They're doing mostly the same on Arm, right? So Neon, right?

And iPhones and Androids and so on. And he codes in assembly on his phone, editing it with the crappy, uh, uh, keyboard, like virtual keyboard you have while watching his kids play in the playground, right? Like, like this is just like wizard level.

So those two people are like-

Kieran Kunhya2:33:55

Yes.

Lex Fridman2:33:56

So a part when you're programming assembly at that high level, a part of that is knowing the architecture that you're programming on.

Jean-Baptiste Kempf2:34:03

Yes.

Lex Fridman2:34:03

So x86 and-

Jean-Baptiste Kempf2:34:04

On Arm in particular, yes

Lex Fridman2:34:05

... Arm in particular. But x-x... I mean, these are complicated architectures, right?

Kieran Kunhya2:34:09

Yeah. But, uh, Arm, um-

Jean-Baptiste Kempf2:34:11

In some ways it's more co- X86 with, uh, out of order execution is not so bad. Arm, you really need to understand all the different generations of Arm processor 'cause they're all different. There's A72, uh-

Lex Fridman2:34:22

Yes

Jean-Baptiste Kempf2:34:22

... et cetera, et cetera, and there's the Apple variant, there's this variant, there's that, and you need to write code that works efficiently on all of them. X86, well, broadly speaking, you have Intel, AMD, and you have sub-variants, but generally speaking, there's...

Something fast is gonna remain fast on all of the variants, whereas an Arm is a completely much more complicated ballgame.

Forks & Burnout2:34:43

Lex Fridman2:34:43

We're, uh, taking a non-linear journey through history here, but we were talking about, uh, Michael Niedermayer. Uh, and I, I wanted to ask about this. Uh, for a time there was a split in FFmpeg and, uh, Libav.

Jean-Baptiste Kempf2:35:01

Yes. So, um, in open source projects, um, sometimes you disagree, right? Um-

Lex Fridman2:35:10

You have such a nice way of putting it, yeah.

Jean-Baptiste Kempf2:35:12

And the good thing is because of the license, you're allowed to basically do your own, right?

Lex Fridman2:35:18

Yeah.

Jean-Baptiste Kempf2:35:18

Um, and this is normal, and this has happened all the time, right? For at the point there was a, a GCC at the time of GCC 2 and EGCS, uh, which became then GCC 3, right? There is what we told KHTML with WebKit, with Blink.

Um, it is a same process. And also, like, when I want to do a new feature today in VLC, I fork, I do my thing on my own, and then I merge back to the community. So there was a, a, a split in the open source community on FFmpeg, which become Libav and FFmpeg, and after a few years, well, the community merged back and people moved on.

It's a bit, um, drama that is normal in open source community, but forks are even... They're important because they, they, they change the, the status quo of a community. Um, um, not talking about FFmpeg a-a-and, and Libav here, but the, or the GCC fork made GCC a ton better because the, some people wanted to change the architecture fundamentally to make it faster.

And of course, it's always question of people and so on, but in the end you realize that FFmpeg today is better than it was, uh, before the fork. Um, and now, well, we're back all together, right? Uh, and I spent a lot of time, and, and Kieran can say, uh, in the, in, in the community.

Um, it's not often, to be honest, uh, very well explained, uh, because a ton of the reasons are not very public. Uh, but I think that's, that's normal and that's good.

Lex Fridman2:36:50

Yeah, I mean, you're making it sound really nice, but there, there is battle, there's pretty heated battles inside open source projects. I mean, it is a very passionate community and you're kind of in a distributed way have to define the direction of things.

Jean-Baptiste Kempf2:37:02

Yeah.

Lex Fridman2:37:02

So here looking at, uh, Perplexity, "FFmpeg and Libav split in 2011 mainly over project governance, leadership style, and development processes, not because of a fundamental technical disagreement. Uh, FFmpeg effectively absorbed Libav's work while Libav withered and most distributions and developers moved back to FFmpeg."

Yeah, that was a, that was a weird, that was a we- From a user's perspective, that was a weird experience 'cause, you know, I'm a Linux user, so, you know, whether it's Ubuntu and so on, all of a sudden, I think for, for a c- for, for a little bit, Ubuntu, I feel like, am I remembering correctly, switched to Libav and-

Jean-Baptiste Kempf2:37:39

12, 14, something like that.

Lex Fridman2:37:41

Yeah.

Jean-Baptiste Kempf2:37:41

Something like that.

Lex Fridman2:37:41

And then they switched back to FFmpeg.

Jean-Baptiste Kempf2:37:43

They switched back, yeah.

Lex Fridman2:37:43

I was like, "What is happening?" So on the sort of, um, you f- you get to feel the ripple effects of the different internal debates that are happening.

Jean-Baptiste Kempf2:37:53

To be fair, on Apple, when you type GCC, you get Clang. Like they, they did something like that as well, so.

Lex Fridman2:37:59

Yeah. So, so to me it's like the fork was like heated drama, but most of the development from Libav was merged back into FFmpeg, right?

Jean-Baptiste Kempf2:38:09

Yeah.

Lex Fridman2:38:09

So de facto FFmpeg got a s- a, a superset around Libav, and so that gave the user, because in the end we work the user, for the users, a, a larger set of features and a ton of things that were, um, discussed.

Jean-Baptiste Kempf2:38:23

Mm-hmm.

Lex Fridman2:38:23

For example, the debate on reviews, on, on how we push are something that now is completely settled in FFmpeg and is following what mostly what everyone in the community agrees, right? So de facto everyone who was active on Libav came back i-in, work on FFmpeg because l- the disagreements were fixed and in the end FFmpeg is stronger, uh, than it, it was before, right?

And-

Jean-Baptiste Kempf2:38:49

Mm-hmm

Lex Fridman2:38:50

... I know people love drama, but, um-

Jean-Baptiste Kempf2:38:52

Well, my, my main concern, I, I understand and I think looking at the, the long history, it's all for the good. But I do, I am concerned because there's so few humans that are critical to the success of open source projects that I have seen it, uh, be a psychological toll on folks and, you know, sometimes leads to burnout.

So you have these incredible people that are at the core of open source projects. There is a moment that happens 'cause, like, what is the motivation of doing it? Uh, ultimately it's because you're passionate about it and it makes you happy.

Then at a certain point you wake up and it's like, "This's been a bit too much heat from the drama." So, like, at the, at the project level, the project continues and often flourishes, but sometimes there's these individual humans that are just like-

Lex Fridman2:39:44

But-

Jean-Baptiste Kempf2:39:44

... "I've had enough."

Lex Fridman2:39:45

Yeah, but it's not just about forks, right? So there's a g- very-

Jean-Baptiste Kempf2:39:48

Yes

Lex Fridman2:39:48

... what, what you, what you are, um, referring to is, uh, one of the most challenging and most interesting part of, uh, open source today is maintainers burnout, right?

Jean-Baptiste Kempf2:40:00

Mm-hmm.

Lex Fridman2:40:00

And AI is a problem because of that. And Daniel Steinberg, which is, um, the maintainer of Curl, uh, who's probably one of the best promoter of open source in the world. He's, by the way, a member of the European Open Source Academy with me, so I'm very, like, humbled to be on the same community as him, right?

He's against what he call AI slop, right? Because it gives a ton of, um, uh, fake

Jean-Baptiste Kempf2:40:26

reports or bad reports, bad patches. And then a lot of maintainers have a lot of burden to maintain the software. And this is, uh, straining the, um, the, the, the mind of open source developers much more than forks.

Lex Fridman2:40:43

Mm-hmm.

Jean-Baptiste Kempf2:40:43

And, and for example, the XZ fiasco was because there was one guy maintaining it, and he got basically hammered by two attackers who were asking him questions nonstop at weird times at night to block him, and at some point he got fed up and says, "Okay, I can't do that," and gave the commit access to the attacker.

Lex Fridman2:41:01

Mm-hmm.

Jean-Baptiste Kempf2:41:02

Um, so burnout in open source community is something that exists, uh, but mostly it's about maintaining things, right?

Lex Fridman2:41:11

No, for sure. But I, I wonder how do we, we help that, 'cause those people are so important. The, the human beings are so important, the core of these pro- projects.

Jean-Baptiste Kempf2:41:19

So, so for example, now I am maintaining a ton of multimedia and non-multimedia library-

Lex Fridman2:41:24

Mm

Jean-Baptiste Kempf2:41:24

... as maintainer, uh, because the maintainers f- got fed up, right? Um, some on VideoLAN, some outside of VideoLAN, uh, because it's sometimes you need a, a, a tough skin, right? Because you get, like, it's not really attacks, but, uh, oh, this is not working, this is not working, and you feel it personally.

Um, and this is also why resources or the, the Google fiasco, um, is, was a problem, right? They don't realize that in the end you have, um, you know, it's like the same graph where you see, like, everything and it's just like one random open source project that is maintaining the whole-

Lex Fridman2:41:59

The Nebraska thing, yeah

Jean-Baptiste Kempf2:42:00

... in-internet. You see the one, right? The-

Lex Fridman2:42:02

Yeah, this is the meme. I mean, it applies to, to a lot of open source projects.

Kieran Kunhya2:42:06

So many things, yeah.

Lex Fridman2:42:06

But this is the all modern digital multimedia infrastructure, and then that thing at the very bottom that everything relies on is FFmpeg. It's true. And then there's usually, you know, a handful of folks that are maintaining that.

Jean-Baptiste Kempf2:42:20

And FFmpeg or VLC, right, you have a community of 10, 15 core developers, are not the worst open source project. XZ, which is even in more installations, is one person, right? There is one guy-

Kieran Kunhya2:42:33

LibXML is, uh-

Jean-Baptiste Kempf2:42:34

Yeah, LibXML, right? There was a big stop. No one is maintaining LibXML anymore-

Kieran Kunhya2:42:38

Yeah

Jean-Baptiste Kempf2:42:38

... which is like pass, the only library that is able to pass XML everywhere.

Kieran Kunhya2:42:42

All the crazy edge cases of XML under ridiculous circumstances, and they get attacked by security researchers because there's one other crazy edge case that they haven't thought of and say, yeah, but the body of knowledge to actually resolve that is massive.

Jean-Baptiste Kempf2:42:56

There is one guy maintaining all the time zones for everyone who is in the middle of, I think, was it Nebraska or South Dakota?

Lex Fridman2:43:03

Yeah, it could be, yeah.

Jean-Baptiste Kempf2:43:04

Like, the mental health of the open source maintainers is something that large corporations don't care or don't see, right? It's just like, oh, yeah, I'm just doing an open source, uh, report and so on.

Lex Fridman2:43:17

Some of it is financial, but some of it, and b- people should definitely support open source financially-

Jean-Baptiste Kempf2:43:23

Yeah

Lex Fridman2:43:23

... all across the board.

Jean-Baptiste Kempf2:43:24

Yeah.

Lex Fridman2:43:24

But some of it is also, like, spiritual on a basic human level. There's something that happens, like, with this image of F- FFmpeg and so much of the internet depending on it, where people almost, like, talk down to the folks who are carrying these projects forward and maintaining it.

Kieran Kunhya2:43:41

In the security community, they certainly did. That was one of, that was one of the things I think that argument came out is there was, there was a portion of the security community who's like, "No, these guys write crap code.

They need to fix their crap code." I'm like, "No, no, no, no. This is a guy's hobby project. You've, you've have a security bot that's gone and found some AI-generated stuff. That guy didn't write crap code. It's just an edge case to the 99th point nine nine nine nine nine percentile he didn't think about because it's ho- his hobby project decoding Star, Star Wars games."

Lex Fridman2:44:11

Forget the hobby project aspect of it. It's, it's just hard work and it's b- it's beautiful, and it's like the, the right approach there is to celebrate people-

Kieran Kunhya2:44:19

Sure

Lex Fridman2:44:19

... for doing incredible, incredible work. It's, it's just incredible that humans step up-

Kieran Kunhya2:44:25

Sure

Lex Fridman2:44:25

... not getting really paid at, at first or maybe ever, and then they're doing it out of the love of it, and we need to, like, human civilization runs on people like that. We need to celebrate them.

Jean-Baptiste Kempf2:44:36

To, to, to give you an idea, I received death threats on, on VideoLAN, right? And, um-

Lex Fridman2:44:40

You mentioned that to me. Like, what, what is, what is behind that?

Jean-Baptiste Kempf2:44:43

So that must be, what, 2009, 2010, right? Um, uh, Apple is moving from PowerPC to Core Duo, s- um, that's probably in 2006. And by 2009 or 2010, I decide that we are not going to do new versions of VLC for PowerPC.

Lex Fridman2:45:02

Mm-hmm.

Jean-Baptiste Kempf2:45:03

At that time, like VLC, we were close to the number 1.0 release. We were four of us, right? Like, just like, no, this is not possible. So I receive a death threat with some powder in it, right? It-- Remember there was some-

Lex Fridman2:45:15

Yeah

Jean-Baptiste Kempf2:45:16

... anth- anthrax threats-

Lex Fridman2:45:18

Yeah, yeah

Jean-Baptiste Kempf2:45:18

... at that time, right? Um, and it was because I had taken the decision to not maintain the PowerPC port anymore. And of course, it wasn't anthrax, of course. It was some type of flour and so on. But I received that a- as a, with a letter of like, uh, you, you piece of shit, uh, you should die, uh, PowerPC forever, and so on.

And it was 2009 or 2010, right? I was, I was, uh, I was young. I was just like, "Why? What did I do?" Right?

Lex Fridman2:45:47

Yeah, that can break your spirit. It's like, why-

Jean-Baptiste Kempf2:45:50

My mother freaked out, right? We had to go see, see the police and so on. And now, like, I, I- I'm going to say that I'm quite happy that this happened at that time. It, it forged me a lot, right?

I am-- I, I can see, I can take a lot of, uh, of hate on me. I'm, I'm okay with it, right?

Lex Fridman2:46:08

It sucks that that's part of reality, 'cause all the people that love VLC, all the people that love FFmpeg, like me, you know, I, I legitimately Hundred, probably thousands of times in my life had a smile on my face because FFmpeg made me happy, period.

And how many times did I get a chance to say that? Zero. Until I realized there's a Twitter account.

Jean-Baptiste Kempf2:46:33

Twitter.

Lex Fridman2:46:33

And every once in a while I'm, like, messaging it.

Jean-Baptiste Kempf2:46:36

One of the things I like on the Reddit meme about me, which I don't like this meme for a lot of reasons, but... And someone says, "Oh, JB is on, is on Reddit," which I am, right? And I say, and say hello, right?

And then I got so many people who say, "Oh, thank you for VLC." And, like, I take pictures, and then I share that to, to, to the Signal, to IRC. Uh, yes, we use IRC, uh, on, on-

Lex Fridman2:46:58

And I, I saw as a quick tangent, you mentioned IRC is like Slack for old people. So you still use IRC?

Jean-Baptiste Kempf2:47:04

Of course.

Kieran Kunhya2:47:04

Yeah. I have it on my phone as well.

Jean-Baptiste Kempf2:47:05

Of course.

Kieran Kunhya2:47:06

Every day.

Jean-Baptiste Kempf2:47:06

Works fine.

Lex Fridman2:47:07

Wow. It works fine, huh?

Jean-Baptiste Kempf2:47:08

Works fine, yes.

Lex Fridman2:47:09

You have to power with the crank, I guess.

Kieran Kunhya2:47:10

No, but there, there's no-

Jean-Baptiste Kempf2:47:12

There's AOL.

Lex Fridman2:47:13

Use AOL to social media.

Kieran Kunhya2:47:13

There's no ads, there's no tracking, there's nothing. Like, it's, uh-

Jean-Baptiste Kempf2:47:16

The, the biggest issue, to be honest, right, compared to Slack, is that it has, doesn't have threads.

Kieran Kunhya2:47:20

Yes.

Jean-Baptiste Kempf2:47:21

That's annoying. It doesn't have emojis for reaction. Sometimes it's, it could be nice.

Kieran Kunhya2:47:25

I, IRC, V- V3 has.

Jean-Baptiste Kempf2:47:26

Yes, V3, but no one does it, and you cannot edit your messages.

Kieran Kunhya2:47:29

Yeah.

Jean-Baptiste Kempf2:47:29

Right? And the rest, it works perfectly fine for what I-

Lex Fridman2:47:32

Wait, how do you communicate without emojis?

Jean-Baptiste Kempf2:47:34

Well, that's, that's why I said it's for old people.

Lex Fridman2:47:36

Old people. All right.

Jean-Baptiste Kempf2:47:37

And we do, we do emojis with, like-

Lex Fridman2:47:39

Yeah

Jean-Baptiste Kempf2:47:39

... you know, the columns and dash and-

Lex Fridman2:47:41

Yeah, exactly

Jean-Baptiste Kempf2:47:41

... parentheses, right?

Lex Fridman2:47:43

Old school. So, so anyway, you're communicating on IRC. What were we even talking about?

Jean-Baptiste Kempf2:47:47

Yeah, we are talking about death threats-

Kieran Kunhya2:47:48

Death threats

Jean-Baptiste Kempf2:47:48

... and, and, and-

Lex Fridman2:47:49

Oh, damn

Jean-Baptiste Kempf2:47:49

... but having people thanking you, and sometimes-

Lex Fridman2:47:51

Yeah, yeah

Jean-Baptiste Kempf2:47:52

... they got people who send me a message and, and, "Oh, thank you for VLC." And I always answer, because I want to, to, to validate the fact that you need to thank the, the, the open source community.

Lex Fridman2:48:04

Yeah, please, everybody listening to this, celebrate, celebrate FFmpeg, celebrate VLC, celebrate all the incredible, uh, open source projects, Linux, everything. There's so many, there's so many... A- and you know what? I mean, even outside of open source, just celebrate companies that create software that you use a lot and love.

Kieran Kunhya2:48:27

Celebrate human endeavor. Celebrate the human effort to not just build something that's okay-

Lex Fridman2:48:32

Yeah.

Jean-Baptiste Kempf2:48:32

Yeah

Kieran Kunhya2:48:32

... build something that is damn good.

Jean-Baptiste Kempf2:48:34

Yeah, this is important, right? Like, because as we said, right, we work for technol- we do something very complex for the normal people. Like, we want our excellence in tech to be useful for everyone.

Lex Fridman2:48:49

Yeah.

Jean-Baptiste Kempf2:48:49

And this is why, like, this is why we work, right? This is why I wake up in the morning, is because I want people to use our stuff-

Lex Fridman2:48:55

Mm

Jean-Baptiste Kempf2:48:56

... uh, because it's making everyone's life easier.

Kieran Kunhya2:48:58

Want to solve hard problems. W- work on something interesting, work on some interesting technical challenges.

Jean-Baptiste Kempf2:49:03

And we are engineers, we love to build things, right? When I was young, like very early, I knew I wanted to build, to be engineer. I wanted to do, to do cars, right? Maybe at some point I will go back to cars, right?

But, um, this is, like, we want to build things that are cool and useful. A- and they need to be challenging, right? Because you want your brain to turn on.

Lex Fridman2:49:22

When did the two of you first fall in love with programming, with, with building, with engineering?

Codec Mastery2:49:22

Jean-Baptiste Kempf2:49:27

When is the first time you programmed, Kieran?

Kieran Kunhya2:49:29

Microsoft QBasic. Uh, so I was on Win- Windows 3.1 and Windows 95, uh, Microsoft QBasic.

Lex Fridman2:49:35

Oh, wow. Wow. What'd you build?

Kieran Kunhya2:49:36

Uh, like a multiplication, just counting loops like 10, 20, 30, 40.

Lex Fridman2:49:41

Nice.

Kieran Kunhya2:49:42

Uh, th- then I thought I could do everything after that. I wanted... I, I jumped from doing that to z- I want to create a s- a soccer, no, a football, soccer video game.

Lex Fridman2:49:48

Mm-hmm.

Kieran Kunhya2:49:49

And I drew all the, I drew everything out. I was like, "I wanna do it." And I didn't quite grasp that actually, uh, didn't grasp actually it's a massive piece of work to jump from Basic and drawing some pictures to a video game, but there we go.

Jean-Baptiste Kempf2:50:00

Yeah. Uh, I think I did, um, also Basics and then, uh, Turbo Pascal when I was, yeah, um, e- end of elementary school. Uh, but mostly the first time I actually did some serious programming was the, the first, uh, year of, um, you call that middle school, when you're 11?

Lex Fridman2:50:21

Mm-hmm.

Jean-Baptiste Kempf2:50:22

Um, I, I was, uh, I lived in Italy for a year i- in Florence, uh, and it was amazing year. Um, and like the maths teacher told us to, to work in a programming language called Logo, where you had a turtle that was designing things-

Lex Fridman2:50:38

Mm-hmm

Jean-Baptiste Kempf2:50:38

... uh, on the screen, and you would turn left and right. And in the end, we used that to do, uh, uh, very complex programming because of course you could do things. And, and this changed, like, as I knew I was, I wanted to do things with computers and program.

Lex Fridman2:50:52

I don't think we quite talked about X264 properly. We talked about David.

Kieran Kunhya2:50:56

Yeah.

Lex Fridman2:50:56

Can we return-

Kieran Kunhya2:50:58

Sure

Lex Fridman2:50:58

... backtrack a little bit to X264, this thing that powers basically all of the video on the internet. So, uh, uh, can you tell me the story of X264? And, uh, Kieran, you're actually a contributor to X264.

Kieran Kunhya2:51:12

So, so X264 is, is a video encoder for the H.264 video standard. It dominates internet video, but also other areas such as Blu-ray discs. And Blu-ray discs are interesting because the people that make them really want the highest quality, and there's some really cool high-end films that have been encoded, uh, broadcasting and all sorts of other areas.

X264 was a big step change, um, 'cause it kind of happened at the right time as well. A lot of the development took place when HD video was coming out. Intel Core 2 and Nehalem CPUs were getting fast.

You could do real-time video. But the mo- the most important thing was, um, a, a key sort of focus on visual metrics. So industry and academia for, puh, 20 years before was obsessed with, um, mathematical metrics, so what's known as peak signal-to-noise ratio.

So mean squared error, logarithm of mean squared error, and that led to tons of issues because mean squared error, um, leads to blurring 'cause you actually want to, you want to minimize, you want to add a little bit of error to everything to, to reduce the mean squared error as opposed to having a big error, and that led to loads and loads of blurring.

So ho- but hobbyists bucked that trend. It was for their own personal videos, mostly anime So there were two, there were two things they did differently. Um, there was a big iterative feedback loop with the community. They did some stuff differently.

Um, two, two big things, psychovisual rate distortion, so using block energy, trying to compensate for human perception when making decisions.

Lex Fridman2:52:39

So the psychovisual distortion, that's the critical-

Kieran Kunhya2:52:42

Yeah

Lex Fridman2:52:43

... thing. That's the thing. I mean, it's kind of revolutionary like that we can like rethink, don't, don't make it like this kind of theoretic thing-

Kieran Kunhya2:52:53

Right

Lex Fridman2:52:53

... of compression. Make it all about-

Kieran Kunhya2:52:56

Being pleasing visually to the eye.

Lex Fridman2:52:58

Yeah, yeah.

Kieran Kunhya2:52:59

Yeah.

Lex Fridman2:52:59

So compressing in a way that loses the least amount of information for the stuff that matters for us humans.

Kieran Kunhya2:53:04

Yes, exactly. A- as opposed to what industry-- Some parts of industry are still obsessed by this, which is mathematical numbers that don't look, um, good in reality. And then adaptive quantization was the other big one where it was biasing bits against, um, complex areas and, and redistributing them to less complex areas like grass.

Grass has some high frequencies, but it's kind of... It's less complex overall compared to more complicated things. And this came around by, um, Park Joy. So Park Joy was really the canonical sample that was-

Lex Fridman2:53:37

It's the running around in the park one.

Kieran Kunhya2:53:38

Yeah. So this guy was really the, um-- So this, this was created by Swedish television in, um, the beginning of HD, and it was done on film, and it was no expense spared in terms of production quality, and it was given away for free.

This was really-- And this is the sample really that sorts the men from the boys in terms of it has so many challenges with the trees, with the water, with the grass, with the motion, with the... I don't think there's, there's still been any, any public test sequence as good as that these days.

Lex Fridman2:54:11

So for people who are just listening, we're looking at a bunch of humans running-

Kieran Kunhya2:54:16

Yeah

Lex Fridman2:54:17

... along a river. You have the reflection, a lot of really high information textures everywhere, the leaves and the lighting playing with the leaves and all of this.

Kieran Kunhya2:54:27

You could show clearly that encoders with high PSNR-

Lex Fridman2:54:31

Will blur everything

Kieran Kunhya2:54:32

... will blur everything, and you could see actually, I could turn on psychovisual stuff, I could turn on adaptive quantization, and it would just look so much better. But your, your metrics... And these metrics are at the time w- at the time were considered so holy.

Lex Fridman2:54:44

Yeah.

Kieran Kunhya2:54:44

These are the holy metrics that are untouchable. PSNR is, uh, the most important thing.

Lex Fridman2:54:49

Uh, can you speak to how do you measure psychovisual stuff? Like how do you turn how pleasing a compression is for a human eye-

Kieran Kunhya2:54:58

Yeah

Lex Fridman2:54:58

... into a number? Is that even possible?

Kieran Kunhya2:55:00

That's what, that's what Netflix have been trying to do with VMAF. They said they've used a machine learning model.

Lex Fridman2:55:05

That's a more recent thing. But back in, uh, when X264 was being developed, that's by eye, you're basically-

Kieran Kunhya2:55:10

It was by eye. It wa- it was developers on their laptops. So it's not like even with big companies with prof- professional screens or anything. It's-

Lex Fridman2:55:17

Ah.

Kieran Kunhya2:55:17

And that was actually one of the goals, which was I don't-- The, the developers at the time, Laurent Mertin in particular, it's, "I don't wanna test this on a $30,000 screen. It's-- I want this to look good on someone's laptop at home."

Lex Fridman2:55:28

Yeah. Brilliant.

Jean-Baptiste Kempf2:55:29

Um, there is another sample, which is, um, uh-

Kieran Kunhya2:55:32

Yeah

Jean-Baptiste Kempf2:55:32

... a sample that is, uh, Planet Earth's killer sample that I absolutely love.

Kieran Kunhya2:55:38

Yeah.

Jean-Baptiste Kempf2:55:38

And you are going to see why, right?

Kieran Kunhya2:55:39

Yeah, you're gonna love this.

Jean-Baptiste Kempf2:55:40

Uh, the, um, i- it's a ton of birds, right, flying. A- and the more it goes, the more there are birds. And at, at the end, right, it's almost like you have millions of birds. It's the most complex thing-

Kieran Kunhya2:55:56

Yeah

Jean-Baptiste Kempf2:55:56

... ever to encode, right? And you... Well, you're watching it o- on YouTube, and you see how bad the YouTube encoding is actually, right? Um, a- and this is like phenomenal to, to optimize and get, um, perfect quality in a constant bit rate.

Um, there was a lot of optimization, mostly by, by Laurent also, um-

Kieran Kunhya2:56:16

Yeah

Jean-Baptiste Kempf2:56:16

... o- o- on anime, right? Uh, for a long time anime was very badly encoded because there was a ton of banding, right? And so you see those, um, those issue, a- and there was a ton of things.

Um, so X264 is like-- And today it's still the reference to any encoder, new encoder, AV1, AV2, VVC, HEVC, everyone compares to X264.

Kieran Kunhya2:56:39

One of my favorite films, um, Cinema Paradiso, I know the engineer who created the Blu-ray, and he, he showed me the comparisons of X264 versus others, and, uh, the, the-- it's completely different. And I think a bunch, a bunch of guys in the Blu-ray world started using X264.

Um, I think the big one was Chris Henderson from Warner Brothers. He did the whole Fringe box set with that. So quite like a thing a person on the street actually watches and wants to look good. And so they kind of took a risk in their jobs doing that 'cause they're in a big company.

That big company can buy whatever they want. And they said, "No, no, no, I want to use this free and open source thing so that things look good for my, my customers and build the best." And t- to this day, I personally still try and avoid watching the most cinematic films on streaming services and buy the physical discs because they look, they look good without even having to buy an expensive TV.

I think that's the key thing.

Jean-Baptiste Kempf2:57:29

And X264 is yet another example of open source project. It was started by Laurent Eyquem when he was at École Centrale Paris, where VLC was born. And then you got a generation of people like Laurent, like Jason, like, uh, Mants, like, uh, so many-

Kieran Kunhya2:57:44

Henrik from-

Jean-Baptiste Kempf2:57:44

Henrik, uh-

Kieran Kunhya2:57:45

Anton, uh-

Jean-Baptiste Kempf2:57:46

And this is-- Anton. And this is where the assembly thing w- that we use now on FFmpeg, David and so on, was born, right? So X264 is like amazing project with people who were really all over the world, and I think most of them never met each other.

Lex Fridman2:58:00

But all of them, according to Kieran, or large percentage, love anime. There's several things I've never got into, and one of them is anime, and I need to.

Jean-Baptiste Kempf2:58:09

I watch anime so much. Um, especially at the time, um, like at the time it was like A lot of anime content doesn't exist commercially, right? We are before Crunchyroll, right? So what happens is usually people who love anime, who take some things, some DVDs i-in Japan and rip them because th-there is no commercial offering.

And-

Lex Fridman2:58:33

Mm-hmm

Jean-Baptiste Kempf2:58:33

... some of the people who are, what we call fan subbers, are basically translating themselves to, to make subtitles, right? And at that time, you, you download completely illegally. It was the only way to do that, right? And so all of that was handcrafted, and it fits the open source community, right?

Because they needed tools to encode, to do fan subbing, right? One of the most amazing open source projects for subtitles is called AE-AEG sub, and it's, it's a subtitle... It's done for anime, for, for, for, um, South Asian and Japanese languages.

Lex Fridman2:59:07

There are weird textures in anime that I don't think you get in real-life content. I think that was a key one, which was optimizing these weird textures that you get-

Jean-Baptiste Kempf2:59:16

Mm

Lex Fridman2:59:16

... because anime is not done in a normal fashion.

Jean-Baptiste Kempf2:59:18

Yeah. The, the way you produce this is not-- You, you mostly produce it, like, on screens, right? Since a, a bit of time, and you have all those gradients, right? In colors because they are very easy to produce, uh, digitally, very complex to, to produce in real life.

Um, and, um, and the subtitles also are very complex because you need to have often the Japanese, and then, um, you need to have the diacritics, right? The, the, what we call the rubi, right? Which is the hiragana and the katakana for the kanji.

And then because, of course, you, so that you have the official subtitling, but you also need the English subtitles or the French subtitles because you want to, to learn that, right? Um, and there is so many things crazy on, on subtitles, uh, and we had, like, crazy samples on, on subtitles that we've seen all around.

So, um, this is an important part of the, the culture, but also because there was no official offering. There was no way of doing that.

Lex Fridman3:00:12

Uh, can you speak to the difference between H.264 and AV1 and then, uh, X.264 and David? This is this big step. Can you help people understand, are some of the streaming sites moving more towards that direction of AV1?

Jean-Baptiste Kempf3:00:27

Let's be honest. All of those codecs since MPEG-2 video are the same concept. The same concept about inverse transform, about intra prediction, motion compensation, entropy coding, all of them. However, each generation gives you a bump between twenty-five and fifty percent b- more compression for the same quality.

Um, and so you had the MPEG-2, you had the DivX era, you have H.264, which was, like, changing, right? H.264 improved so much. And then you had more, right? You had HEVC, um, you had VP9 at the same time of HEVC.

VP9 is a bit similar to HEVC in terms of quality compression, but it's royalty-free. Because in multimedia there is ton of patents, and the licensing after H.264 became out of hand, right? And could cost hundreds of millions of dollars per year.

So it made no sense. So Google did this VP9, and the Alliance for OpenMedia did this new codec called AV1. Um, so you can imagine that AV1 saves between forty and sixty percent less bandwidth than H.264-

Lex Fridman3:01:45

Mm

Jean-Baptiste Kempf3:01:45

... for, for the same quality, visual quality.

Lex Fridman3:01:48

At a given bitrate.

Jean-Baptiste Kempf3:01:49

At a given bitrate, right? So that's really, like, you increase the quali- either you, you set the bitrate and you increase the quality, or you set the quality and you decrease your bitrate. But because now you move from, from SD to HD and HD to 4K and 4K to 4K HDR, like, you're increasing the size by, like, two, factor two, three, four, right?

So you need to have better compression to keep it in terms of something that is manageable.

Lex Fridman3:02:17

It's m-more coding tools, more bigger blocks, lots more sub-partitions in each block. It's just exponentially more complex.

Jean-Baptiste Kempf3:02:24

It's more complex because the, the, the encoder needs to search more possibilities, right? So you, for example, um, one of the things that is easy to understand is f- to predict a block, a, a, a color block to another, you have directions, right?

You can go left, right, bottom, up, and then in terms of, uh, uh, like the other quadrants, right? Uh, what I call north, northeast, northwest, and, and so on, right? But that's eight directions. Then you can do more direction.

You can do sixteen or sixty-nine or one hundred and twenty-eight, right? You can-- And every time your encoder is going to spend more time to see, oh, well, this block is exactly this one, um, a-a-and those type of tools that you can bring, and the encoder needs to check which of the tools are going to compress you better.

And so I guess that AV1 encoding is two order of magnitudes more than H.264 in terms of CPU cycle, right? Order of magnitudes, right?

Lex Fridman3:03:21

Yeah. And as we discussed, CPUs are not getting faster. You're just throwing more cores at the problem.

Jean-Baptiste Kempf3:03:26

But also, it's the fact that you encode once, and you have hundreds of millions of users, right?

Lex Fridman3:03:31

Yeah. Yeah.

Jean-Baptiste Kempf3:03:31

So for example, YouTube, a very good example. YouTube encodes almost everything in H.264, but the popular video gets re-encoded in AV1 because it costs more, of course, to encode, but you encode once, and you send that to millions, right?

So it's a trade-off between encoding time and complexity-

Lex Fridman3:03:50

Mm-hmm

Jean-Baptiste Kempf3:03:51

... and, and CPU usage on, on the server side and on the client side. Because at the end, if you're distributing a video to hundreds of thousands of people and the size is half of the other, then it's better.

It's better for your battery, it's better for your modem, et cetera, et cetera.

Lex Fridman3:04:07

So we can lay out, let's say the top five codec container combos would be H.264 inside MP4 containers AV1 inside MP4 WebM containers, uh, ProRes for nonlinear editing, uh, inside MOV containers. So for people who don't know, I guess ProRes is

Kieran Kunhya3:04:33

It's Apple's codec for editing, originally for Final Cut Pro, and it's designed to be fast to decode, fast to seek, because an editor will need to move very quickly. So it's a different use case to the distribution element.

Lex Fridman3:04:45

There's no or very minimal, uh, temporal compression.

Kieran Kunhya3:04:49

There's none, yeah, there's none in ProRes. So you can cut, so you can do cuts.

Jean-Baptiste Kempf3:04:52

This is what we call intra-only codecs, right? So I'm going to explain quickly what is IPB frames.

Lex Fridman3:05:00

Yes, please.

Jean-Baptiste Kempf3:05:01

Um, so I-frames, often key frames, but is complete frames. It's like an image. It's a JPEG, right? You have... You can start, you see everything, right? Um, and then you, the next image can be a P-frame, which is a predicted frame.

So you take some part of the previous image saying, "Well, I need the block five and seven and 42," and you replace it, and then you just give the extra information, right? But that means that in order to decode this P-frame, you need to have access to previous I-frame, right?

Lex Fridman3:05:36

Mm-hmm.

Jean-Baptiste Kempf3:05:36

And then, of course, you have more complex one, which are B-frames, which are B-predicted, um, frames, which can be depend on different type of frames, some in the past, some in the future. Um, and so ProRes is an intra-only codec.

For the people who can see, this is-

Lex Fridman3:05:54

Yeah, that's a good one

Jean-Baptiste Kempf3:05:55

... a very good one, right? So I-frames are complete frames. Um, uh, P-frame basically, uh, depend only on I-frame, and B-frames can depend on in front.

Lex Fridman3:06:05

And this, uh, GOP, group of pictures, I think the default for actually FFmpeg for H.264 is, uh, like two hundred and fifty frames, something like this.

Jean-Baptiste Kempf3:06:19

Yes.

Lex Fridman3:06:20

And to me, it's just, it's like magic, like that you could predict, that you could have a complete frame every-

Jean-Baptiste Kempf3:06:27

Several seconds, that means

Lex Fridman3:06:28

... several seconds, and then you could still, you could have this chain of predictions you make. And the fact that you can, the fact that somebody like me can, c- can use FFmpeg to compress something and not notice that the result still plays back smoothly is, is like magic.

Jean-Baptiste Kempf3:06:44

You can even have, and we use that in tons on Kyber, is what we call intra-refresh, where basically it's, there is no I-frames ever.

Kieran Kunhya3:06:55

You, you have no I-f- you have one at the beginning-

Jean-Baptiste Kempf3:06:56

Uh-huh

Kieran Kunhya3:06:56

... and you never send an I-frame. You just have-

Lex Fridman3:06:57

How does that work? What is it?

Kieran Kunhya3:06:59

You, you build up an I-frame gradually across as the stream continues, so-

Lex Fridman3:07:03

Ah. So you refresh certain-

Kieran Kunhya3:07:04

Yeah

Lex Fridman3:07:04

... parts of the image.

Kieran Kunhya3:07:06

Yes.

Jean-Baptiste Kempf3:07:06

But so you never have an I-frame.

Lex Fridman3:07:08

Yeah.

Jean-Baptiste Kempf3:07:08

Like this is intra-refresh that we use, right?

Lex Fridman3:07:10

That's even smarter.

Jean-Baptiste Kempf3:07:10

But, but for me, for me, the, the, the biggest mind-blown when I started was the B-frames.

Lex Fridman3:07:15

Yeah.

Jean-Baptiste Kempf3:07:16

B-frames means B-predicted frames can depend on frames that are coming in the future.

Lex Fridman3:07:22

Mm-hmm.

Jean-Baptiste Kempf3:07:23

That means that in order to decode this B-frame, you need to wait for the next frame that is dependent-

Lex Fridman3:07:31

Yeah

Jean-Baptiste Kempf3:07:31

... buffer that, decode that one, so that you can decode the B-frame, right? So the, the, the way you decode the frame, the decoding order, is not the same as the display order.

Lex Fridman3:07:43

Mm-hmm.

Jean-Baptiste Kempf3:07:43

Right? That means the encoder needs to be very clever and decide that, "Well, you know, I'm going to depend on things, like, in the future."

Lex Fridman3:07:50

Mm-hmm.

Jean-Baptiste Kempf3:07:50

So this is like-

Lex Fridman3:07:51

Incredible

Jean-Baptiste Kempf3:07:52

... mind-blowing.

Lex Fridman3:07:53

Yeah.

Kieran Kunhya3:07:54

The fact it works so smoothly every day is, is kind of miraculous in some ways. It, it works so sp- You can have a stream that works across the world on their decoder versus one in the US versus one here of different manufacturers, and they produce bit for bit exactly the same material.

Lex Fridman3:08:10

Mm-hmm.

Kieran Kunhya3:08:11

That's quite remarkable, and do quite complex things, and getting more and more complex and still be bit exact. There's a lot of work that goes into that.

Lex Fridman3:08:18

There's a lot of knobs you can control in this whole process. There's a lot of really fascinating parameters that I've gotten to know more and more over the years that FFmpeg gives you complete access to. Maybe you could speak to some of them.

So first of all, like, obviously, we can lower the resolution, we can lower the frame rate, we can use different kinds of codecs, as we mentioned, from, uh, H.264 to AV1. There's ways to tune the trade-off between bitrate and quality, as we've kind of spoken to.

You know, you could do constant bitrate, you can do constant quality, say, or FCQ, QP. We can, uh, do the longer or shorter group of pictures, GOP, that we mentioned. I mean, all that kind of stuff. It's crazy.

Number of B-frames.

Jean-Baptiste Kempf3:09:01

Yeah. What is crazy is that a ton of people's job is to optimize those parameters, right?

Lex Fridman3:09:09

Yeah.

Jean-Baptiste Kempf3:09:10

A ton of people that you see at YouTube, at Netflix, at Meta, and so on, they're not writing codecs. They're just, like, finding the right parameters for the file they have, for the format they have, right? Because, like, something that is for a movie or something that is user-generated content from your phone or a screen recording or something that you're going to video edit, you don't want the same things.

And there are thousands of people whose job is-

Lex Fridman3:09:37

Right

Jean-Baptiste Kempf3:09:37

... just to optimize all that.

Lex Fridman3:09:38

Yeah. They're wizards. Hats off to them. Uh, YouTube, like to deliver, all the streaming sites actually, to deliver at scale. And, like, YouTube is, is really magical because it's not just doing, like, what Netflix d- it does, which is one way br- like broadcasting type thing.

It's also has to upload videos from all the places. So they're also doing encoding at scale-

Jean-Baptiste Kempf3:10:04

Yeah

Lex Fridman3:10:04

... for videos that are gonna be watched by, like, five people.

Jean-Baptiste Kempf3:10:07

Yes.

Lex Fridman3:10:07

And it still has to deliver them re- like, o- on a moment's notice. No, no delay, nothing. No lat- I mean, very minimal latency. And, and also serve it in all different resolutions. Like YouTube is basically the web Version of VLC.

Jean-Baptiste Kempf3:10:25

Yeah. Well, actually, it's funny because, like, uh, Google Video, which was, uh, something they did before, uh, they acquired YouTube, uh, was actually using the VLC plugin so that you could run VLC inside the web browser, uh, using the ActiveX plugin.

And so it worked i-in, uh, Internet Explorer, and you were actually running, um, VLC inside your browser.

Lex Fridman3:10:49

Mm-hmm.

Jean-Baptiste Kempf3:10:50

Which is funny because today we have the opposite, where we have VLC WebAssembly, where we compile all VLC and FFmpeg to decode, to run VLC in type of inside the JavaScript virtual machine, um, with WebAssembly.

Future & Security3:11:04

Lex Fridman3:11:04

Okay, there's this legendary story that you pointed me to that, uh, it was discovered, uh, via WikiLeaks release of all seven documents. The CIA was using a modified version of VLC, uh, to basically try and trick people, what?

To steal their data?

Jean-Baptiste Kempf3:11:23

Yes, exactly.

Lex Fridman3:11:24

So can you explain what the heck happened? What...

Jean-Baptiste Kempf3:11:28

So, so th-this was a surprise, right? Um, because at some point, WikiLeaks, uh, uh, mentioned some documents. There were a few ones with, uh, something related to Blu-rays and VLC, but the, the most interesting one was the CIA Vault 7, which, if I understand correctly, um, was the CIA had, like, a custom version of VLC, uh, where they had a specific plugin.

Yeah, exactly. This is-- Like, we had to, to write a press release on that.

Lex Fridman3:11:54

Uh, VideoLAN wrote a press release saying the only safe source for getting VLC media player is the official VideoLAN website. I mean, I suppose that's a security vulnerability for basically any piece of s- open source software. Somebody can trick you.

Jean-Baptiste Kempf3:12:10

To download in a fake website-

Lex Fridman3:12:12

Yeah

Jean-Baptiste Kempf3:12:12

... or targeted advertisement, right? That was a targeted advertisement. To watch a specific file, you need to watch with this custom version of VLC. And it was the normal binaries of VLC, except they added one DLL, I think it was psapi.dll-

Lex Fridman3:12:27

Mm-hmm

Jean-Baptiste Kempf3:12:27

... which was basically reading your, your document folder, encrypting that, and send, sending that. And the thing is, this is very clever, to be honest because once you're watching a movie, right, you're going to do that for two hours, and you're not going to touch your computer.

And sometimes it's normal because it's HD that your, your fans are going up and say, "Vroom," and there is a ton of CPU usage because you're using VLC, right? That's normal. But the thing is, what you don't see is that actually a, a, a, um, a, a powered version of VLC that is used by CIA.

Um, we had exactly the same problem with Chinese hackers that were targeting Indian people, a-and that got VLC banned from India until I had to, to fight in courts in India, the Indian government, to unban VLC. They didn't use VLC.

They took just one DLL because we signed the DLL correctly, um, and they used that DLL to do another program. Uh, so you had the vlc.exe and was calling libvlc, but it was calling it into a fake one.

Lex Fridman3:13:33

Mm-hmm.

Jean-Baptiste Kempf3:13:33

And they used that to, to target. Um, there is not much we can do actually to, to, to block those type of hacks.

Lex Fridman3:13:40

Yeah, and I think people should, for all open source software, for all software in general, people should pay attention where they download the thing.

Jean-Baptiste Kempf3:13:47

Yes, because that means that they were not downloading it from our website.

Lex Fridman3:13:50

Do the search engines help you?

Jean-Baptiste Kempf3:13:52

No, they don't.

Lex Fridman3:13:53

Just to clarify, 'cause you can, you know, to prevent threats from people manipulating SEO to get up there on the links and try to-

Jean-Baptiste Kempf3:14:01

Absolutely not, right? We have a big issue for, like, more than ten years, is that there is a fake version of VLC in Germany that was reported for now for 12 years. And Google basically decides to not-- They know what's in it, but the binary is too big for their virus analyzer to a-analyze it.

And so, well, if you're in Germany, you can go to a website that is a fake version of VLC with a custom installer, and it's very popular in Germany because th-their website is in German, and, and Google s-mentioned that before VideoLAN.

And the weirdest thing is that it doesn't do anything on your machine for three weeks.

Lex Fridman3:14:38

Mm-hmm.

Jean-Baptiste Kempf3:14:39

Because that's how they, they do the detection. And after three weeks, there is a small program that is a service that install at the same time that wakes up after three weeks, and it start downloading spyware and adware.

And Google knows about it. They've decided not to do anything. The guys use dark SEO in Germany to, to, to, to do that, uh, at some point. Um, and, and this is very damaging, right? Because one of the things that they are downloading is actually something that is replacing your ads inside your machine, right?

Lex Fridman3:15:08

It's actually quite surprisingly effective. Whoever is doing it with Twitter and X. With X, I'll get emails about, "Your X account has been hacked." And however they phrase it, it gets me to, like, at least click on the email, not to follow the thing.

And then you're like, "Man, whatever they're doing with the psychology to try to trick you, they're quite good."

Jean-Baptiste Kempf3:15:33

There is a security v-version of VLC, right? You received an email saying, "Hey, there is a security version, uh, update on VLC. Think about updating right now because-

Lex Fridman3:15:41

Right

Jean-Baptiste Kempf3:15:41

... it can hack your computer." You come, it's a website that looks decent, and, uh-

Lex Fridman3:15:45

Yeah

Jean-Baptiste Kempf3:15:45

... and you download it. It's a new version of VLC. Great. You don't know. A month later, you're hacked. You have no idea. You're part of a botnet.

Lex Fridman3:15:51

Yeah. So make, make sure wherever you're downloading stuff, it's legitimate. Part of the botnet. Uh, speaking of which, so, uh, y-you've mentioned that, uh, VLC sandboxing some- is something you're working on, and it's actually something quite challenging. W-why is it important?

Why is it hard?

Jean-Baptiste Kempf3:16:09

So VLC is a core with around five hundred plugins, right? S- One of them is FFmpeg, but we have, we support so many other formats. We support, uh, new protocols. We support new filters. We support weird architectures. And in this release of VLC, you have modules that are going to call your drivers, right?

Lex Fridman3:16:31

Mm-hmm.

Jean-Baptiste Kempf3:16:32

Uh, mostly the hardware decoders, which are going to call, uh, your Intel, your NVIDIA, your AMD driver. Um, and Or calling FFmpeg, right? And there might be a security issue. There might be a security issue in the shader, there might be a security issue in VLC, in FFmpeg that is going to basically crash.

The issue is that you running VLC like every, every other program, like Adobe, right? You're running it on your machine, and it has access to all your documents, right? So the idea is to be sure that you do a sandbox so that we can protect from ourselves, because inside the VLC process is running some code that is not even ours.

Either it's open source for other projects that we integrate in VLC, or it's your GPU driver or s-something that is provided by someone else inside. And so when we crash, we want to not allow people to do bad things, right?

Because one of the common way of hacking people is to crash a program, very often done with a web browser, very often done with PDF files, less often with multimedia, but that could happen. And when you crash, you launch something on the, on the machine of the person.

Could be a ransomware, could be a botnet, right? So security of desktop application is important. On mobile it's a bit different because most of the mobile application are running on inside their own sandbox. But for VLC, we could run it inside one sandbox, but the problem is that we need access to so many things that it's basically we, we would do-- we would have all the permissions, right?

And so if you have a sand-sandbox and you put some holes everywhere, it defeats the purpose, right? So what we are trying to do, and we're actually doing, is splitting VLC into several processes. One is decoding, one is demuxing, one is filters, and all of them run into their own sandbox so that the whole VLC...

A part of VLC crash, like Chrome crashes on some, on some tab, right? It crashes a crash, but it did not crash the whole program, and this is what we're trying to do. And it's difficult because it's a sandbox that needs to sustain gigabits per second of, of mem copies.

Now, it's not a website which is five megabytes or 10 megabytes. We're talking about hundreds of megabits per second. So this is why it is quite challenging, and this is a, a research topic that we, we are working on in order to have multimedia player that is secure.

Lex Fridman3:19:03

This is all the kind of stuff you have to think about when millions of people are using. You, you've mentioned something somewhere where like, uh, all the different features of VLC, when you have that many people using it, somebody will use every single feature, and they will tell you about it.

Jean-Baptiste Kempf3:19:20

Best feature in VLC is called the puzzle filter, right? So, uh, you click the puzzle filter, and it transforms your video into a jigsaw puzzle, right?

Lex Fridman3:19:31

Nice.

Jean-Baptiste Kempf3:19:31

And you can click and move the pieces, right?

Lex Fridman3:19:34

Yep.

Jean-Baptiste Kempf3:19:34

Um, it's very, very useful when you're watching a French movie, right? You're bored, um-

Lex Fridman3:19:39

Oh, yeah

Jean-Baptiste Kempf3:19:39

... because it's like, like very long things or, or a love triangle, right? We've seen that so many times, right? But, but you need to watch it because someone, your wife or, or-

Lex Fridman3:19:48

Yeah

Jean-Baptiste Kempf3:19:48

... told you to do that-

Lex Fridman3:19:49

To catch up

Jean-Baptiste Kempf3:19:49

... or, or your, your boyfriend told you to do that, right?

Lex Fridman3:19:51

Yeah.

Jean-Baptiste Kempf3:19:51

So you're doing that, right?

Lex Fridman3:19:52

Yeah.

Jean-Baptiste Kempf3:19:53

And you can click and move the pieces around.

Lex Fridman3:19:55

Yeah.

Jean-Baptiste Kempf3:19:56

It's absolutely useless, right? Like, who cares about that? First, it was done by a, a math, um, teacher in high school in south of France to teach his students about Bézier curves, which is something that-

Lex Fridman3:20:09

Mm-hmm

Jean-Baptiste Kempf3:20:09

... everyone should know about, right? It's very useful. But the code was clean, so it got in VLC. It was merged in two thousand and ten. Five years later, I receive an email saying, "Hello, JB, I have a problem with VLC.

The puzzle is too simple." And I was just like, "What?" And yes, the puzzle was in the UI maximums by sixteen by sixteen, right? Only two hundred and fifty-six pieces. And he says, "I'm sorry, but in a movie I love puzzled, this is too, too simple," right?

So there is a comment of me, you can check it online which is JB changing that the dimensions are two hundred and fifty-six by two hundred and fifty-six.

Lex Fridman3:20:45

Right.

Jean-Baptiste Kempf3:20:46

But my point is, so many use features are used by a few people, right? There is a way to watch VLC movies in command line without any UI, right? It's-

Lex Fridman3:20:58

I saw that. You can do, uh, ASCII.

Jean-Baptiste Kempf3:21:00

ASCII art. Is it useful? Very useful. Imagine you're debugging- Imagine you're debugging a multicast network, right?

Lex Fridman3:21:07

Yeah.

Jean-Baptiste Kempf3:21:07

You have thousands, very complex, very complex networking stack, right? You can SSH to all of the routers and put VLC on it with no UI, and you're going to see whether it's black or it's not black, right? So you see if...

Or it's all green or not all green, right? So you can see-

Lex Fridman3:21:23

Amazing.

Jean-Baptiste Kempf3:21:23

Yeah, right.

Lex Fridman3:21:24

This is fun.

Jean-Baptiste Kempf3:21:24

People don't realize there is so many things in VLC, uh, that are useful, um, and they are-- They have users, because once you have hundreds of millions of users, you have people who use every feature.

Lex Fridman3:21:40

I would love to sort of, uh, zoom in and, and, and talk a little bit more about the distinction between kinda downloading a file and watching it offline versus streaming. So the, the complexities, the challenges of streaming. Is there something we could say about what it takes to, uh, stream files?

'Cause we've been talking about codecs-

Jean-Baptiste Kempf3:22:02

Mm-hmm

Lex Fridman3:22:02

... and I think a lot of that implies encoding and decoding, uh, without the having to communicate-

Jean-Baptiste Kempf3:22:11

Sure

Lex Fridman3:22:11

... over the network.

Jean-Baptiste Kempf3:22:11

Sure, sure.

Lex Fridman3:22:12

Uh, so can you, can you elaborate, like, what's required to do over network stuff?

Jean-Baptiste Kempf3:22:17

Yeah, but it is less complex than it seems compared to everything that we've talked about. Um, especially because the most complex thing is not about streaming in terms of, um, uh, streaming services, but it was, was what was done to actually broadcast through satellites.

Um, because in, in, in Most of the modern, uh, uh, broadcasting services you can pause and you can go on. But when you're sending live streaming, whether it's broadcast or live for streaming services which are live, this is much more difficult because you need to encode in real time.

You-- When you go on a satellite, you have a specific size of the link, right? You cannot have a burst-

Lex Fridman3:22:58

Yeah

Jean-Baptiste Kempf3:22:58

... of bandwidth even for a second, right? Because you don't have the space for that in your, your total file. However, there is different types of challenges, which are interesting challenges, but I think they are less complex than the one we've seen with, um, late '90s and early 2000s about broadcasting and streaming to satellite.

Lex Fridman3:23:18

They're different. There are control systems challenges, whereas, whereas some are more mathematical. I think that's the difference.

Jean-Baptiste Kempf3:23:23

In the streaming world, what you have is called, what we call adaptive streaming. Because the difficulty, and it's not really a video problem, it's mostly a CDN problem, is that you might have too many people watching the same thing at the same time, and it's a congestion of the network, right?

So your player, um, has difficulty downloading things fast enough to play them. So what happens is that locally, the player is going to read a, a lower resolution-

Lex Fridman3:23:50

Mm-hmm

Jean-Baptiste Kempf3:23:50

... of it. Um, but there are some very clever algorithms to do that, but most of it is quite basics, to be honest.

Lex Fridman3:24:00

Even on the buffering side, it's pretty basic.

Jean-Baptiste Kempf3:24:03

Yeah. You, you, you, you start to download a, a, a segment, what we call a segment, and then you, you time, right? And if you're, if it takes more than fifty percent of the time to download a segment, you go down to...

Right. And the difficulty is more about when do you go up in bandwidth, in, in quality. But this is not very complex to do. When you encode, you're going to encode seven resolutions, right? And, and you're going to give the bitrate.

Um, the difficulty is to have your encoder gives the same bitrate, but it's not as strict as it, it used to be. So-

Lex Fridman3:24:35

Uh, probably YouTube has to figure out how the human psychology side of that, like how pissed off do you get when it's like very low bitrate and, uh, how long should it wait before it increases the bitrate even though the connection is better?

Because maybe the, the changes in the bitrate is what, like, affects you psychologically.

Kieran Kunhya3:24:59

No, I, I think actually the, the interesting one is the audio.

Lex Fridman3:25:01

That's true.

Kieran Kunhya3:25:01

The-- You can kind of notice when they move from, um, full fat AAC to the, um, there are compressed versions of AAC that use spectral band replication. You can kind of see it goes a bit tinny, and that up and down is very jarring.

The video side is a lot smoother, and there's less notice. It's really the audio you can, you can definitely, you can definitely feel it from when it's moved you from a different audio profile to one or the other.

I don't know. We're surprisingly tolerant at skipping audio glitches. I, I'm surprised people I know who are not video engineers, how tolerant they are, how tolerant they are to watching sports at thirty FPS, for example, whereas it should really be sixty.

The world is a lot more tolerant to that, but audio people are very... There's-- It's an immediate feedback mechanism of, oh, something's changed.

Jean-Baptiste Kempf3:25:45

If you hear a glitch, you realize it directly.

Kieran Kunhya3:25:48

Yeah.

Lex Fridman3:25:48

I get to fully realize that, I suppose. One of the things I'm afraid of when I listen to audio more and more, that I get to notice every single tiny detail, and that you can over-obsess when, uh, people, people in general are able to kinda, kinda blur their consumption.

They, they can, they can look past certain imperfections.

Jean-Baptiste Kempf3:26:08

But then when you combine like, um, an event that is, for example, a sport event that is probably going through satellite or-

Lex Fridman3:26:17

Yeah

Jean-Baptiste Kempf3:26:17

... somewhere else and goes to a central place for encoding, and then you need to encode this older resolution, you, uh, in real time. You don't have time for QA. You need to push that to CDNs. You need to add probably DRM, uh, for protection.

You need to have that over a ton of different, um, devices. Then yes, it is complex. Um, but-- And also, like you're in the web browser or in very much different devices that you use for t-television, where you had like a, a defined set-top box or cable box that, that you know, where you control end-to-end.

Um, so it's a challenge, but it's less... I, I think the networking part, uh, while you agree to have ten, twenty seconds of latency, I don't think this is very difficult.

Lex Fridman3:27:06

Speaking of networking and latency, so your new effort, as we mentioned, is Kyber, which is, uh, aimed at ultra-low latency. As you say, every millisecond counts, and, uh, you're applying that to remote control machines like robots, drones, computers.

Can you tell me about it?

Jean-Baptiste Kempf3:27:26

Sure. Um, if you start from where we used to be, right? You used to use FFmpeg to encode files, right? And then we used FFmpeg and VLC to encode in streaming services, right? And then you need to go lower and lower.

And the question was, where, up to where we can, can we go?

Lex Fridman3:27:45

Mm-hmm.

Jean-Baptiste Kempf3:27:46

Um, and this question is very important because there are many use cases where you need to be fast, and it's when you have feedback interaction, right? We are not just listening to something, you're actually controlling it, right? Because-- And that's the biggest difference that compared to what we've done so far, is that I, uh, I need video to have a feedback on something that is happening live.

Whether it's a drone flying, whether it's, um, controlling a humanoid robot from distance, whether it's, uh, controlling a hover, whether it's playing a video game in, in the cloud gaming, because this is, um, what I did, uh, on a previous job, right?

I was CTO of a cloud gaming startup. Um, and this is an very interesting topic because you push to the limit the network. You need to be-- to care not about the quality like we've done on video, and we've talked about with H.264.

You care about Latency because a milliseconds is m- meaningful when you're controlling a car, right? For-- Well, you-- with-- you've seen-- you've used Waymos, right? When Waymos don't work, and that happens even if one percent of the time, there is someone that is basically remote controlling that.

Um, and this is exactly the stuff that we're building. It's, uh, really an SDK, um, platform, uh, to do end-to-end control of machines.

Lex Fridman3:29:11

So the, the-- this comes up quite a lot in a lot of different contexts in robotics. So z- obviously teleoperation, teleop is becoming more and more important, um, including for training, uh, robots via machine learning.

Jean-Baptiste Kempf3:29:26

Yes. And what we do is a bit different from, and everyone else, is that we take only one socket, one connection, which is a quick, uh, protocol based on UDP, um, which is interesting because it's done for low latency.

It doesn't have two of the, what we call the TCP end-of-line problem and the HDP end-of-line problem. It's ciphered by default, but on the same wire, we send multiple streams, like multiple track. We send audio, we send video, but we also send the commands, right?

Uh, mouse, keyboard, gamepad, and so on. And we do that while maintaining coherence, right? Synchronization. Because what people don't realize is that all the clocks actually drift. And when you're controlling a robot, a robot is going to have, like, two cameras, five cameras, ten cameras, a ton of captors, GPS, and so on.

Um, and if you want to train correctly your robotic AI model, you need to have all those that are in sync and coherence. And what we've done, and it's all the stuff that we learn on VLC in broadcast in real time, and MPEG TS that Kieran's know well, is that we account for clock drifting.

And so when I record a Kyber stream, a robot, I am sure that it's going to be predictive in the way you play it back. And so when you're going to do recording and training of your AI model, you need to be sure that every time you retrain based on the data, it-- the data is going to stay coherent.

And clocks actually drift. Like, the existing solution works with one camera. Once you're going to a five or six, it, it's more complex.

Lex Fridman3:31:01

Uh, so you wanna make sure that the visual snapshot perfectly matches the time it actually happened.

Jean-Baptiste Kempf3:31:08

Exactly. And also, if you're going to control, right, I do something on robot, I need to be sure that it is actually happening at that precise time, right? And w- so we have on the, the server, which would be a robot, a time of, like, re-timestamping mechanism accounting for clock drift for that, right?

So that's one of the use case, um, o- of Kyber to, to control robots. Um, I also think, like, remote drones, remote, uh, whether it's defense or non-defense, remote cars, remote submarines. There is many places in industry or remote surgery where the expert cannot go everywhere the machine is because it's either dangerous or it's too costly, right?

So you, you allow people to have machines next to you, right? T- the goal of Kyber is to make distance disappear, um, because it's either projection of skills or pr- projection of power, right? So imagine we, we are all, like, r- you've seen the Meta Reban and, and everyone else, right?

You need to stream there, right? Because you're not going to run anything over there, right? So you need GPU power whether it's on a cloud, on a phone to stream that. And so all of these use cases needs to be not about extremely low latency, but real-time latency for video.

And so that means you need-- We're toying with the encoders so that the encoders encode a frame in four milliseconds. And, and, a- and Kieran with his company also goes under those type of li-- uh, of, of latency, because you need to optimize at max the local latency, right?

Because it's the decoder, the encoder, um, and so on, um, because this time is going to be added to your networking time. Um, so-- And it's not just about low latency, it's also about, like, reliability. We do clever things like, uh, forward error correction, right?

So forward error correction is you over-transmit a bit of data, right, a few percent, um, and while over-transmit, you're allowed to lose some packets because all of that is very difficult over, uh, internet network, uh, where you're going to do things very far away.

Um, and if you check that all packets are delivered, you add a ton of latency. If you don't want latency, what we do is that we over-transmit some data that you can retrans-- reconstruct on the client side when there is, um, things that are broken, right?

So, um, a- and we, um, a few, a few days, weeks ago, we were, uh, doing the demo m- around, uh, Las Vegas for the CES about we had a, a, a rover that is fully 3D printed. It's very simple.

It's a car, right? It's a small car with a, uh, um, a telescopic arm, and it was actually controlled from France, right? And the, the video, uh, was, uh, with a webcam and, and a very small server, right?

A small, a small PCB was basically running and send that to someone that is on the other side of the planet. Uh, a- and so there is so many use cases. You can also think about having AI who are going to control many drones and so on.

And the technically, we need to be amazing in video. We need to be amazing at networking. We need to care about any milliseconds in networking, in encoding time, in decoding time, and also you need to integrate very low level.

Lex Fridman3:34:27

So sync everything together well. But how-- Like, what kind of latency can you get to? Like, why-- When you say milliseconds, what, what's the goal?

Jean-Baptiste Kempf3:34:35

So my goal is four milliseconds glass-to-glass latency. Um-

Lex Fridman3:34:39

What's glass-to-glass mean?

Jean-Baptiste Kempf3:34:40

So it's easy, right? You have a computer which is running a program, right? Probably a video game. And this one is actually running, right? It could be-- it's an example of a robot, right? And you have the replicate that is-

Lex Fridman3:34:53

Mm-hmm

Jean-Baptiste Kempf3:34:53

... done to the network. And, and you want, if you take a, a one thousand hertz camera, you can take a picture, and you want that to be at four milliseconds. Four milliseconds means two hundred and forty hertz, right?

Lex Fridman3:35:07

Yeah, it's nuts.

Jean-Baptiste Kempf3:35:08

Um, so far we, we achieve, um, seven milliseconds from a Windows to Windows or Window to Mac. Um, and if you look i-in the timing, most there is around three point five milliseconds inside the Nvidia, uh, hardware encoder and around two milliseconds on the Intel decoder, right?

So like the encoder plus the decoder is already six milliseconds, right? So in order to go down, we need either to have some other type of codecs, um, or some better encoder that are faster. Uh, but four milliseconds is-- would be the grail.

Lex Fridman3:35:45

That's pretty nuts. I love it, though. I, I don't think there's anyone's ever achieved that, right? That's fast.

Jean-Baptiste Kempf3:35:50

You can achieve that with custom hardware-

Lex Fridman3:35:53

Mm-hmm

Jean-Baptiste Kempf3:35:53

... with SDI, with professional hardware.

Lex Fridman3:35:56

Mm-hmm.

Jean-Baptiste Kempf3:35:56

But I want that to work over the internet. I want that to work with any robots where you're going to have a small Jetson Nano in it or, or a N one fifty, right? I want that because there is going to be millions of robots or-

Lex Fridman3:36:11

Mm-hmm

Jean-Baptiste Kempf3:36:11

... drones are just rolling robots or flying robots or, or swimming robots, right? It's just you, a machine that you control. And in order... Either you need to teleoperate them or when everything will be fully autonomous, you need to teleobserve them, right?

You need to check what's happening.

Lex Fridman3:36:30

Yeah.

Jean-Baptiste Kempf3:36:30

And in my view, in the future, like all those remote cars will be teleobserver- observed by an AI model, which is just going to say, "Well, everything is go- good." And when it's not good, say, "Hey, there is a problem," and then you have an operator, right?

And this is going to be about safety, right? When you have your humanoid taking care of your grandma or my grandma, I want to be sure that everything goes well, and I'm not in those type of horrible scenarios where the robot is dangerous.

Or when I'm f- driving, I, I want, like, the car to, to stop when it should stop, and if needed, someone takes care of that, right? And so there is so many ca- cases, scenarios about real time, and so the goal of Kyber is to make real time control of machine.

Distance disappear.

Lex Fridman3:37:16

It's in- it's incredible. And some of the same technology, some of the same ideas that we're talking about is, is connected to what you're doing.

Jean-Baptiste Kempf3:37:22

And for, for me, it's amazingly challenging, right? Because I would say that on video, I'm doing okay, but networking, um, I have so much more to learn, right? It's, uh, um, about like congestion protocols, bitrate adaptation in real time.

Um, but it's, it's quite funny. A-and, and so I created this project and, and we, we have fundraised in the US, of course. But it's open source, right? This is important, right? Like we've not said that, right? But everything on Kyber is open source.

Lex Fridman3:37:50

So how do you make money?

Jean-Baptiste Kempf3:37:52

It's a, a dual license, commercial and AGPL, right? You remember what you said-

Lex Fridman3:37:57

Mm-hmm

Jean-Baptiste Kempf3:37:57

... about, about, uh, licenses. Uh, basically, if you want to use Kyber in your product, you must have your full product open source. If you want to use this amazing technology but not open source, you pay the commercial license, right?

So the small people or the, the, the hobbyist a-and the, the very small, uh, guys who want to do that, they can use the technology. They build something that is open source and cool.

Lex Fridman3:38:19

That's awesome.

Jean-Baptiste Kempf3:38:19

And if you're a large company, you're going to have the support, all the IP, the right modification, and so on. So, um, yeah, it's really cool and, and, and also I'm building robots, and I love that, right?

Lex Fridman3:38:32

Oh, damn.

Jean-Baptiste Kempf3:38:32

Like w- like the, the rover we have is 3D printed. Um, we are finishing a demo where it's an actual wing, right? Like a type of drone wings that is also fully 3D printed. Um, we are trying to l- do a, a, a sailboat that is, uh, 3D printed.

Uh, and, and, and we'll work on some humanoids. Of course, they are not going to be very good robots, right? It's not our job. But we're here for everyone to make robots. Cool.

Lex Fridman3:38:58

Uh, you're talking to the right guy. I love robots. There's a bunch of them upstairs. Uh, and teleop is gonna be really, really important, especially as the number of robots scales across the world. So 100%. Let's talk about the future of, um, multimedia.

FFmpeg, VLC, but, uh, some of the codecs, we didn't really mention AV2. So can we just lay out what is AV2? What is the hope for it? What is H.265, H.266?

Jean-Baptiste Kempf3:39:26

So AV1 is this codec that is done by the Alliance for OpenMedia, right? Where there is, uh, Google, Netflix, Amazon, Apple, uh, VideoLAN, where we try to make a royalty-free, very good codec, right? And now it's being deployed.

But actually, the codec was finished in 2018, but a codec takes years to be used in wide scenarios, right? So, uh, AV2 is the next generation of this codec. It's 30% better, right? So if you keep the same, uh, quality, you get 30% bandwidth reduction compared to AV1.

Lex Fridman3:40:03

What's the connection with, uh, the Dav1d and AV2?

Jean-Baptiste Kempf3:40:07

We are going to do a Dav1d two, right? That I call Devid because de is two in French. Um-

Lex Fridman3:40:13

Ah, well done

Jean-Baptiste Kempf3:40:14

... and, and you have to know that Dav1d is an actual, uh, what we call recursive acronym, right? Because it means D, Dav1d, is an AV1 decoder, right? So, so-

Lex Fridman3:40:24

Oh, nice. Nice. I didn't even think of that. And, uh, people should know that Dav1d is spelled with a one.

Jean-Baptiste Kempf3:40:30

Yes. It's, um... And so Dav1d two-

Lex Fridman3:40:32

It's gonna be spelled with a two. Please tell us

Jean-Baptiste Kempf3:40:34

... it's going to be D-A-V two D. Sorry, I don't know how you pronounce that. Uh, and again, we did a demo at the CES of VLC running the first demo of AV2.

Lex Fridman3:40:45

So can you clarify to me the specification of AV2? And then the encoding and the decoding

Jean-Baptiste Kempf3:40:53

Sure. So the specification is like the document which explains how the codec is supposed to work, right?

Lex Fridman3:41:00

And that's really AV2.

Jean-Baptiste Kempf3:41:02

That is AV2, like H.264.

Lex Fridman3:41:04

Yeah.

Jean-Baptiste Kempf3:41:04

Right? Then you have an encoder. The current encoder is called AVM, and there will probably be other encoders, probably one called SVT-AV2, and those are the encoder. The same way X.264 is an encoder to H.264, the same way that X.265 is an encoder for the H.265 codec.

And the decoders for AV1 is David. The decoder for AV2 is David2. The decoder for H.264 is FFH.264 inside FFmpeg. The decoder for HEVC is FFHEVC inside FFmpeg. Um, and there is a next generation codec from the MPEG world after H.264, H.265.

There is one that is called H.266, or also known, known as VVC.

Lex Fridman3:41:59

So HEVC is H.265.

Jean-Baptiste Kempf3:42:03

Yep.

Lex Fridman3:42:03

VVC is H.266. Why is H.266 super sexy and so much better?

Jean-Baptiste Kempf3:42:10

So the, the question often we have is why are there two names?

Lex Fridman3:42:14

Yeah.

Jean-Baptiste Kempf3:42:14

Because most of the time it is a conjunct work from the ISO world and the ITU, which is the International Telecommunication Union.

Lex Fridman3:42:24

These are these two regulatory bodies.

Kieran Kunhya3:42:26

No, one is a private entity and one is the United Nations.

Lex Fridman3:42:29

Which one is the private?

Kieran Kunhya3:42:30

ISO is private.

Jean-Baptiste Kempf3:42:31

In theory, H.264 is MPEG-4 Part 10, H.264/AVC.

Kieran Kunhya3:42:42

Yeah.

Lex Fridman3:42:42

Mm-hmm.

Jean-Baptiste Kempf3:42:42

And this is the full name.

Lex Fridman3:42:44

Nice.

Kieran Kunhya3:42:44

So it's the concatenation of the ISO name and the ITU name-

Lex Fridman3:42:48

Yeah

Kieran Kunhya3:42:49

... even though they work together. This is, this is politics, historical, you know.

Lex Fridman3:42:53

Yeah.

Jean-Baptiste Kempf3:42:53

And for HEVC-

Lex Fridman3:42:55

Gotcha

Jean-Baptiste Kempf3:42:55

... it's MPEG-H, H.265, HEVC.

Lex Fridman3:42:59

Got it.

Jean-Baptiste Kempf3:42:59

And there is H.266, which is also named VVC.

Lex Fridman3:43:03

Is there a high-level thing to say about the improvement of-

Jean-Baptiste Kempf3:43:06

30% each generation is a best summary.

Lex Fridman3:43:09

This is true both for the AV-

Jean-Baptiste Kempf3:43:11

Yes

Lex Fridman3:43:12

... codecs and the-

Jean-Baptiste Kempf3:43:13

Yes

Lex Fridman3:43:13

... H.264, 5, 6.

Jean-Baptiste Kempf3:43:15

So the, the professional who are listening to us are going to kill us because they say, "No, it's 35%, 25%-"

Kieran Kunhya3:43:21

No, it's 50, 60

Jean-Baptiste Kempf3:43:21

... it's 50," blah, blah, blah. But globally you need to know that HEVC is 30% better than, than H.264. H.266 is 30% better than H.265 because there is so many case and so many scenarios. For example, there are cases especially for screen recording where the gains are humongous because you arrive, you have the right tool that is done for that.

And so for a specific video, a new generation is going to give you 70% gain or 80% gain.

Lex Fridman3:43:49

Yeah. Yeah.

Jean-Baptiste Kempf3:43:50

Right? Um, but there used to be a ton more codecs, but now the two main codecs for transmission are the H.264, H.265, H.266, and the other is AV1, AV2.

Lex Fridman3:44:00

And I guess the, the major difference would be the cost of encoding.

Kieran Kunhya3:44:05

Yes.

Jean-Baptiste Kempf3:44:05

Yes, and the royalty of the patents. And this is the reasons why you see the AV version of codecs is because, um, they try to be as royalty-free, which means no cost for the patents as much as possible.

Because what you need to know, and we've not talked about that so far, is that multimedia is what we call a patent minefield. There is two places where it's, where you have the most patents. It's everything related to 3G, 4G, 5G RF, and multimedia.

Lex Fridman3:44:36

Mm-hmm.

Jean-Baptiste Kempf3:44:36

Um, because it's very mathematical, and you can get great gains and so on. Um, so Google and Meta and Netflix wanted something where it was royalty-free. There are people who said that they have patents outside, but they are fringe patents, right?

So m- it's mostly true that it's patent-free.

Kieran Kunhya3:44:54

Oh, you should extend pat- patent checking was done as part of the standardization process in AV1, AV2, whereas patents are not even discussed in the MPEG world.

Jean-Baptiste Kempf3:45:06

MPEG world.

Kieran Kunhya3:45:06

Patents are off-topic completely.

Lex Fridman3:45:08

Can you educate me at the patents side?

Jean-Baptiste Kempf3:45:11

So usually, so MPEG does a, a format, right? And then there is, um, everyone comes around and say, "Well, I have all those patents for a format," and they do usually a, a, a union called, um, what's called MPEG LA, MPEG Licensing Association.

Um, and you put all the, all your patents in, and then you ask everyone who's using this format to pay for it.

Lex Fridman3:45:32

Wait, can you elaborate? What does it mean to have a patent of a codec? Why is there many patents?

Jean-Baptiste Kempf3:45:37

Uh, imagine I'm doing something where I'm going to def- instead of doing blocks which are square, I'm going to do rectangles, right?

Lex Fridman3:45:44

Oh, so every idea-

Jean-Baptiste Kempf3:45:46

Yes

Lex Fridman3:45:46

... somebody patents it.

Kieran Kunhya3:45:47

Yeah.

Jean-Baptiste Kempf3:45:47

Yes.

Lex Fridman3:45:50

Oh, man.

Jean-Baptiste Kempf3:45:51

Yes.

Lex Fridman3:45:52

Oh, man. People and their... How many lawyers are-

Kieran Kunhya3:45:57

I mean, it pays for a lot of lawyers, right? Like-

Jean-Baptiste Kempf3:45:58

The biggest issue is not the following, right? Because at time of H.264, the patents were, let's call it, like, sane. But there was, there was so much money in that-

Lex Fridman3:46:09

Yeah

Jean-Baptiste Kempf3:46:09

... that for HEVC, a lot, there were a ton of things that were pushed inside the specification, which are not useful in 99.9% of the time, but so just one could add a patent on it. And so it became that for HEVC licensing, there was MPEG LA plus another patent pool called HEVC Advance.

Kieran Kunhya3:46:31

Yeah.

Jean-Baptiste Kempf3:46:31

Plus-

Kieran Kunhya3:46:32

That one

Jean-Baptiste Kempf3:46:32

... um, I think was Nokia was outside of the patent pool.

Kieran Kunhya3:46:35

Yeah, a few of them are outside, and some other one that's-

Jean-Baptiste Kempf3:46:37

And so it was impossible to license, right? And I think that several months ago, HP decided that they were going to remove support from HEVC in their Windows laptops because the, the cost was increasing of those patents. And it arrived-

Lex Fridman3:46:53

Nice

Jean-Baptiste Kempf3:46:53

... where a point where, and there was uncapped pad. And so for YouTube or Netflix, we could talk about Hundreds of millions of dollars of licensing for patents per year. And they said, "You know what? At hundred millions, uh, per year, you know, I could create my own codec," and this is what they did.

And so that's why we have the Open Media alliance, Alliance for Open Media, where we are part of, that is that created AV1 and creates AV2. Uh, we create also audio codecs. But yes, so the main difference would be that, and because you need to work around the patents or go do some things that are not patented, a lot of things are different, right?

The basic things that were done in M- MPEG-2-

Lex Fridman3:47:37

Yeah

Jean-Baptiste Kempf3:47:37

... 30 years ago are, of course, out of patents. But so for example, there is things like, uh, a golden frame, a S frame or, or a different type of-

Lex Fridman3:47:47

These are all patented ideas.

Jean-Baptiste Kempf3:47:48

Yeah, no, it's I, I can't believe it's not butter. I can't believe it's not a B frame. It's, I mean, I mean, it's kind of what it is. In some ways, it's like a-

Lex Fridman3:47:56

Oh, so it's a different variant of a B frame.

Jean-Baptiste Kempf3:47:57

Yeah, that's to try and sidestep, uh, things like that. And so you need to have double creativity, right? Creativity in terms of ha- being more efficient, but creativity of being sure that you don't infringe existing patents. And so, for example, VVC is, has all the patents of HEVC plus new ones, right?

It's why AV2 tries to be as royalty-free as possible.

Lex Fridman3:48:21

To what degree does FFmpeg and VLC have to think about this kind of stuff?

Jean-Baptiste Kempf3:48:25

We don't, and one of the reasons why VLC was in France is that France rejects software patents. So most of those patents are illegal in France because I once made the compu- the, the calculus that if I had to pay all the licensing fee for VLC, I needed to pay more than two hundred euros per user, right?

It's the same in dollars. Um, but most of those patents are invalid in Europe because those are called, it's basically mathematical patents or idea patents, and they are not valid in Europe.

Lex Fridman3:49:00

Uh, let me just at a high level, just out of curiosity. So the meme online and the interwebs on X and Twitter and so on, and my own, I have friends in Europe, uh, this, the sense is that Europe is not friendly to entrepreneurship.

They over-regulate, there's too much bureaucracy, and so on. Is, is there any- anything positive to say? Is there hope for entrepreneurship-

Jean-Baptiste Kempf3:49:26

Yes

Lex Fridman3:49:27

... in the future of Europe? Is Europe over from a tech perspective?

Jean-Baptiste Kempf3:49:32

Just, just look at the two of us, right? It, it's notable that there's two people from the European continent on this podcast talking about video. It's fair to say the community has weighted heavily. What you probably don't see yet is that there is a new generation of entrepreneurs in Europe and mostly in France.

Uh, UK has done it since a long time because, well, it's more, it's more Anglo-Saxon type of, uh, business, look at business. But, uh, especially like what happened i, in France, and of course, sometimes it's a bit overdone with everything called French tech, but today, most of the people who come on the market wants to st- create startups.

Fifteen years ago, it wasn't the case. Everyone wanted to work on big companies because when you failed i, i- in France, for example, twenty years ago, fifteen years ago, and you destroy your company, which is normal for startup, right?

You, you, you were not allowed to create a new company, right? There was a lot of stigma. The stigma is gone. Um-

Lex Fridman3:50:32

Mm-hmm

Jean-Baptiste Kempf3:50:32

... there is so many things happening on AI i, i- in France and so on, right? So there is sure, over-regulations. I, I know that, right? I'm an entrepreneur. Um, but it has some good things also.

Lex Fridman3:50:46

I mean, is there some paralyzing aspects? You know, if I look at, at the case of somebody I've, uh, become close with, Pavel Durov, you know, he was, uh, uh, blamed directly by the French government for the kind of things his, quote, "platform" was hosting.

Uh, I could see the same kind of stuff basically, just as an example, VLC being blamed for the kind of videos that people are watching.

Jean-Baptiste Kempf3:51:14

But they tried, right? Like we ha- we like- ... we, we had issues like, we like-

Lex Fridman3:51:19

I mean, is that, that's the pressure that people worry about because if you have to think about that kind of stuff when you're kind of just obsessed about-

Jean-Baptiste Kempf3:51:26

No, you don't think about it-

Lex Fridman3:51:27

Great

Jean-Baptiste Kempf3:51:27

... and that's, that's okay, right? Like-

Lex Fridman3:51:29

But what if they come in, when, what if they show up and-

Jean-Baptiste Kempf3:51:32

There is no office. VideoLAN doesn't have office.

Lex Fridman3:51:34

I mean, this is what happened with Pavel. They arrested him, right? So arrested him for particular videos or, or a particular content that's being shared on the platform.

Jean-Baptiste Kempf3:51:42

Sure. I don't have any platform. Everything is on the client side.

Lex Fridman3:51:45

Yeah, but they're, they can still arrest you.

Jean-Baptiste Kempf3:51:48

On what ground? I'm not sharing anything. I'm not-- The content doesn't go through my, my stuff.

Lex Fridman3:51:52

For sure, but it's still lawyer fees. That's the problem.

Jean-Baptiste Kempf3:51:55

Yes, that's correct.

Lex Fridman3:51:56

It's paperwork. So like, actually, if you had infinite trillions of dollars, uh, you would win, uh, easily because you're on the right side. But the thing is, there is a, a degree to which they suffocate you with paperwork.

That's, that's the downside of bureaucracy, through paperwork, through process.

Jean-Baptiste Kempf3:52:16

Yes.

Lex Fridman3:52:16

You know, it's the Kafkaesque thing.

Jean-Baptiste Kempf3:52:17

You, you, you have to s- to, to realize that one of the good things, for example, um, i- i- in France or most of Europe, is that the, the

answering to a court order does not make you bankrupt, right? It's not like in the US, where it can actually bankrupt you, right? Th- there is-- The, the way the law system work is that, like, I, I receive lawyers' letters every week, right?

And I can tell you that the cost of lawyer fees for VideoLAN is less than ten thousand dollars per year, right?

Lex Fridman3:52:52

Mm.

Jean-Baptiste Kempf3:52:52

Right? So that's not really scary.

Lex Fridman3:52:54

I mean, similar with Pavel. The intelligence agencies tried to, like, say, "Can you put a backdoor in VLC?"

Jean-Baptiste Kempf3:53:00

Yes. Two of them.

Lex Fridman3:53:01

What, what do you say?

Jean-Baptiste Kempf3:53:03

No. Well, I was a lot less polite.

Lex Fridman3:53:06

I s- I see you, uh... Yeah, yeah. You're basically saying, "Hell no."

Jean-Baptiste Kempf3:53:10

Like, if we had to compromise our software, we would shut it down. This is clear.

Lex Fridman3:53:14

And what's the definition of co- compromise? Like, uh, allowing a government to do a backdoor-

Jean-Baptiste Kempf3:53:20

There is no code that gets into VLC that we don't control, and the way we compile VLC, you would call me completely paranoid. Like, we compile on boxes that are offline, where we start by compiling the compiler. We do everything offline on, on, on places that have never been connected to the internet.

Uh, we-- The way we do signing, there is double signature. Um, e- and especially because, for example, we've seen, and we believe it's a, it's a governmental agency that is not from, uh, the Western world who tried to push a fake binary into our own servers, uh, and that scared us a lot.

And VideoLAN is open source. How can you kill it? Like, I move to where, right? I move to Malta. I move to, uh, I don't know, Cayman Islands, and the, I, I change the domain name, and I, I start again, right?

Like, VLC is a tool. Um, it's a tool that is going to help people doing things. Uh, we are not a platform. Um, and for patents, well, I'm sorry, but most of the patents... Like, you shouldn't be able to patent math and matrices.

Like, this is wrong.

Lex Fridman3:54:32

So does VLC ever, like, censor the kind of videos it can play and not based on the content of the video?

Jean-Baptiste Kempf3:54:39

No, never. We never do that because, like, a, a VLC is completely offline. It doesn't talk to any server, so we don't know anything that you're using the software for.

Lex Fridman3:54:50

So again, there's no government that can say, you know, like the French government come in and say, "We don't want, uh... I think anime is destructive to society. We don't want any anime not allowed to be..."

Jean-Baptiste Kempf3:55:03

No, they cannot, they cannot do that. And also what they tried is to say, "Hey, I want to know if that person watched that type of video." And the answer is like, "No idea."

Lex Fridman3:55:12

So no on that too. So for surveillance, no.

Jean-Baptiste Kempf3:55:15

No, no, because the only infrastructure we have is a downloading infrastructure. There is no telemetry in VLC, right?

Lex Fridman3:55:21

It, it would be difficult 'cause of the international nature. It would be difficult for you to incorporate that code because there would be someone in the UK and someone in Germany and someone in, in the US as part of VideoLAN who'd be able to see that.

It would be extremely difficult.

Jean-Baptiste Kempf3:55:34

The, the only thing that we can do, which happened, is like we had the issue-- We, we had the case with some police in the US who said, "We have a murder case, right?

Lex Fridman3:55:42

Mm-hmm.

Jean-Baptiste Kempf3:55:42

Uh, and the file is destructed or doesn't play in that version of VLC. Could you help us?" Right? We never have access to the video. It's like a normal support, right?

Lex Fridman3:55:50

Oh, it's really about playing the file?

Jean-Baptiste Kempf3:55:52

Yes. And, like, I remember in the middle of the Afghan war, right? I received a, a, an email from someone in the army, right? I don't remember the grades, right? It was just like, "We have a big issue with the latest version of VLC because it doesn't play correctly the file on an RTSP server that we have where there is all the m- the movies."

And he says VLC is very important for the moral on the troop on the ground, right? Because at night I think it might be boring, right? So they have a collection of videos to watch or movies over there, right?

So, uh... And, and of course I did an update, and I broke some support of RTSP, right? So I gave them another version just for them, right? Because it was important. And because VLC is completely open source, I think it, it is allowed on the US Army laptops, right?

Because the, I guess someone in, in the, in the US military actually looked at it and say, "Well, okay, this is okay," right? And the way we document how we process that was okay, right? So the only way we c- we, we work with authorities is to help them, uh, doing support.

Lex Fridman3:56:54

That's amazing. That's really am- that's an amazing story. Yeah.

Jean-Baptiste Kempf3:56:56

We don't see anything happening on how people use VLC, and this is strong.

Lex Fridman3:57:01

Do you feel the stress of this? So first of all, millions of people using it. Second of all, the military using it, maybe sometimes pressure from governments.

Jean-Baptiste Kempf3:57:12

Yes.

Lex Fridman3:57:12

Does that, does that... That's a, that's a small team, right?

Jean-Baptiste Kempf3:57:17

Yeah, but-

Lex Fridman3:57:17

How big is VLC contri- like the core contribute? How many?

Jean-Baptiste Kempf3:57:21

Six, eight. But, and, and, and everything legally is only me. Everything that is legal is only me.

Lex Fridman3:57:29

You're not stressed about this?

Jean-Baptiste Kempf3:57:30

I used to stress about that a lot.

Lex Fridman3:57:32

Yeah.

Jean-Baptiste Kempf3:57:33

But the thing is, we're doing what we can for everyone, for the greater good. We, we work that we make some extremely complex technology easy for everyone. We're a tool, and e- every tool is going to be used for great things and for bad things, right?

You, you cannot blame a tool, uh, uh, I think. Um, a- and, and this is, like, very important for us. Um, I used to be a lot, in a lot of stress. I'm not anymore, right?

Lex Fridman3:58:01

What's the secret to your zen? I mean- O- over and over in the chats I've had with you, uh, in the t- in the conversation today about every even tense topic, you're very zen. What's the, uh, what's the source of zen?

Jean-Baptiste Kempf3:58:15

I, I have, um, a way of, um, thinking about what is the worst case scenario, always, right? And the answer is, at the end, if I take like a, like a chess player, right?

Lex Fridman3:58:27

Mm-hmm.

Jean-Baptiste Kempf3:58:27

In the end, am I dead? Yes or no? Right? And, and I do that nonstop, right?

Lex Fridman3:58:33

Yeah.

Jean-Baptiste Kempf3:58:33

And that's also how I do, um, my, my startups, right? Is that I'm here to get something great. What is the worst case? It goes bankrupt. That's life. A company lives, a company dies. That's okay, right? Like, and so my, my moral way is always like, am I dying in the end?

Am I hurting someone? If I'm, um, if the answer is no, then too bad, right? Like, oh, some lawyers are going to be unhappy. What are they going to do? Take all the money of VideoLAN? Wow, they're going to have 50 grand.

Amazing, right? What are they going to do with that? The code, the source code is out there. It's not stoppable. Also because what we do is good a- and it's done for everyone.

Lex Fridman3:59:14

That's beautiful. Uh, Kieran, you, you said that there's an active archiving, uh, preservation community.

Kieran Kunhya3:59:21

Yeah.

Lex Fridman3:59:21

I think that's super fascinating. You wrote that they're stretched in budget, but they see the extreme importance of FFmpeg as a Rosetta Stone so that multimedia can be played a thousand years from now. I mean, that's a beautiful way to see FFmpeg, VLC as a tool for preserving visual knowledge.

Kieran Kunhya3:59:42

Yes. So one of the coolest communities, um, in open source multimedia, uh, mainly led by someone called Dave Rice, I'll give him a shout-out, I think from, um, City University of New York, is the archiving community. They've done so much stuff.

They, they value the- they value open source, one, because yes, they lack budgets, but two, they see the fact that archiving video is important for the world, and but being able to play that is a big problem. Um, famously in the UK, there was a something called the, the New Doomsday Book, and they, they archived lots of stuff on BBC microcomputers.

Within ten to 15 years, no one had the right software to play that. I think it was 20 years or something like that, and someone had to go and reverse engineer this, and that was at 20 years. Imagine that in a thousand years.

I think one of the, the great things about FFmpeg is it's written in C. C is the closest to mathematics you're probably gonna get. The closest to logic is-

Jean-Baptiste Kempf4:00:35

Do you think in 1,000 years we'd still have C compilers?

Kieran Kunhya4:00:37

Yes. We have languages that exist that haven't changed too much. We have mathematic, mathematical notation that exists. Um, it will be like Latin. C will be like Latin. It will be a thing that you learn from the past, but it will still be usable in certain contexts.

Um, so the archiving community are really great practically. They, they, again, limited funds. They funded the development of the, of the FFV1 codec, so that's a lossless codec. So for... So the, the archiving community is really scared about the act of compression losing things, and this could- this is-- They have a fair point in this, you know.

Lex Fridman4:01:07

Yeah.

Kieran Kunhya4:01:08

If they compress too hard, it could change the view of the material. There could be something slightly different here and there. So they're really concerned about things need to be not just compress well, but lossless and be fast.

And, and so they worked with FFmpeg to develop a whole new codec designed for fast software-based encoding. They're really concerned about resilience, so they st- if they're storing on tapes or other hard disks, I lose some bits, I need to recover quickly.

I can't lose a whole GOP because I've lost a bit-

Lex Fridman4:01:39

Mm-hmm

Kieran Kunhya4:01:39

... something like that. So they're a really great bunch of people. They funded GPU encoding in FFmpeg, um, to make FFV1 encode faster. And, and it's really about preserving the world's multimedia heritage in a way that's usable, and there's, there's a lot of great teams and a lot of archival groups across the world who've, who've chosen FFmpeg and FFV1 as their archiving solution.

And they can really provide us also super specialist advice. They can-

Jean-Baptiste Kempf4:02:08

Yes, yes

Kieran Kunhya4:02:08

... explain, "Ah, in the 1950s, colorimetry was done like this on this certain type of tape, and so there is, uh, this special case that you need to handle, and you'll never get this anywhere else."

Jean-Baptiste Kempf4:02:21

You see, they know things on video that we don't.

Kieran Kunhya4:02:24

Yes.

Jean-Baptiste Kempf4:02:25

Like, every time I talk to, was it Dave-

Kieran Kunhya4:02:27

Dave Ri- Dave Rice

Jean-Baptiste Kempf4:02:27

... or, or the people from the British, uh-

Kieran Kunhya4:02:29

British Film, uh

Jean-Baptiste Kempf4:02:30

... Film, it's just like every time I j- just learn something new, and I've been doing video for 20 years. They, they have, especially on colomer- colorimetry and, and colors.

Kieran Kunhya4:02:40

Storage, these other things.

Lex Fridman4:02:41

I mean, they have a deep, deep appreciation of the content itself, of the video itself.

Kieran Kunhya4:02:46

Yeah.

Lex Fridman4:02:46

And like, especially when you're thinking of lossless, they're terrified of losing something essential-

Kieran Kunhya4:02:52

Yes

Lex Fridman4:02:52

... about the thing, and in so doing, they're deeply understanding the thing that is-

Kieran Kunhya4:02:57

Yeah

Lex Fridman4:02:57

... to be preserved, which you sometimes might not be thinking about when you're obsessing about the actual technology of the encoding and so on.

Jean-Baptiste Kempf4:03:04

And when you enter the habit hole of film scanners, right? So you take those-

Lex Fridman4:03:09

Uh-huh.

Jean-Baptiste Kempf4:03:10

... those things to make to digital, like, it's like-

Lex Fridman4:03:13

Yeah

Jean-Baptiste Kempf4:03:13

... a huge topic that, like, would take another five hours of podcast-

Lex Fridman4:03:18

Yeah.

Jean-Baptiste Kempf4:03:18

Just on that topic.

Kieran Kunhya4:03:19

On film. And there's a lot of film that needs to be archived. Film is degrading. It's maybe not stored in the right environment. The other thing is they can... What they also do is, because it's open source, they give this away their workflows to countries who can't afford to have archiving institutions, where archiving is done by volunteers, it's done by other things.

They go and teach, you know, in India, they teach children to do, to do FFmpeg commands. They're really great. They're really, uh, they're really the model community, the model ethos of what we're trying to achieve, that they, they are such a great bunch of people, so interested in participating and being part of something much bigger because they realize the work they're doing in a thousand years is gonna tell a lot.

You know, in a, in a thousand years we may be drowning in AI slop. This stuff needs to be important and, you know, archived well. What was, what was life like?

Lex Fridman4:04:07

Yeah. It feels like capturing the 20th century and the 21st century is essential because it feels like a transition point, where we went from scarcity of data to slop-

Kieran Kunhya4:04:20

Yeah

Lex Fridman4:04:21

... oceans of slop, and that transition point is good to archive.

Kieran Kunhya4:04:25

It's important, yeah.

Jean-Baptiste Kempf4:04:25

But people don't realize we are losing today a ton of films. There is a ton of things from the '30s, from the '40s, and the '50s that where there is no value-

Kieran Kunhya4:04:37

And tape. '70s and '80s, there's tape, and there's not enough tape heads in the world-

Jean-Baptiste Kempf4:04:42

To read all the tapes

Kieran Kunhya4:04:42

... left to redo, so they have to decide what they want to archive and throw away the rest of the tapes.

Jean-Baptiste Kempf4:04:47

Mm-hmm.

Kieran Kunhya4:04:47

There's huge moral hazard, I guess, uh, for want of a better phrase, around this topic because this is a digital record of human history, and they have to make decisions that... And there's digital stewardship, I suppose, for want to...

I've, I made that phrase up. That's not a real phrase. Um, to make sure the world can have this information in a, in something that's playable by everybody, not-

Lex Fridman4:05:08

Mm-hmm

Kieran Kunhya4:05:08

... playable on some device that, well, it doesn't exist anymore.

Lex Fridman4:05:13

And then there's like, r- realistically speaking, there's a needle in a haystack where, uh, there's a lot of value in s- in, uh, archiving all that footage, and then over time finding the gems-

Kieran Kunhya4:05:24

Yeah

Lex Fridman4:05:24

... that we don't know are there.

Kieran Kunhya4:05:26

Hey, there was something in that corner that we just didn't-

Lex Fridman4:05:28

Yeah. Uh-huh.

Kieran Kunhya4:05:29

And that, that would've been compressed away because it was some little thing. Oh, wow, there's something there.

Lex Fridman4:05:33

That's it.

Kieran Kunhya4:05:33

And that's... They've made sure that it's lossless. They can prove mathematically that it's lossless. They can run different trade-offs for if there's bit thr- they lose a bit, a single bit flips, I can make sure that I only lose a portion of a given frame.

We can do error recov- they can do error recovery on previous frames. They can do all sorts of different things.

Lex Fridman4:05:53

Do you think, uh, VLC and FFmpeg will be here 100 years from now?

Jean-Baptiste Kempf4:05:58

FFmpeg, yes.

Kieran Kunhya4:05:58

Yep, FFmpeg, yes.

Jean-Baptiste Kempf4:05:59

VLC, maybe.

Lex Fridman4:06:01

What's the future of... W- where, where is FFmpeg going? Where is VLC going? Like in the next... If you think about, like, five years, 10 years, 20 years.

Jean-Baptiste Kempf4:06:11

Five years, 10 years is easy. The question is after that, right? Um, the question is-

Lex Fridman4:06:16

Yeah

Jean-Baptiste Kempf4:06:16

... do we arrive at something called holograms, right?

Lex Fridman4:06:20

Yeah, so will VLC and FFmpeg expand-

Jean-Baptiste Kempf4:06:24

Yes

Lex Fridman4:06:25

... to whatever-

Jean-Baptiste Kempf4:06:26

Yes.

Kieran Kunhya4:06:26

Multimedia

Lex Fridman4:06:27

... multimedia?

Jean-Baptiste Kempf4:06:28

Yes.

Lex Fridman4:06:28

So multimedia might become, sorry for the pothead expansion of topic, but, you know, um, if you look at something like Neuralink with brain computer interfaces, it's very possible that we start to consume what multimedia means is whatever codec, whatever data that our brain wants to consume through the brain computer interfaces.

Jean-Baptiste Kempf4:06:50

Sure.

Lex Fridman4:06:50

That's one. Then virtual reality, of course.

Jean-Baptiste Kempf4:06:53

You will have VLC for Neuralink.

Kieran Kunhya4:06:55

Yep, and you'll, you'll have FFmpeg-I input format human brain.

Lex Fridman4:06:59

Yeah. There's gonna be codecs for the brain.

Jean-Baptiste Kempf4:07:01

Yes.

Kieran Kunhya4:07:01

Sure, 100%.

Jean-Baptiste Kempf4:07:03

Of course. I mean-

Kieran Kunhya4:07:04

Yeah, to compress neural information, yeah

Jean-Baptiste Kempf4:07:05

... today, today there is like, there are new codecs for-

Lex Fridman4:07:08

Whoa

Jean-Baptiste Kempf4:07:08

... for example, what we call point cloud, right? Or volumetric videos, right?

Lex Fridman4:07:12

Yeah.

Jean-Baptiste Kempf4:07:12

There is a ton of research on what we call RGBD, right? So codecs for depths that is useful for robotics and for 3D things.

Lex Fridman4:07:19

Nice.

Jean-Baptiste Kempf4:07:19

There is a ton of codecs for compression of 3D elements.

Kieran Kunhya4:07:23

Compression for astronomy.

Jean-Baptiste Kempf4:07:24

Well, for example, on VLC, we also have already a VR and XR version of VLC. And also on Kyber, right? We talk about Kyber. On Kyber, we also like do streaming of XR content on, on, for the glasses who cannot have, uh, enough power or inside the Apple Vision or the Quest.

Um, so we already work on, uh, streaming 3D, XR, interactive, low latency. There is something called volumetric video, point cloud videos, so it's not stopping. And yes, at some point it will manage 3D data inside VLC and FFmpeg, right?

It's obvious.

Lex Fridman4:07:58

So that's where it is moving, like the community is open.

Jean-Baptiste Kempf4:08:01

Not everyone in the community sees that, but like, as Kieran and I, we are, we, we are entrepreneurs, we know where it's going. We, we see that, right?

Lex Fridman4:08:10

So I, I suppose that there is a tension probably inside FFmpeg. It's like, "Hey, listen, folks, we're really good at doing video and audio, so, like, why expand? Like, let's do the thing we're really good at doing."

Jean-Baptiste Kempf4:08:25

In order to answer that question, we need to answer the definition of what is multimedia.

Lex Fridman4:08:31

Yeah.

Jean-Baptiste Kempf4:08:31

And multimedia is a digital representation of several streams for the human senses. And we will do that, right? So imagine there is now a way to not have a mic, but have a odor sensor-

Lex Fridman4:08:50

Mm-hmm

Jean-Baptiste Kempf4:08:50

... and a diffuser of odors.

Lex Fridman4:08:52

Mm-hmm.

Jean-Baptiste Kempf4:08:53

It will get into FFmpeg.

Lex Fridman4:08:54

So your demuxer is coming up.

Jean-Baptiste Kempf4:08:56

Yes. Yes. Of course, your demuxer has a new track type that is basically odors, right? And you already have-

Lex Fridman4:09:02

Smell, touch.

Kieran Kunhya4:09:03

It's like audio. You'll have a left and right nose track. You have a left and right audio pair. It's easy.

Jean-Baptiste Kempf4:09:08

Yes, of course.

Lex Fridman4:09:09

Stereo smell.

Kieran Kunhya4:09:10

Stereo smell, yeah.

Jean-Baptiste Kempf4:09:11

So in VLC, for example, we already have a plugin for haptic. It, it's mostly for the, what we call 4D cinemas, right? You know, those ones on hydraulic, I don't know how you say that, all the hy- hydraulic-

Kieran Kunhya4:09:21

Hydraulic, uh, arms. Hydraulic, um-

Jean-Baptiste Kempf4:09:22

Arms. And where everything is moving, like you have, uh, in theme parks, right?

Kieran Kunhya4:09:26

Mm-hmm.

Jean-Baptiste Kempf4:09:26

And there is a data feed synchronized where, which is basically transporting this information.

Lex Fridman4:09:32

Is there, is there yet a standard for that?

Jean-Baptiste Kempf4:09:33

There are many standards, right? Um-

Lex Fridman4:09:36

This is, you make me so happy.

Jean-Baptiste Kempf4:09:38

And, and so of course, like we have a plugin which is not in the normal version of VLC-

Lex Fridman4:09:44

That's true

Jean-Baptiste Kempf4:09:44

... that is basically transporting those type of movements, which is physical movements, which is haptic movements, right? It is a s- a human sense, so it will get in.

Lex Fridman4:09:54

That's such an exciting future. Was it... I mean, it's a small community of developers. How do you pull that off? Like if you're a contributor to FFmpeg or VLC, it feels stressful. Like it, just looking on Twitter, it's like it's, it's a huge amount of work to make it work on all these different operating systems and incredible effort.

Jean-Baptiste Kempf4:10:17

No, see it in the other direction. We are not the contributors, we are the maintainers, right? So we maintain for everyone. Meaning that, for example, every year there is around 150 people who contribute to VLC and maybe 300 on FFmpeg, right?

Our goal as a small team is to get all the contribution in. So if there is more usage, there will be more contributions, and those people will do the right module, the new format, and so on. We care about the architecture of VLC, the architecture of FFmpeg, right?

Now we're doing things in FF- in VLC, which is, uh, spatial audio, right? We did the demo not, not long ago. There was changes needed on the architecture, and we did the first spatial audio module. When it's going to add the second one, it's going to be easy, or the third one is going to be easy, right?

Our goal, and it's going to be the same for odors or haptic, right? We need to work the architecture so that modules can be added to add future capabilities.

Lex Fridman4:11:21

Mm-hmm.

Jean-Baptiste Kempf4:11:21

So yes, we are going, we are multimedia framework, so that's not just audio and video. It's everything that is timed and- Represent something that you can sense. And if it's brainwaves, it's going to be brainwaves.

Kieran Kunhya4:11:37

I think that's inevitable. Sorry.

Lex Fridman4:11:39

I, I love this on so many fronts because, so FFmpeg and VLC are pushing companies and pushing the world to standardize. So for example-

Jean-Baptiste Kempf4:11:49

Yes

Lex Fridman4:11:49

... to standardize brainwaves, right? So standardize it's, it would push, like I hope Neuralink comes up with a standard for, for multimedia via brain computer interfaces or for robots with haptic.

Jean-Baptiste Kempf4:12:05

By experience, what happens is always the same, right? You start, it's a new topic. There is like five different standards because everyone starts to do this. The hype goes down because every time the hype goes down, then people start to say, "Well, you know what?

We, we need to do a standard." People, because two or three companies, usually not the leader, but the two or three followers do a standard, and then we implement the standard and, and then it's the end of the curves.

It starts to be more pepper.

Lex Fridman4:12:33

And then the leader's kind of pressured into it because it is better to do a standard. Yeah.

Jean-Baptiste Kempf4:12:37

Example, 3D audio, right?

Lex Fridman4:12:39

Yeah.

Jean-Baptiste Kempf4:12:39

Six or seven years ago it was everything about 3D. You go, you had the cardboard on Android. You, you had two, two audio formats. They're all dead, right? And now it's coming back with actual use cases, and we learn from the mistakes of the past standard.

So it will be the same everywhere.

Lex Fridman4:12:56

And not try to avoid closed. I, I, I saw somewhere you, you didn't have too many nice things to say about Dolby.

Jean-Baptiste Kempf4:13:04

No, I don't. Um-

Lex Fridman4:13:05

What is, uh... Can you educate, uh, me on why, where they went, what, what, what'd they do bad that made you mad?

Jean-Baptiste Kempf4:13:13

It's used to be an amazing company doing tons of great things with amazing engineers. They defined what sound was.

Lex Fridman4:13:22

Mm-hmm.

Jean-Baptiste Kempf4:13:23

And now it's mostly-

Kieran Kunhya4:13:25

Lawyers

Jean-Baptiste Kempf4:13:25

... li- lawyers and licensing things.

Lex Fridman4:13:27

Oh, so they're, yeah, it's, they're, they're closing stuff off. They're trying to make money on licensing.

Jean-Baptiste Kempf4:13:31

No, it's just like they, they don't innovate as much as they did-

Lex Fridman4:13:33

I see

Jean-Baptiste Kempf4:13:33

... and so on. It's a bit like, I'm sorry to say, right, like HP, right?

Kieran Kunhya4:13:39

Well, true.

Lex Fridman4:13:40

Oh, since we talked about Twitter a bunch, in a bunch of different contexts, do you have a, do you have a favorite, do you have a, and least favorite, most embarrassing tweet on either VideoLAN or FFmpeg Twitters?

Kieran Kunhya4:13:53

The two, my two favorites are, "Talk is cheap, send patches." I think that, that-

Lex Fridman4:13:57

Nice

Kieran Kunhya4:13:57

... embodies a lot of the stuff doesn't get, as, as we've talked about, stuff doesn't get built unless someone does it. It doesn't just appear from the ether. Uh, the other one that I like is, um, "FFmpeg, nothing is beyond our reach."

I think that comes from a US military satellite patch where I think they, they invented some kind of, um, monitoring system that could see the whole world, and this was released.

Jean-Baptiste Kempf4:14:19

Wasn't there something where FFmpeg was running on a rover on Mars also?

Kieran Kunhya4:14:22

Yeah, so FFmpeg is used by the Mars rover, uh, the Mars 2020 rover to compress, uh, pictures. Um, they really wanted, um... They wrote a paper about it, and they really wanted to use as much commercial off-the-shelf technology as possible.

Lex Fridman4:14:35

Oh, that's brilliant.

Kieran Kunhya4:14:35

FFmpeg runs on Mars, so we are, we are a multi-planetary open source library.

Lex Fridman4:14:40

Nice.

Jean-Baptiste Kempf4:14:42

Very often we've seen, um-

Lex Fridman4:14:44

Nice

Jean-Baptiste Kempf4:14:44

... uh, tweets for people using, um, VLC in weird places. Uh, a lot of the people doing Formula 1s are i- in all the paddocks, they use VLC to play the live feed. Uh, we've seen, uh, the European Space Agency.

We've seen SpaceX, like, monitoring the, the launches with, with VLC and, like, it's, like, fills you with joy, right? So-

Lex Fridman4:15:05

I've seen a particle accelerator.

Jean-Baptiste Kempf4:15:08

Oh, yeah, yeah. We had one of the m- most amazing thing that I went for was to go to the CERN at the LHC because they were using VLC to monitor all the captors on the ring, because the ring is 27 kilometers.

And so they had some analog cameras-

Lex Fridman4:15:27

Mm-hmm

Jean-Baptiste Kempf4:15:27

... and they were using some of the capture cards to go to analog to VLC, so VLC could stream on their multicast network for the whole CERN to access to that. Um, and, like, I visited that in 2010 with Laurent and, and, and, like, we fixed their issue in an hour or something like that, right?

Because it was some parameters, uh, maybe not well documented at that time. And he said, "Okay, for the whole day, what do you want to do?" And we visited everything, like- ... things where, with antimatter and, and, and- ...

and colliders and so on.

Lex Fridman4:16:00

Canzars.

Jean-Baptiste Kempf4:16:00

And that was, like, one of the most amazing day of my, my physic background.

Lex Fridman4:16:07

Yeah, it's used, like, everywhere. Uh, any, any tweets, uh, Kieran, you regret?

Kieran Kunhya4:16:13

Tweets I regret?

Lex Fridman4:16:15

Or is it like that, how's the French song go? Regret nothing.

Kieran Kunhya4:16:18

"Je ne regrette rien." Yeah.

Jean-Baptiste Kempf4:16:19

Yes.

Lex Fridman4:16:19

Yeah.

Jean-Baptiste Kempf4:16:19

Uh, that's very important for me, right? Don't regret anything. No, it's because regrets are a tax on your mind, right? So learn from your mistakes, but don't regret.

Lex Fridman4:16:31

Mm-hmm.

Jean-Baptiste Kempf4:16:31

Because you've done it, so except if you have a, a, a time machine to go back in time, don't regret, right? It's going to just tax your brain. Learn from your mistake, sure. Don't regret.

Lex Fridman4:16:44

It's like, it reminds me, it's beautiful. It's a tax on your brain. It reminds me of the Johnny Depp quote I saw where he was saying, "Hate, you know, I don't hate. That's, hate is a very expensive emotion."

Jean-Baptiste Kempf4:16:56

Are you comparing me to Johnny Depp? Uh-

Kieran Kunhya4:16:58

Because that would be a first one.

Outro4:17:00

Lex Fridman4:17:00

Well, gentlemen, uh, like I said, I'm eternally grateful for the, the software that, yeah, the two of you and the bigger community have been part of building with FFmpeg and VLC and everything else. I'm eternally grateful for the spicy tweets.

Never stop. And I'm grateful that you would, uh, talk with me today and give me this sexy hat. I feel like a wizard. I feel special. Um, and I feel special to get a chance to talk and celebrate the piece of software that brought me so much joy over the years.

So thank you for everything, and thank you for talking today.

Kieran Kunhya4:17:36

Thank you for having us.

Jean-Baptiste Kempf4:17:37

Thank you so much.

Lex Fridman4:17:39

Thanks for listening to this conversation with Jean-Baptiste Kempf and Kieran Kunhya. To support this podcast, please check out our sponsors in the description where you can also find links to contact me, ask questions, give feedback, and so on.

And now let me leave you with some words from the legendary Linus Torvalds. "Most good programmers do programming not because they expect to get paid or get adulation by the public, but because it is fun to program." Thank you for listening, and I hope to see you next time.