In short
Topic An episode about FFmpeg and VLC as the “invisible backbone” of internet video/audio: how video playback works end-to-end (URLs/streams → containers → demux → codec decode → GPU/software paths → pixels/sound), why codecs are so complex and human-perception-driven, and how open-source communities and licensing shape these projects.
Guests (backgrounds)
Jean-Baptiste Kempf
president of VideoLAN; key figure behind VLC and FFmpeg.
Kieran Kunhya
longtime codec engineer; FFmpeg contributor; runs the “FFmpeg” meme account on X (Twitter).
Key claims / notable points FFmpeg is described as underlying most video processing workflows (claimed “over 90%” of video processing workflows online and offline) and is used across platforms like YouTube, Netflix, Chrome/Firefox, VLC, Discord, and more. VLC is an open-source media player downloaded 6+ billion times; it’s known for playing “basically anything,” with no ads/tracking.
A core design philosophy
don’t trust inputs. VLC/FFmpeg probe real contents rather than relying on file extensions (e.g., “.mp4” may not actually contain what you expect).
Video compression is extremely asymmetric
compression is far more compute-heavy than decompression, and video is compressed roughly 100–200x (audio ~10x for MP3, per the discussion). Modern codecs use human-perception models (e.g., YUV vs RGB; chroma subsampling) and transform-domain math (frequency domain, block-based processing).
Notable examples mentioned
VLC “opens everything” scenarios
recording VHS via capture cards (including modules for controlling certain VCR/camcorders), DVD audio support work, and “weird file” competitions (e.g., an MKV with per-frame changing resolution/aspect ratio/rotation; animated subtitles; a file that is simultaneously a valid ZIP and valid MP3). A “pancake in the DVD drive” attempt that failed (plus a physical “VLC cone + RFID chip” idea that played a Star Wars clip).
Playback pipeline stages
URL/stream → demux/container parsing → codec probing and GPU vs software decode fallback → entropy decoding → prediction/residual handling → inverse transforms → render to screen/audio output.
Open-source licensing
discussion of GPL vs LGPL (Kempf’s move of libVLC core from GPL to LGPL to enable commercial embedding, e.g., in game engines/third-party apps without forcing full source disclosure).
Written by AI. May contain mistakes. Listen to the episode to check what was said.
Chapters
Tap a time to open that second in VOThe Power of FFMPEG and VLC
0:09 to 1:26
Learn about the significance of FFMPEG and VLC in the digital media landscape.
“It can decode, encode, transcode, stream, and play almost any video or audio format ever created.”
The Spirit of Open Source Engineering
1:26 to 2:41
Explore the collaborative nature of open source projects and their impact on society.
“And about the two great engineers and human beings I'm talking to in this episode, Jean-Baptiste is the president of VideoLan and is a key figure behind VLC and FFmpeg.”
Introducing the Guests
10:16 to 10:48
Meet Jean-Baptiste Kempf and Kieran Kunhya, experts in media technology.
“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.”
The Versatility of VLC
10:48 to 14:02
Discover the unexpected uses of VLC, including its ability to handle unusual formats.
“So yeah, we'd made a competition of stupid files.”
VLC's Archival Future
14:02 to 14:59
Explore the archival mission of VLC and its significance for future generations.
“Yeah, and we'll talk about, you know, the mission of FFMPEG being a kind of, the archival aspect of it.”
The Ecosystem of Video Technology
15:00 to 19:03
Understand the ecosystem involving video codecs, encoding, and streaming technologies.
“And when he put that, it was playing like The Last Star Wars and so on.”
Video Decoding Stages Explained
19:04 to 23:04
Learn about the critical stages of video decoding from stream to display.
“This is stored in the frequency domain and these are quantized to decompound their space.”
Containers vs. Codecs
23:05 to 26:07
Differentiate between containers and codecs in video files and their implications.
“And then we should mention that a lot of this programming is done at the lowest possible stack, whether it's C, and of course, as the legendary Twitter handle, re-emphasizes over and over a lot of assembly.”
The Philosophy Behind VLC's Flexibility
26:08 to 28:00
Discover how VLC handles various file formats and codecs without breaking.
“There is the Part 2, so there is like audio codecs, right?”
Understanding VLC's Resilience
28:00 to 29:52
Learn how VLC handles broken video files and its design philosophy.
“I will start first by opening, probing it with the mp4 container demuxer to see, well, it should be that.”
Show all 99 chapters
The Mechanics of Video Codecs
29:52 to 33:52
Explore the function and importance of video codecs in compression.
“We hinted at the awesomeness of the various different stages.”
FFmpeg's Role in Video Processing
33:52 to 38:12
Discover the significance of FFmpeg in video compression and processing.
“Are you going to compress more, but then it might be more difficult to decode?”
Democratizing Video Technology
38:12 to 40:56
Understand how FFmpeg and VLC have made video technology accessible to all.
“Just trivial stuff like take a video, add an intro video and an outro video, and fade one into the other.”
The Open Source Movement
40:56 to 42:00
Gain insights into the open-source nature and community behind FFmpeg.
“a lot of people and we just to clarify we say you you wouldn't be here not the human but the podcast The podcast, sorry.”
Understanding Open Source Through Analogy
42:00 to 43:20
Learn about the concept of open source using a chocolate cheesecake analogy.
“in a bunch of different ways about the community behind it.”
The Community of FFmpeg: Contributions and Collaboration
43:20 to 45:30
Discover the collaborative nature of FFmpeg and its contributor community.
“Since the beginning of FFmpeg, probably 2 ,000 to 3 ,000 people have contributed from the beginning, right?”
Licensing in Open Source: A Social Contract
45:30 to 47:20
Understand the significance of licensing in open source software as a social contract.
“We have seen, for example, all the web browsers, right?”
Exploring Open Source Licenses
47:20 to 49:50
Gain insights into different types of open source licenses and their implications.
“And so you have like the first one, which are basically very permissive, MIT, BSD.”
The Transition from GPL to LGPL
49:50 to 51:50
Learn about the challenges and reasons for transitioning from GPL to LGPL in projects.
“And so you can use FFmpeg as LGPL into like any type of application, even non-open source, but you need to give back the modification you did on FFmpeg, same on libvlt.”
Community Dynamics and Copyright in Open Source
51:50 to 54:20
Explore the complex dynamics of community contributions and copyright in open source.
“the terms of condition of the 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.”
The Importance of Code Quality in Open Source
54:20 to 56:00
Understand the meritocratic nature of code contributions and the importance of quality.
“So it's important to do it right and to do it correctly.”
The Legend of Linus Torvalds and Code Quality
56:00 to 58:28
Learn about Linus Torvalds' impact on Linux and the importance of code quality.
“Oh, yeah, but I'm an engineer at this very large company in Italy, in Germany, in the U.S.”
Culture and Communication in Open Source Communities
58:28 to 1:00:54
Discover the unique communication styles and cultural nuances in open source communities.
“But we should also mention that there is some spiciness, some harshness to the language that's sometimes used when you're keeping this high bar of excellence.”
The Moral Dilemma of Keeping VLC Free
1:00:54 to 1:03:12
Understand the reasoning behind rejecting monetary offers to maintain VLC's integrity.
“So as the legend goes, JB, you repeatedly turned down millions of dollars to keep VLC open source free for everyone without ads.”
The Evolution of VLC and VideoLan
1:03:12 to 1:10:04
Explore the history and development of VLC media player from the VideoLan project.
“And they moved it, they wanted to move it to the central of France in a place called Clermont-Ferrand.”
The Journey of VLC and Ethical Choices
1:10:04 to 1:13:47
Learn about the development of VLC, the ethical decisions made in open source, and the importance of integrity.
“Yes, it's true that I spent more time than anyone on VLC and Videoland, that is sure.”
The Role of Security in Open Source Development
1:13:48 to 1:16:34
Explore the recent challenges in open source security and the impact of AI on vulnerability reporting.
“And it was the reason that VLC became as successful as it was.”
Corporate Misunderstandings of Open Source Projects
1:16:35 to 1:23:30
Discuss how large corporations perceive and interact with volunteer-driven open source projects, highlighting recent issues.
“and they even went to the media first announcing how good their AI was before the issues could be fixed.”
Understanding Perceptions of FFmpeg in Corporations
1:24:05 to 1:25:32
Exploration of how FFmpeg is perceived within large corporations like Microsoft.
“So I think what happens in these companies, maybe you can correct me, is you're right.”
The Impact of Social Media on Open Source Projects
1:25:33 to 1:26:42
Discussion on how social media influences engagement and funding for projects like VLC.
“and some of the debacle produce results, positive results.”
Celebrating the Contributions of Young Developers
1:26:43 to 1:29:06
Highlighting the significant role of young contributors in the FFmpeg community.
“We had the same issue with Microsoft or like saying that we were going to stop distributing VLC on the Windows Store.”
The Value of Open Source Programming
1:29:07 to 1:31:35
Explaining the educational benefits of contributing to open source projects like FFmpeg.
“The files are exactly the same, but wow, the airplane has been rebuilt whilst it's in the air.”
Motivations Behind Open Source Contributions
1:31:36 to 1:34:32
Exploring what drives individuals to contribute to open source projects, especially in multimedia.
The Importance of Understanding Computer Architecture
1:34:33 to 1:36:32
Discussing the need for knowledge of computer architecture in multimedia programming.
“Like you said, they're sitting in the basement.”
Pride in Contributing to Meaningful Projects
1:36:33 to 1:38:00
The fulfillment derived from working on impactful open source projects like VLC and FFmpeg.
“where you can basically slow down and wait a frame.”
The Impact of Open Source Multimedia
1:38:00 to 1:38:59
Learn how contributing to open source projects can give a sense of pride and impact.
“You're not going to tell that to your grandma.”
The Power of Individual Contributions
1:39:00 to 1:40:57
Discover how single individuals can create groundbreaking software that changes the world.
“You know, everything out there is a passion project and open source multimedia and open source in general, you can just do that so much faster.”
VLC and FFmpeg: A Binary Star System
1:40:58 to 1:45:41
Explore the relationship between VLC and FFmpeg and how they support each other.
“Let's actually zoom out before we zoom back in.”
Key Figures and Their Contributions to FFmpeg
1:45:42 to 1:48:04
Learn about the important figures in FFmpeg's history and their contributions.
“Can we give a shout out to some of the people along the way?”
Reverse Engineering and the Art of Codec Development
1:48:05 to 1:51:41
Understand the complexities of reverse engineering codecs and the challenges faced by developers.
“And it was really, the number of edge cases are beyond comprehension in terms of, you could have a Chinese CCTV system that did one weird variant of MPEG-4 part two, what's known as MPEG-4 ASP.”
Reverse Engineering Video Codecs
1:52:01 to 1:54:34
Explore the complexities and techniques involved in reverse engineering video codecs.
The Archaeology of Code
1:54:35 to 1:56:56
Learn how reverse engineers use intuition and samples to decode complex systems.
“But like, now let's fast forward 10 years, 15 years.”
Challenges of Bit Exactness
1:56:57 to 2:00:08
Understand the significance of bit exactness in video codec implementations.
“Imagine two orders of magnitude of more complexity.”
FFmpeg's Testing Environment
2:00:09 to 2:03:24
Delve into the FFmpeg Automated Testing Environment and its importance.
“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.”
Broadcasting Challenges with Video Data
2:03:25 to 2:06:00
Discuss the challenges faced when handling 10-bit video data in broadcasting.
“Of all the different codecs, all the different filter transformations, all the level of scale is quite crazy.”
The Challenges of Supporting Multiple OSes
2:06:00 to 2:08:15
Learn about the complexities of maintaining software compatibility across various operating systems with a small team.
“For me, some of the headaches we have is around some OS that are difficult to support, right?”
The Beauty and Complexity of Assembly Language
2:08:15 to 2:11:56
Discover the intricacies of assembly language and its advantages over high-level programming languages in performance.
“And they have infinite amount of power and resources.”
The David Project: An Assembly Language Decoder
2:11:56 to 2:15:05
Explore the details of the David project, a decoder that uses extensive handwritten assembly to achieve high performance.
“that we need to talk about is called David, right?”
Innovative Optimization Techniques in Video Processing
2:15:05 to 2:20:00
Understand the innovative approaches taken in FFmpeg and the David project to enhance video processing efficiency.
“So we should actually just articulate a little clearer.”
The Value of Low-Level Programming
2:20:00 to 2:23:51
Learn about the significance of understanding low-level programming for efficiency.
“because that can lead to loading and saving registry on the L1 and L2 CPU and gets us faster.”
Learning Assembly Language
2:24:04 to 2:27:38
Discover effective methods for learning assembly language and its importance.
“There's this nice repo with the assembly lessons.”
The Role of Rust in Programming
2:27:39 to 2:32:28
Explore the advantages and limitations of Rust in modern programming.
“So you had to do crazy things to pack things in memory, reuse the registered, and those type of semantics, no language could do that, right?”
Understanding Code Complexity
2:32:29 to 2:34:00
Discuss the challenges of reading and understanding complex codebases.
“here's my utopia of memory safety isn't enough even though we probably all agree that that's the goal?”
Understanding Code Complexity and Security
2:34:00 to 2:36:40
Learn about the challenges of understanding legacy code and the importance of secure coding practices.
“That's the initial instinct for a lot of people when they show up to a code base, probably before LLMs, is like, probably because they don't understand the wisdom of the way things have been done in the past.”
The Importance of Assembly Programming
2:36:40 to 2:39:06
Explore the significance of assembly language in performance optimization and the expertise of assembly programmers.
“The two of them are actually working, living in North of Europe, Sweden and Finland.”
Forks and Drama in Open Source
2:39:06 to 2:41:42
Discover the dynamics of forks in open source projects and how they can lead to improvement.
“And this is normal, and this has happened all the time, right?”
The Aftermath of the FFmpeg and LibAV Split
2:41:42 to 2:43:57
Understand the implications of the FFmpeg and LibAV split and how it shaped the community.
“FFMPEG effectively absorbed LibAV's work while LibAV withered most distributions and developers moved back to FFMPEG.”
Burnout and the Human Element in Open Source
2:43:57 to 2:47:33
Learn about the challenges and mental health concerns faced by open source maintainers.
“And in the end, FFmpeg is stronger than it was before, right?”
The Hidden Struggles of Open Source Projects
2:47:33 to 2:48:00
Gain insight into the pressures faced by open source maintainers and the importance of support.
“you have a community of 10, 15 core developers, are not the worst open source project.”
The Struggles of Open Source Maintainers
2:48:00 to 2:53:29
Learn about the challenges faced by open source project maintainers and the importance of celebrating their contributions.
“researchers because there's one other crazy edge case that they haven't thought of.”
Death Threats and Community Feedback
2:53:29 to 3:00:45
Explore a personal experience with threats in the open source community and the importance of positive feedback.
“I mean, even outside of open source, just celebrate companies that create software that you use a lot and love.”
The Evolution of X264 and Video Encoding
3:00:45 to 3:02:00
Discover the history and significance of X264 in video encoding and its impact on internet video.
“And the more it goes, the more there are birds.”
The Impact of Open Source in Video Quality
3:02:00 to 3:03:30
Learn how open source projects like x264 influence video quality and consumer preferences.
“So X264 is like amazing project with people who were really all over the world.”
Anime, Subtitling, and the Open Source Community
3:03:30 to 3:05:15
Discover the role of the open source community in anime subtitling and distribution.
“So what happens is usually people who love anime, who take some DVDs in Japan and rip them, because there is no commercial offering.”
Understanding Video Codecs: H.264 vs AV1
3:05:15 to 3:07:02
Explore the differences between H.264 and AV1 codecs and their impact on streaming.
“So this is an important part of the culture, but also because there was no official offering.”
The Complexity of Video Encoding Technologies
3:07:02 to 3:09:04
Learn about the intricacies of video encoding technologies and their efficiency.
“It's more coding tools, more bigger blocks, lots more subpartitions in each block.”
Decoding Frames in Video Compression
3:09:04 to 3:11:46
Understand the differences between I-frames, P-frames, and B-frames in video.
“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.”
FFmpeg and Video Playback Magic
3:11:46 to 3:13:37
Discover how FFmpeg enables smooth video playback through complex encoding.
“can use FFMPEG to compress something and not notice that the result still plays back smoothly it's like magic.”
Video Compression: Parameters and Optimization
3:13:37 to 3:15:39
Learn about the parameters and optimization techniques used in video compression.
“to some of them so first of all like obviously we can lower the resolution we can lower the frame rate.”
The Legacy of VLC and YouTube's Encoding Challenges
3:15:39 to 3:16:04
Explore the history of VLC and the challenges YouTube faces in video encoding.
CIA's Use of VLC: A Cautionary Tale
3:16:04 to 3:18:23
Learn about the surprising use of VLC by the CIA and its implications for open-source software security.
“the opposite where we have VLC WebAssembly where we compile all VLC NFFMPEG to decode to run VLC inside the JavaScript virtual machine with WebAssembly.”
The Risks of Downloading Software
3:18:23 to 3:20:41
Understand the dangers of downloading fake software versions and how they can compromise security.
“until I had to fight in courts in India, the Indian government to unban VLC.”
Sandboxing VLC for Enhanced Security
3:20:41 to 3:24:19
Explore the complexities of creating a secure sandbox environment for VLC to prevent potential security breaches.
“One of them is FFmpeg, but we support so many other formats.”
Fun and Unique Features of VLC
3:24:19 to 3:26:53
Discover the quirky and lesser-known features of VLC and their surprising uses.
“You mentioned something somewhere where like 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.”
Challenges of Streaming vs Downloading
3:26:53 to 3:30:00
Learn about the technical challenges involved in streaming video content versus downloading it.
“and talk a little bit more about the distinction between kind of downloading a file and watching it offline versus streaming.”
Audio and Video Quality Perception
3:30:00 to 3:31:40
Discover how audio and video quality impacts viewer experience and tolerance levels.
Understanding Latency in Real-Time Video Streaming
3:31:40 to 3:34:20
Learn about the importance of low latency in applications requiring real-time feedback.
“I think the networking part, while you agree to have 10, 20 seconds of latency, I don't think this is very difficult.”
Kyber: Remote Control and Robotics
3:34:20 to 3:37:20
Explore how Kyber technology enables ultra-low latency control of remote machines.
“So this comes up quite a lot in a lot of different contexts in robotics.”
Achieving Glass-to-Glass Latency
3:37:20 to 3:41:00
Understand the goals and challenges of achieving glass-to-glass latency in video transmission.
“Because you're not going to run anything over there, right?”
Open Source Solutions and Future Innovations
3:41:00 to 3:44:00
Learn about the dual licensing of Kyber and the future of robotics and multimedia technologies.
“You can achieve that with custom hardware, with SDI, with professional hardware.”
The Future of Robots and Multimedia
3:44:01 to 3:45:19
A discussion about the importance of robots and the future of multimedia technologies.
“Of course, they are not going to be very good robots, right?”
Understanding AV1 and AV2 Codecs
3:45:19 to 3:47:44
Insights into the AV1 and AV2 codecs, their specifications, and improvements.
“That I call DEVID because DE is 2 in French.”
The Politics of Codec Patents
3:47:44 to 3:50:21
Exploring the complexities of codec patents and their implications for technology.
“So it's the concatenation of the ISO name and the ITU name.”
Challenges in Codec Development
3:50:21 to 3:54:19
Discussion on the challenges and creativity involved in codec development amidst patent constraints.
“So usually, so MPEG does a format, right?”
Entrepreneurship in Europe
3:54:19 to 3:57:26
A look at the state of entrepreneurship in Europe and the evolving landscape.
“It's notable that there's two people from the European continent on this podcast talking about video.”
Legal Challenges for VLC and Developers
3:57:26 to 3:58:05
Discussion on the legal challenges faced by VLC and developers regarding content regulation.
“You have to realize that one of the good things, for example, in France or most of Europe is that the...”
VLC's Stance on Government Backdoors
3:58:05 to 4:00:26
Learn about VLC's uncompromising stance on user privacy and software integrity.
“I mean, similar with Pavel, the intelligence agencies tried to like say, can you put a backdoor on VLC?”
Support Requests from Authorities
4:00:27 to 4:02:12
Discover how VLC interacts with law enforcement and the challenges they face.
“No, no, because the only infrastructure we have is a downloading infrastructure.”
The Importance of VLC in Military Morale
4:02:12 to 4:04:51
Hear stories of how VLC has been used to support troops in challenging situations.
“So first of all, millions of people using it.”
Archiving and Preservation Community
4:04:51 to 4:07:18
Understand the role of the archiving community in preserving multimedia history.
“Yes, it's one of the coolest communities in open source multimedia, mainly led by someone called Dave Rice.”
Challenges in Multimedia Archiving
4:07:18 to 4:10:05
Explore the complexities and moral dilemmas in the preservation of historical media.
“They can explain, ah, in the 1950s, colorimetry was done like this on this certain type of tape.”
The Future of VLC and FFmpeg
4:10:05 to 4:12:00
Discuss potential future developments for VLC and FFmpeg in multimedia technology.
“They can prove mathematically that it's lossless.”
Innovations in Multimedia Codecs
4:12:00 to 4:14:00
Discover the latest advancements in codecs for multimedia applications.
“that's one and virtual reality of course you will have vlc for neural link and you'll have ffmpeg dash I input format human brain.”
The Future of Multimedia Frameworks
4:14:00 to 4:16:00
Learn about the evolving definitions of multimedia and its future capabilities.
“Your D-Muxer has a new track type that is basically others, right?”
Contributions and Community Efforts
4:16:00 to 4:18:00
Understand the dynamics of contributions to VLC and FFmpeg by the community.
“module, the new format, and so on, we care about the architecture of VLC, the architecture of FFmpeg, right?”
Standards in Multimedia Technology
4:18:00 to 4:20:00
Explore the need for standards in multimedia technologies and their evolution.
“Can you educate me on why, where they went, what they do bad that made you mad?”
FFmpeg on Mars
4:20:00 to 4:20:40
FFmpeg is utilized by the Mars 2020 rover for image compression.
“And so they had some analog cameras and they were using some of the capture cards to go to analog to VLC.”
Using VLC in Unusual Places
4:20:40 to 4:22:40
Hear about interesting applications of VLC in various scientific endeavors.
“So VLC could stream on their multicast network for the whole CERN to access to that.”
The Importance of Learning from Mistakes
4:22:40 to 4:23:20
Reflect on the value of learning from experiences without regret.
“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.”
Transcript
Automatic transcript. May contain errors.0:00Lex Fridman: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.
0:50Lex Fridman:any format, any platform, no ads, no tracking. It has been downloaded over 6 billion times. And again, for me, it had 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 talking to in this episode, Jean-Baptiste is the president of VideoLan and is a key figure behind VLC and FFmpeg.
1:40Lex Fridman: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.
2:25Lex Fridman: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. And now a quick she second mention of a sponsor. Check them out in the description or at lexfriedman.com slash sponsors. It is, in fact, the best way to support this podcast.
3:10Lex Fridman:We've got Lairdyn for understanding how AI is used in your business, Blitzy for cogeneration and large code bases, BetterHelp for mental health, Fin for customer service AI agents, Element for electrolytes, and Bookplexity for curiosity-driven knowledge exploration. Choose wisely, my friends. And now, on to the full batteries. I try to make them interesting, but if you skip, please still check out the sponsors. I enjoy their stuff. Maybe you will too. To get in touch with me for whatever reason, go to lexfriedman.com slash contact. All right, let's go. This episode is brought to you by Lairdyn, a platform that helps organizations understand how AI is being used across their business and what it's doing for productivity and performance.
3:56Lex Fridman:There really is a transformation happening at the individual developer level. Many people switch from writing, let's say, 50%, 40%, 30 % of their code where the rest is written by AI. They switch to basically where it's 0 % of code written by hand via so-called agentic engineering. And so we can see that in the individual developers. Now, the question is when you scale that to 2, 3, 4, 5, 100 developers, what does that look like? What does that look like from the perspective of a company that's trying to actually ship products and trying to coordinate teams so they can build and collaborate together?
4:38Lex Fridman:How is AI being used to increase the productivity of the individual contributors and team scene as a whole? That's what Laird and does. If AI is part of your organization, now is the moment to get control of it. Head to Laird and.com to book a demo and to start maximizing impact from AI. This episode is also brought to you by Blitzy, an AI-powered autonomous software development platform built for large, complex code bases. Huge number of cooperative agents, really optimized for huge code bases. Optimized for scaling speed when you're talking about a very large number of agents working together.
5:20Lex Fridman:And that's the big interesting question. when you have a huge number of agents, a huge company, a huge code base, how do you then, seen at the big picture code base level, have the growth and development, the evolution of that code base where a very large percentage of that code base is continuously worked on autonomously? The question is when you have a large code base that already delivers value, that already sells stuff that already has a huge number of customers, How do you then use agentic engineering to continue adding features, continue improving, continue in the usual kind of development with the testing, with the security, all that kind of stuff?
6:03Lex Fridman:How do you do that without messing stuff up, without filling up your code base with AI slop and nevertheless doing it so, for the most part, autonomously? Not fully autonomously, semi-autonomously, but majority of the code is written autonomously. That's what Blitzy specializes in, the future of autonomous software development is here. Learn more or speak to a member of their team at blitzy.com slash lex. That's blitzy.com slash lex. This episode is also brought to you by BetterHelp, spelled H-E-L-P, help. Moving away from AI to the human. The human mind is still, to this day out of reach of our understanding from the perspective of creating intelligence.
6:53Lex Fridman:There are so many intricate psychological complexities to the mind, which I think attributes to what makes humans incredibly special. But those complexities get all tangled up in ways that are counterproductive, and so they need to be untangled. I'm a big fan of talk therapy as a set of tools, as a methodology for untangling the complexities of the human mind. The easy, discreet, affordable way of doing that is BetterHelp. That's why I keep recommending it. It's a really good way to take your first steps if you haven't done talk therapy. Get a licensed professional therapist under 48 hours. BetterHelp makes it super easy.
7:33Lex Fridman:Check them out at betterhelp.com slash lex and save in your first month. That's betterhelp.com slash lex. This episode is also brought to you by Finn, the number one AI agent for customer service. As I mentioned already about humans, humans are complicated. And customer service is ultimately about looking at each individual human and really listening. So I try to do with a podcast to truly listen to each individual person, whether we're talking about a super technical topic or we're talking about the big questions of the human condition. And sometimes when you're talking about the details of the technical topic, underneath there, you can feel the presence of the big picture questions of the human condition.
8:21Lex Fridman:All of those complexities peek out of the shallow surface interactions that at first class you might think customer service interaction is, but really we're trying to solve the big problems of the human condition and specific to that individual person. So customer service is a really hard problem, but it's a really important one. And that's what Finn specializes in, how to leverage, how to use, how to utilize AI in the task of customer service. Go to fin.ai.lex to learn more about transforming your customer service and scaling your support team. That's fin.ai.lex. This episode is also brought to you by Element, my daily zero sugar and delicious electrolyte mix.
9:09Lex Fridman:I'm traveling to parts of the world that at first feel, at first experience, are so foreign that they border on the uncomfortable. All new things can be uncomfortable. And for me, Element on the health side, psychological side, our source of comfort, the reminder of home. It's the place where I'm healthiest. It's the place where I have everything sort of in line. I'm exercising, running every day, whether that's jiu-jitsu or running or lifting. I am on a good diet. I'm fasting a lot. And for all of that, you need the electrolytes that Element provides sodium, potassium, magnesium. Really, if you get the electrolytes right, everything else is a little bit easier.
9:54Lex Fridman:You don't get the headaches. You don't get just the weird, iffy feeling when you're fasting. Favorite flavor, as always, I should mention, because I love it so much, is watermelon salt. Get a free A-Comp sample pack with any purchase. Try it at drinkelement.com slash Lex. This is the Lex 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 Kunye.
10:48Lex Fridman:so the legend goes vlc can open everything what's the weirdest thing that you know that it can open 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 well how does that work basically it's you know those type of capture card where you can put a peritel in 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 spend 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 what about Lucasfilm oh yeah and there is of course all the weird codecs support game codecs supported by by FFmpeg the one Star Wars video game the first 10 second opening sequence someone has gone and implemented that and make sure that's bit exact on one disc that existed at one time of one little sequence in the game and then finally there was a at one video line conference we made a competition to make the weirdest and most horrible file ever and see if vlc could play it what it ended up being was the file it was an mkv file made by direct which each of the frame was changing resolution aspect ratio rotation and it was like did it work yes and there was another one where the whole video was actually animated subtitles right ssa right so yeah this one was so each each frame was a black frame but on top of that there was a subtitle that was animated for each frame there was a file that's a valid zip and a valid MP3 at the same time or something like that.
12:33Lex Fridman:So yeah, we'd made a competition of stupid files. And it worked. It opened all of the stupid files. By the way, 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? Yeah, by far, right? The logo of VLC is so iconic, right? Like we are a team with a small number of people and the icon is known everywhere. I go to middle of nowhere in India or in China, people know the cone, right? And 25 % of the website traffic that comes to our main website is cone player, right? So many people don't know VLC, right? They know the cone player.
13:12That's the thing that Google for is cone player. Yeah, they go on Google and they put cone player and they download VLC, right? So that's iconic. And once we tried to change it as a joke, right? We said it was going to be a type of caterpillar construction and we said that during april 1st 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 the tv right and that's a youtube youtube logo right it's an original this one is orange right it's very bright uh and and it's weird.
13:50Lex Fridman:And it's ridiculous, and it's absurd, and it's hilarious. It becomes meme, and meme becomes culture. 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 play-o. Yeah, and we'll talk about, you know, the mission of FFMPEG being a kind of, the archival aspect of it. So you can think about a thousand years from now, we'll have all these videos that only VLC can open. Human civilization has already destroyed itself multiple times, and the only thing that will remain is this like, you know, the cockroaches will be crawling around and it'll be the VLC logo with some of the archival footage the VLC can open.
14:27Lex Fridman:And the aliens will show up and they'll press play and they'll get to see all of this. Well, we 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. Can they? No, we tried. It doesn't. But we actually have a video of us trying that. Didn't work. A codec for physical reality? I don't know what that would even look like. There was a guy who did that, right? He printed a small cone, right? Like the ones we distribute as goodies. And inside he put an RFID chip, which was his way of playing a movie, right?
14:59And so he put this on the 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. And that was like physical objects.
15:11Lex Fridman: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 in my head the entire ecosystem enabling free media we'll talk about ffmpeg we'll talk about video land 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, your lead developer behind the legendary FFmpeg handle on Twitter. And both of you have spicy opinions, I would say. So today we want to talk about FFmpeg and VLC.
15:58Lex Fridman: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, because it's impossible to really count the number 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 so to help people understand what's involved in all of this so when we press play on a video player like VLC?
17:03Lex Fridman:What happens? How does it go from 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? So there are several stages, right? The first stage is to get from an address, right, which is the type of URL to give you a byte of streams, right? So this would be, for example, HTTP, file dvd right you give the pass to the media and give you a stream of data the stream needs to be cut up by what's known as the container the demultiplexer or demux 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 mainly to figure out whether that codec is GPU decodable or needs to fall back to software.
18:00We'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 45 % 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 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 to first do de-entropy coding. So removing the mathematical coding of the bitstream.
18:35So this uses capabilities such as Huffman coding or arithmetic coding to actually decompress the mathematical layer of the bitstream. 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. So this works and operates in the spatial domain. So you do your interprediction spatial domain, you have a residual because your prediction isn't quite matching that to 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 decompound their space.
19:11We then need to do the inverse transform to bring them back to the spatial domain and apply these for digitals.
19:18Lex Fridman:So a lot of the process of decoding is this thing is compressed. Yes. Yes. And you have to predict the highest quality thing that's supposed to go there. Iframe is the best representation you have spatially. Yes. 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. Yeah, because what people don't realize is that the compression on video and audio is 100 times, right? Like people don't realize how compressed we do, right? For audio, you move, you compress by, when you go from normal audio to MP3, you compress by 10 times, right?
20:00When you move to video, you need 100 times, 200 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? So all the codecs, either for audio, mimic basically how your ear works, right? And a lot of things about like the response on the ear and same for your eyes, right? And so, for example, on video, we don't work on RGB, right? Everyone expects to work in RGB. We don't, right? We move to YUV, which is basically one is luminance, brightness, and the other are colors.
20:39And 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 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 very complex technologies we move to the frequency domain as kieran said we do a ton of dequantizing and in order to get the best compression but it still looks good you're Trying to compress in order to maximize the highest quality thing for human perception.
21:17That 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 zip compression to arrive with 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. And we can do that, but it involves, first, a lot of theoretical knowledge about how it works, how it works, but a lot of mathematical change, a lot of mathematical tricks, right? For example, when you move to RGB and you go to YUV, for example, what we do very often is that we scale down the resolution of the color compared to the brightness.
22:00And most of the time, and just this without compression, it divides the size by two. but most people don't see it, right? And so on and so on, right? And then you go to very complex mathematical change. So of course, Fourier transform which de facto are not Fourier transform. They are like discrete continuous transform but that's the same idea. So frequency domain, 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 and so on to arrive to compression states that are insanely high, right? And each generation of the codec is like 30 % less for the same quality, right?
22:43And this requires amount of power, of computational power that are huge. No, you should elaborate. It's 30 % better, but an order of magnitude, perhaps even two orders of magnitude, more compression power. That's the big difference.
22:58Lex Fridman:What do you mean by compression power? Sorry, CPU power to achieve that level of compression. Oh, yeah. So 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 is done at the lowest possible stack, whether it's C, and of course, as the legendary Twitter handle, re-emphasizes over and over a lot of assembly. So what happens globally is that you have an address, right, which gives you, with the operating system, a stream of bytes, a stream of data, right? And this is the first step. And the second step arises with demuxing, where you're going to separate audio, video, subtitle in type of different tracks.
23:37And 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. and once you've decompressed those type of things you have raw images raw and then you're going to talk with your 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 in analog to to your audio speakers and 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 You know, every sentence has thousands of people working on this in industry as a whole, books written about it.
24:23So there's a lot of detail. There's a lot of subtleties. There's a lot of both academic and practical realities, both of which matter.
24:33Lex Fridman:We mentioned Kodaks, but I don't think you mentioned containers. So what's the actual containers for some of the stuff we're talking about? So people are familiar with MP4, MOV, MKV. So anyway, what are containers versus the thing that goes inside? So the container is what we call also the muxer, right? When I say demuxing, it means decontainizing, right? So actually, if you look, mux means multiplexer and demux multiplexer, right? Mux and demux are those. And same, Kodak is actually coder, decoder, right? Right. And so containers are this collection of multiple tracks. Right. So it's what normal people call the file format, but it's a bit more subtle than that.
25:23But the most known one, of course, is MP4. But when I started, it was AVI. Right. AVI was the video format from Microsoft and MOV, MOV, which became MP4, was a format from Apple. In the open source community, one of the persons that is still active on Videoland is called Steve Lomb and started this Matroska format, which is like a bit more complex and more feature proof. And there are so many others.
25:51Lex Fridman:So, I mean, it's a pretty common thing, and maybe it'll even happen in this conversation, that people confuse container and the codec, right? So confuse MP4 and HG64, for example. Is that a horrible violation? 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, so there is like audio codecs, right? AAC, the factor is MP4 audio, something. There is 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, right?
26:36So it's completely the fault of the industry 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.
26:51Lex Fridman:So you can technically shove in all kinds of different codecs inside containers and horrible so. But broadly speaking, though, MP4 is understood to generally be H.264 plus AAC audio. 99 % of the time, that's that. And the rest are de minimis, the small effects, edge effects really compared to that. So it's not the end of the world. 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.
Read the full transcript
27:30And this is very important to say, right? Like, for example, in VLC and FFmpeg, we discard the file format, right? We look into the file to understand what's in it. Because so many people, like, they say, oh, it's a video, it 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 the format. So what information does the fact that it's.mp4 give you? It helps, right? It gives you a hint, right? Just like, oh, 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.
28:12But I don't trust it. And if I'm lost, I say, OK, maybe I'm going to try it. So it bumps the priority of the module.
28:19Lex Fridman:So how do you get to, 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, most players just break there. Yes. Yes. So how do you not break? There's just a philosophically, I'm sure there's a bunch of stumbling blocks along the way where it's easy to just break and stop, freak out. that's it how does vlc not this is why vlc is popular um but the reason is because actually vlc was is just a client of a streaming solution called video land 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.
29:12So everything in VLC is prepared to work with broken files. And it's a philosophical idea from the beginning, and everything is engineered into that. 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 pirating content, which they do a lot less today. And none of us ever have. No, of course not. But the metadata to play some files like a VI is 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.
29:54Lex Fridman: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. Let's try to define what is a video codec. What's involved there? What does it mean to compress something? You already started to hint at it, but can we elaborate a little bit more? So there's a huge amount of redundancy in any video, 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, versus the decompression.
30:38So it's asymmetric in that respect, often the case because compression is done once, but there could be lots of viewers of another file. 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 JB suggested, VLC in the beginning 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. 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.
31:19And to give a more image to people who are not familiar, right? When you're going to see any type of movie, right? You're going to see the camera is going to pan, right? And travel. And you realize that, for example, all the background is the same for like a minute, right? or 30 seconds, right? So you can reuse the cloud that you see on the background. You can reuse that from a frame to another, right? And so it gets 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. So just to make it even more explicit,
32:00Lex Fridman:so what is video? Video is a bunch of pixels off an RGB. You have three values and you have a grid of pixels and you have, let's say, 24 or 30 or 60 frames a second. And you just have all these pixels repeating and showing different stuff 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? Or 1 ,000x, right? 1 ,000x. The target is 1 ,000x, right? And the goal is, when you say redundancy, what is redundant meaning stuff at best that humans wouldn't notice if it was missing. So, for example, you have a picture of a cloud, right?
32:51And 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. Or you have a black background behind me, for example. The black is the same on the whole picture. 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, reuse something from the previous frame or the previous previous frame and so on and so on. So you could basically, it's unlimited, but then it's limited in terms of memory or in terms of compute power.
33:28Because, for example, if you need to compare pixels on 200 frames in the past on 4K resolutions, it's a huge amount of compute.
33:38Lex Fridman:And then when you're showing it, you have to do the decompress of all of that. So the codec has the encoding and the decoding. There's a coupled process that you're developing. Yes, exactly. And those are two different trade-offs. Are you going to compress more, but then it might be more difficult to decode? Are you going 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 client side, 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.
34:18And 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 more compression. So just to elaborate, codecs like AV1, VVC 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 DVC 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.
35:12Lex Fridman:And like you said, there's a bunch of incredible engineers behind each part of that, each part of the tools that make up AV1, for example. Sure. So we've kind of danced around it. We talked about VLC, the logo, the hat. Let's talk about FFmpeg. What is FFmpeg exactly? FFmpeg is basically the low-level libraries for codec to compressions and decompression, muxes and demuxes and filters. The core is this, and then you have several tools which allow you to create a type of pipeline to process any type of video files. And it's used as a library, absolutely inside everything, from VLC to Chrome to your smart TVs to basically any video that you see online, you usually use FFmpeg.
36:03And FFmpeg in it has all those type of tools and sometimes depends on other libraries like X264, LibVPX and others, right? So it's really now the de facto tool to process images. From a philosophical level, I think it's incredible that your home videos, your grandmother's home videos and trillion dollar corporations effectively are on a level playing field using the same technology stack. It wouldn't be a surprise, you know, these big companies just have 3000 line FFmpeg commands. There are some that use the API, but there are some that just have long command lines.
36:44Lex Fridman:So, yeah, there's a bunch of tools, like literally command line tool, FFmpeg, of course, FFprobe, there's libraries, LibAV codec, LibAV format, LibAV filter. But the FFmpeg on the command line is like legendary because you can cut, there's so many parameters, you can customize everything to help. It's a language. It's an actual language. It's an actual, yeah, you could think of it as a programming language. Yeah, of course, I'm sure. So most of the people, they're going to take FFmpeg, file in, file out, and specify the format, right? But we've seen thousands of characters, and we've seen also people doing programming generation of command lines to make FFmpeg.
37:29There 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 specify so many filters, right, on command line, right? So 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're on YouTube. Well, it's FFmpeg on the client side. Well, your server side, on the server side, the client side is probably Chrome. Well, you're using FFmpeg also. And you're using OBS to record. Well, it's FFmpeg, right? You're using a ton of important, like, big box, professional boxes.
38:06Well, it's very possible that inside some part of FFmpeg is running.
38:10Lex Fridman:I mean, there's, like, so many. Just to give people an idea. Like, I use FFmpeg a lot on everything. Just trivial stuff like 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 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 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 could shove in on the audio and the video side it works but it's like if you if you look at for example you can do things that you would do with adobe after effects in command line on ffmpeg right it's and it's very interesting because for example for for For Images, there is not such tool.
39:20There is a few tools, but not with the breadth of FFmpeg. So ImageMagick has a similar kind of spirit. Yes, but you will not do some filters, complex filters. You don't have the equivalent of Photoshop in common line, right? But for video, you have FFmpeg in common line.
39:35Lex Fridman:Yeah, it's incredible. I mean, it's like 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. And the vision behind, and the same for VLC and FFmpeg, is that we make everything that is very complex easy to use for the normal people, for everyone, right? Our goal is to make something that is insanely complex technically and make it easy to use, right? And people, they use VLC, they drop a file, they don't realize how complex the file is, but they play it. or people put any type of thing inside FFmpeg with complex filters and it just works like magically right and people and this is our mission right make very complex things we wouldn't be here and you wouldn't be here if this required you know a traditional television studio setup it's tools like FFmpeg that democratize this the the podcast and streaming revolution the youtube revolution was caused you know FFmpeg was a big player in that because 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 label playing field and that's something that's so remarkable it gave voice to a lot of people and we just to clarify we say you you wouldn't be here not the human but the podcast The podcast, sorry.
41:03Lex Fridman:You as the story. VLC did not have anything to do on a biological level at creating me as a human. You realize also everything moved from text to images and images to video, right? Look at social networks. Video is everywhere. It's the most powerful medium there is, right? And when you see shorts and reels and TikTok, right? It's amazingly powerful to give. Video is amazing for that, right? but the complexity is important. It's what people don't realize. I mean, this is really, it gave power to the individual all across the world. It'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.
41:50Lex Fridman:And there's an 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 can you speak to the open source element? So when we say, what is FFmpeg? It's an open source project. Yeah, so FFmpeg, VLC, X264, VideoLand, 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? Usually when you want to buy your cheesecake, you go to a bakery, they give you the cheesecake. The other one way of having a cheesecake is have your grandma give you a recipe of how to make that.
42:32When 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 time tell you how to build the oven and also how you're allowed to modify the recipe and resell it to someone else. 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 where you just have like the final cheesecake.
43:09In open source, we make, we give you everything. And that managed 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 FFmpeg. Since the beginning of FFmpeg, probably 2 ,000 to 3 ,000 people have contributed from the beginning, right? And then it's exactly like the Linux kernel, right? The Linux kernel has probably 10 ,000 people contributing everywhere. And they get together, well, mostly online, right? So they 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 and we should mention depending on the
44:09Lex Fridman:licensing uh you could probably build a billion dollar maybe even a trillion dollar company around this as a wrapper? Well, yes. People do. People do, right? There was a lot of problems with mostly cloud providers who are basically running some open source tools in the cloud and just give you the API to access to that. And there was a lot of databases like Mongo or Elastic who changed their license in order to avoid those type of scenarios. This is a question we get a lot in FFMPEG is why don't you do that? And you can't. We have thousands of contributors, some of whom aren't even alive anymore.
44:53You would need all of their agreement to do that. And JB will go maybe a bit later and talk about how challenging that process was in VLC to do the re-licensing. 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 allows those license fork, right? Sometimes the community splits, but it's possible because of the license and to merge back. And we've seen that so many times, right? GCC and EGCC in the past. We have seen, for example, all the web browsers, right?
45:33They started as K-H-E-M-L, which becomes WebKit and then which becomes Blink, right? So open source license is like the core of the community. And people are coming from all around the world, very different type of religion, political borders. 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.
46:02Lex Fridman: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 copy left, 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, Apache, GNU GPL, GNU 8 GPL where's LGPL yeah LGPL let's see there's 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 and BSD and BSD Apache sometimes you'll see Apache on license that's an option attempts to dedicate code to the public domain with a fallback permissive license there are many licenses for many different things what people don't understand that public domain is something that doesn't exist worldwide, right?
47:04So it's all the open source licensing 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 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 and this is popular for javascript and the type of bsd operating system
47:41Lex Fridman:so some of them one of the parameters is whether they require attribution meaning if you use the code you have to say 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 the other part of license, which are copyleft, where you need to give back to the community your modifications, and with different string attached. Some weak copyleft license, like the Mozilla public license, to some which are a bit stronger, like GPL, or even very strong, like AGPL. So all of those are different type of licensing that depends on what your goal are.
48:23and how you want to structure your community, which is why I spoke about social contract, because this is very important to understand. FFmpeg and VLC are mostly GPL or LGPL. The Linux kernel is GPL, but Android is Apache. A ton of JavaScript frameworks that are using are mostly MIT. All the BSD kernels, OpenBSD, NetBSD, are of course BSD. And so it's a philosophical change on how you want people to contribute back, basically.
48:57Lex Fridman:So there's, I think you talked about that you've moved at one point from GPL to LGPL on certain parts of the project. 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. Yeah. So you have to realize that you can always go from more permissive to less permissive, right? Because, of course, those licenses are basically statements. So if you restrict, you can always restrict more, right? So in a GPL project, you can take MIT code, but you cannot do the opposite, right?
49:36Because they are more constrained to match. indeed in fact i changed the core of libvlc which is the engine of vlc from gpl to lgpl and there were two reasons to do that the first one is that so people can use the vlc engine libvlc into third-party application so a lot of applications which are playing video on your phone on your tablet are actually vlc engine in it which is calling ffmpeg in it yeah 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 applications 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 for a lot of like commercial companies who don't want that so you can create a company with lgpl you can create a company around it you can
50:35Lex Fridman:do a commercial thing you don't have to open source it so that's a big big leap so you can play video in your game yes the problem is i'm a game developer and i want to play some videos and i don't want to be forced to open source the entire game just to play those videos so that's where the consulting business the libvlc lgpl allows you to do that the lgpl the library gpl as it used to be known allows you to do that and ffmpeg is exactly the same it forces lgpl forces you to give back what you change on this component, this library, which is why it's library GPL. And so you can use FFmpeg as LGPL into like any type of application, even non-open source, but you need to give back the modification you did on FFmpeg, same on libvlt.
51:19Lex Fridman:Is it limiting from an open source perspective to go GPL? Because if your library, if your code is gpl it means you're not you you're basically discouraging companies from building a business around it right is that fair to say it depends on it depends on the company but the company whose business model requires the source 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 bit more obscure is that the terms of condition of the 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.
52:02So VLC on Windows and on Mac and on Linux is GPL. The core is LGPL, but on iOS, the iPhone version and the Apple TV version is a type of different license called the MPL. And yes, I went and changed the license and was a long story.
52:21Lex Fridman:Yeah, so I think basically to change the license, you have to contact all the contributors. Yes, it's very important to understand that open source projects are what we call in the U.S. copyright law joint work or in civil law collective works or collaborative works. It's that you work all together in terms of the same goal and then it creates one software, which is one release. But the copyright is kept by all the individuals. Some open source projects don't do that. They force copyright assignment, but this is not what we do with communities. So everyone has basically copyright on what they changed.
52:58And this copyright stays even if at the end 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. And at that time, I had to contact more than 350 people. And sometimes, well, they are just an email, right? So you need to actually track down. I actually traveled to some place to go somewhere that I was like, sorry, that I found online to go to their job and say, well, you licensed that. Do you want to change from GPL to LGPL? Most of the times they don't even care. They wanted to help VLC.
53:36But also it brought me to a very complex situation. I arrived to the work of a person who was a factory worker. And I said, well, I need you to sign that. Because it was his son who died who actually wrote the code, right? 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 lines or five lines that that guy did. But it was useful. And the whole community agreed on that. And he had no idea I was a factory worker. And I was a lot younger, right? Like, it was 14 years ago. And, like, I was almost in tears, right? It's very difficult, right?
54:16We are talking about lives of people. And he explained, and we went to talk about the photo of this guy. So it's important to do it right and to do it correctly. But yes, that means tracking down everything because every contribution works. There are some projects who don't respect that, and we do relicensing a bit aggressively. But as I said, it destroys the whole heart of the community because we only agree on the license. So that's important. 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 people from all walks of life, rich, poor, young, old.
54:59So it's quite remarkable to get a group of people aligned on something. And that's an achievement in itself.
55:08Lex Fridman:Yeah, it's incredible. And a lot of them are introverts. So you coming to find them and getting them and getting them to answer an email might be quite, quite difficult. Well, most of us are introverts, right? You need to be more precise. You are extremely introverts, extremely, extremely introverts and introverts, right? It's just like a whole spectrum of different people. It doesn't matter. The important is, is your code good? 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?
55:42Like 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 an engineer at this very large company in Italy, in Germany, in the U.S. We don't care. We care about the quality of your code because this is what defines our community. which means that we have a lot of people who contribute who are some very different backgrounds and very introverts, sure, but that's okay, right?
56:20Lex Fridman:So one of the legends of the community is, of course, Linus Torvalds who 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 you just speak to the legend of Linus Torvalds? Linus is one of a kind, right? And I would even go and say that what he did on Git is more interesting than what he did on the Linux kernel. 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?
57:02So 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 70, 80 % of the servers are running Linux. All your Android phones are running Linux. What he did with the power of a source, sure, is amazing. 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 10 to 15.
57:47And we are the ones who are going to maintain your code, right? Because 1 ,000 contributors in the timeline and just 10 staying, it's 1 % chance that someone comes and stays. 1%. so you will have change of job change of wife you have children you have accidents in life you're going to change jobs whatever you're not going to come back it's most likely so we are the one going to 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 have very few to maintain something that is critical for the whole
58:28Lex Fridman:But we should also mention that there is some spiciness, some harshness to the language that's sometimes used when you're keeping this high bar of excellence. Is there something to say to that? It's true, right? It's also the fact that, for example, what we're doing is low level. It's extremely technical. You get into this community. The tone gets 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 FMPEG and VLC, we do Video Land Dev Days, VDD every year. They are so fun in real life and they love it.
59:07But it's true that you're online and sometimes like the tone, you don't realize how it is. But that's okay. It's a culture.
59:14Lex Fridman:I mean, you get this in the gaming culture. There's pretty harsh and tense the way people communicate. And everyone understands that the way you show love and respect just looks different in different communities. Sometimes people, 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. But it's very not often insults that you see, for example, in the gaming, right? So Linus' tone is a bit unusual, even for the open source community. It's more like, it's more harsh on the results, saying, no, this is not good.
59:50This is crap. Those type of things that you will see. Try not to make it about the person, make it about the code. Yes. It's very matter of fact. 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, and that's not something to take personally. You're tired, you're busy, but you still care about this open source stuff. But you may not be able to explain and handhold someone on every subtle detail.
1:00:22And also, you have to realize that most people don't speak English as native language. And this is, especially for open source projects like FFmpeg and VLC, which are mostly sent out of Europe. Sometimes, like, people who are from the U.S. 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. English is a difficult language. There are so many subtilities and tones and so on that you don't have, right? So often it's also difficult in those type of community about different cultures and languages.
1:00:58Lex Fridman:So as the legend goes, JB, you repeatedly turned down millions of dollars to 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. Yeah, that's like almost a meme, right? On Reddit. There literally is a meme on Reddit. 9gag and yeah, yeah, I see there's you looking like a wizard in the VLC hat on Reddit. This is JB, the creator of VLC media player. He refused tens of millions of dollars in order to keep VLC hats free. thanks Jean-Baptiste Kampf. You can even summon him on Reddit. Yeah, and usually if you see, right, it's usually like people tag me, right?
1:01:50And then there is me. And then I say, good morning. I got 24K upvotes, which is great, right? My karma on Reddit is amazing, at least on that account. So the question needs to be answered first. What is a story about VLC, right? Because yes, this is true. I refused dozens of millions of dollars. Yes, several times. Yes, I could be a multimillionaire and be somewhere on the beach. 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 myself.
1:02:32But the reason is also because I did not feel that I'm completely legitimate to do that. And let me explain you why. VLC story is a very weird story. In France, we have university and we have a type of top colleges. And those top of excellency schools are engineering school, business schools, and basically lawyers and medical. Right. But they're outside of university. And in order to enter those, you spend two years working like crazy mass physics to enter those best engineering school. One of the schools is called the Ecole Centrale Paris. It has changed names since, but it was called the Ecole Centrale Paris.
1:03:11And because it was central, they had to move it because it was too small after the World War II. 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 the school that Eiffel, right, the one who did the Eiffel Tower, attended to, right? So they said, no, no, we are an amazing, great school. We cannot do that. And so they bought a piece of land south of Paris, very near Paris. And it was a campus managed by a nonprofit of the alumni. OK. Because of that, everything on the campus was managed by students.
1:03:48The university did nothing. Right. So radio, TV, supermarket, library, defining who was going into which rooms. Everything was managed by the students. That's amazing.
1:04:02Lex Fridman:That's an amazing experiment. That it all didn't go to hell quickly. It somehow flourished. It worked great. And I learned so much in my life doing those side activities, right? Because you're 22 and you need to run your campus else you don't have electricity, right? So you care about that, right? But anyway, in the 80s, they did a full experiment of deploying a network 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? Everyone is linked.
1:04:41It's 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 and the 90s um and start video games and when you have high latency video games basically you die right so in 1994 1995 around doom and new cam 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 also play video games um and the university tells them that basically, oh, I'm sorry, we cannot help you.
1:05:39Because you understand, the campus is not ours. You manage it. So do something. And you should see some basically partners of the university and basically go away. And they go and they actually go and see the CIO of Bouygues, which is a large French company and who's doing some TVs 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 satellite dish. And it 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 an enormous dish and only one decoder and you send the video directly on the network.
1:06:28And that required a very fast network. Today, it's obvious. But at the time, it was like the first to do video streaming. So they built this project, which was called Network 2000. Of course, we are in the 90s, right? Everything is futuristic. It's called 2000. 2000, yeah. 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 megabytes of RAM instead of the 8 or 16 you have. and the demo should have stopped there. And that was a network 2000 project by the students. What was the format of the video that they had to work with?
1:07:05MPEG-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 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 Mathieu, that is a good friend of both Kieran and me. And they start the project.
1:07:43It'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 university wanted to get, because of the IP and copyright of the students, wanted to basically monetize these MPEG-2 decoders.
1:08:00Lex Fridman:Just to be clear, so what was the main application? Streaming on a local network? It was streaming on a local network. By the way, this is like, to state the obvious, this is before YouTube, this is before... 10 years before YouTube. You have a Pentium 60 or 75, right? The main machine was 4886 DX at 33 MHz, right? Yeah, 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 grew up with four channels, having a fifth or a sixth was a big deal. And so having this satellite service with dozens, even hundreds of channels was so groundbreaking.
1:08:34Especially because this is a university where you had a ton of different nationalities, right? So there was a ton of people who wanted... So in the end, they had several dishes on different types of satellites, right? Because, for example, a lot of people were coming from the Maghreb or the Middle East, and so they went to different types of satellites. Anyway, the solution worked great, and they started the VideoLand project. The VideoLand project has several, and some are completely crazy solutions, like one, how to create multicast on a unicast network. But let's not come to that. It's too complex.
1:09:10But VideoLand client part is what became VLC. 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 but the first thing is i'm not the one who created vlc because actually no one did
1:09:39Lex Fridman:right just kind of naturally emerged from the video land project and we should mention that like again you you said it just but to make it clear video land as what it became it was at the time is a set of technologies around video the vlc what you call the client that's the thing that most normies uh that is correct and think of like as the thing which is like the thing that pops up when you click on video and you play it so i arrived in 2003 and then i will create the open source non-profit organization called Videoland and I took everything out of the university to create a non-profit project and something sustainable.
1:10:20Yes, it's true that I spent more time than anyone on VLC and Videoland, that is sure. But it's a continuity of a previous project, Videoland, the student project, which is a continuity of the Network 2000 project, which is a continuity of that and that.
1:10:35Lex Fridman:I'm sure there's moments along the way there you you were thinking, like, what is the future of this from an open source perspective? Because 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. And I can tell you that in 2005, the project should have died. And I made it to continue the project. At some point, we were only two active developers. and i thought it was great technology and was useful and it will be useful and and i made that my my my life and my time um and i made that grow from a few hundreds of thousands of users millions of users to what we have now which is probably billions of versions of vlc around the world and used everywhere um so that's a bit the story of vlc there is a ton of very funny story around that many people from around the world working on it, like you said, in Syria or middle of nowhere in India.
1:11:40But along the way, I got several offers, which were either to bundle toolbars, right? You remember those horrible toolbars, 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? And And people don't understand that. I'm not against money, right? I'm very happy to make money. I created several startups. 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 the right way of doing that. And doing sneaky advertisement or stealing data is not the correct way, right?
1:12:23For example, if Netflix arrived at some point and said, 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. 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 something else happens.
1:12:44Lex Fridman:So it's not even necessarily ads or any of that. It's the shadiness and the 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. But also it's for me, right? 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. Maybe it's my parents' fault 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.
1:13:26Lex Fridman:Yeah, well, I should say, me and most of the internet, thank you for that decision. It's inspiring for others, I think, 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. Because it's an embodiment. It's a symbol of freedom and what the open source community can create. Yeah, and be a service for so many people around the world. And this is important. We should emphasize in the 2000s, it was really normal to download a program and it secretly installs some spyware.
1:14:09It was buried in very faint text or in the license text box that nobody reads at the bottom. And, oh, I will be installing this toolbar and changing all these things. And it was very common to have to, you know, you install a program to do something at the time of any sort.
1:14:24Lex Fridman: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, a few thousand dollars to do it. To say no to much more money takes guts. and takes vision. 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. 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. And again, right, it's not that I don't like money or whatever.
1:15:11It's just like, it wasn't right.
1:15:13Lex Fridman: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 And many open source projects Are built by volunteers So there's a bit of drama recently Karen On the interwebs On Twitter You have a spicy style on Twitter that I think articulates and celebrates all the incredible developers and development and the code, especially assembly that's involved in building some of these codecs and building some of this incredible technology. But that brings us to the bit of a debacle that happened.
1:15:58Lex Fridman:Tell me the full saga of what happened with the Google security engineers. 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 this is not like a secret, it's on the homepage, you know, 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.
1:16:33They provided very limited funding and they even went to the media first announcing how good their AI was before the issues could be fixed.
1:16:42Lex Fridman:And this is in the public forum. Yeah. So 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. Yeah. It's announcing how good their AI is that they provided a standard 90 day industry deadline without really understanding the nature of volunteer driven development. In addition, this vulnerability was on an obscure 1990s game codec. The way, and let's look at it from their standpoint to begin with. Let's, you know. Yeah, can you steal me on their case? Yeah, sure. They have substantial resources working on the security of open source projects that, you know, are ubiquitous.
1:17:26And they've used, you know, a lot of compute to do that and very expensive and very capable security researchers to do that. And that's their viewpoint is they are contributing by doing that. But I think that's where opinions differ. It opened up a lot of interesting fissures, I would say. It does seem that there's a portion of the security community that 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 language they use is extremely aggressive they use very strong language like you will get popped and to Joe Public get popped you know it means something quite bad 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 that 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 locks your locks not secure you need to deal with this whereas actually they're the ones with resources to be able 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 that the the bug reports are very wordy they're very very 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 disc in 1993 yeah 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 recently also um see that um there was another quote-unquote vulnerability it wasn't a 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.
1:20:18And 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 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 and 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, so Alex Strange is a former FFmpeg developer, I think posting in a personal capacity.
1:21:15Lex Fridman:So he posted about security engineers on Hacker News. 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 some kind of secret security people orgy where everyone is dressed like they're in the Matrix.
1:22:00Lex Fridman:Nobody is going to do any of this for you when you fix it. basically commenting on the sort of the incentives for the different people involved and misaligned the problem here is is a disproportion of means on discovery compared to patching it right and this is the biggest issue right um and after that debacle google did some changes starting to send patches which is and they also now have reward tools for fixing issues so it has changed a bit because of that debacle. So it's good, right? But we've seen, and we talk about Google, but we have seen some other large companies saying, oh, you need to fix this bug because it's critical in our product.
1:22:46Can you explain the XZ fiasco?
1:22:49Lex Fridman:The FFMPEG tweet reads, the XZ fiasco has shown how a dependence on unpaid volunteers can cause major problems. A trillion dollar corporations expect free and urgent support from volunteers. 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 Teams actually did. And then 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 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 third-party vendors jira where you can do all of these things it's not it's 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 But if this was just a general bug report, I think that would have made it a lot better.
1:24:04Lex Fridman: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 you're right. They just think of FFmpeg as like a vendor that Microsoft surely is paying a huge amount of money to. 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 have a fanbag? And this is a very big problem in large, like we're talking about some companies, but it's the same everywhere, right?
1:24:45A lot of those companies, like when we talked to that person, right? He was just like a manager on one project in Microsoft Teams, right? He had never really discussed with open source community. He had no idea, right? But the problem is that usually there is what we call OSPOs, open source program offices in those type of companies, and they are the ones who are supposed to discuss with open source vendors or open source communities. But 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?
1:25:25I will send you a contract and SLAs. Like I created five companies who are doing that around open source projects. So that's okay.
1:25:32Lex Fridman:We should say that some of the spicy tweets that carry near behind and some of the debacle produce results, positive results. Donations have increased substantially. They're still not enough to cover even a single full-time developer, but on both awareness level and a technical level, there's substantially more technical awareness and sort of awareness of the importance of FFmpeg as a result of X and what's happened. I can say, you know, it solved its purpose. People realize the level of importance FFmpeg has. And on VideoLine, it's the same, right? Like, for example, 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 a very spicy as you say um tweet saying that we were going to stop distributing vlc for android right and we have around 100 million people using that.
1:26:38And now then someone from Android actually came and discussed to us, right? We had the same issue with Microsoft 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 those 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?
1:27:25Well, I'm sure any other software, Adobe, Spotify has a point of contact. I don't have that, right? So raising awareness works. It's sometimes very spicy, a lot of drama. X and Twitter are okay for that, but it's efficient.
1:27:43Lex Fridman:So everybody listening to this should go follow FFMPEG on Twitter, on X. Follow Videoland on Twitter, on X. Go donate. Donate to FFMPEG. Thank you, Lex, over the years, several years, you've been a supporter of, you know, FFMPEG and VideoLand on X, you know, giving us shout outs, appreciating, you know, what we do. FFMPEG for life. And for example, like Team Sweeney, Carmack and a few others, like very high level people have raised also the awareness on our X accounts. And that helped a lot also. Carpathia. Carpathia. Carpathia as well, yeah. Yeah. I mean, also, you know, outside of the fact that so many people use it, it's so impactful on the world.
1:28:30Lex Fridman: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. It's not just that. 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 Reinhart who do maintenance. It's, I believe, unpaid. I believe as a volunteer, he's doing massive refactorings. Andreas Reinhart and Anton Kurnov 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.
1:29:10The files are exactly the same, but wow, the airplane has been rebuilt whilst it's in the air.
1:29:16Lex Fridman:Christian Garcia said, as a teenager running this account, referring to the FFmpeg 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. 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 rukai 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 actually 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, you can learn C, and let's be honest, it's from the K &R book, learn C.
1:30:13You can learn assembly. We'll talk about that maybe a bit later. You can contribute to world-class technologies. In VLC, one of the oldest contributors is called Felix. He's the one doing everything on Mac and iOS. He's starting working on VLC. He was 16. 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? And part of Google Summer of Code and Google CodeIn, which were programs where basically we have students or high school, we wrote a ton of assembly for X264 and for VLC and for FFmpeg, right? So everyone can contribute.
1:30:54And he also did a good job because he didn't play the alarmist CVE heist, create a CVE, which is like a public exposure of security and do these big, scary, red 7.5 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, you know, there is a, 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 have happily raised this is a high priority cve 8.0 or whatever on a on an issue that actually was in git it wasn't even in a release it was in development and three days
1:31:39Lex Fridman:later was fixed well i just want to put a little bit of love out there even to the bigger community much love and respect to google engineers like you said they're uh some of the best software engineers in the world and they do contribute a lot 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 allowed uh everybody to bicker in a way that ultimately got them to figure out whatever fan peg is all about so the way the way we looked at this is like it's a rap battle at the end of the day no but it is we say stuff we say stuff yeah but we can we can leave it on x is a perfect place for you know international rap battle you say stuff i say stuff about your mama but it doesn't mean you know i'm gonna have an actual personal issue with her yeah and that's what it looks like the theo situation you know we can maybe expand went a little bit too far and there was a little but you know 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 it doesn't need to be taken seriously you know that 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 there's like oh man just have a bit of fun you know 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 etc by doing that i think there's a lot to be offered here it's not dunking on people for dunking sake it's showing actually the story that i think x learned is these are not big corporate open source projects this is not kubernetes where there's you know hundreds maybe thousands of people 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 i think that that that's the good thing and that's that's the value of x and then the reach we have and and to be honest right Like even at Google, Google is one entity, but so many different people, right?
1:33:49And there is a ton of Google engineers we work with 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 for example, for Theo, right, it went a bit too far. I had him, like I called everyone down. I had him on the phone. We say, okay, like this goes too far and so on. But in the end, yeah, it's a hard battle, but it's positive for the project. It's like the awareness we have on open source. And I mean, true open source from communities, right? Not is increased dramatically in the last two years.
1:34:30And this is useful.
1:34:32Lex Fridman:What do you think motivates all the incredible contributors that we've been talking about? Like what's the engine? It's so interesting to see. Like you said, they're sitting in the basement. What's the driver? What's the engine there? There are many 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. And this is like the advice when people ask me, what should I work on in open source? How do I start? And my question, my answer is always the same.
1:35:07work on something you love. 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? That's the first thing where people come to, usually, to VLC and FFMPEG. The second thing is that technically, because we search for excellence, 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.
1:35:52And 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? Andrew Kelly started Zig. He was an FFMPEG developer and started Zig after his FFMPEG school. I mean, 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 how you can learn and be better. And what is also interesting in multimedia is that you have 16 milliseconds to display a frame.
1:36:32It's not like a game engine where you can basically slow down and wait a frame. So you need to be good, right? There is no choice, else you don't have your video. 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 sense, right? A lot of people don't understand, But in order to program correctly on the open source multimedia community, you need to understand how computer works. And when you write assembly, you need to understand about CPU pipelining, right?
1:37:12You need to understand how SIMD works, how the ILU works, right? You need to understand 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 debate 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 type of cpu and this one and has massive impact on the output right we should expand ffmpeg is probably one of the biggest cpu users in the world there's probably it's probably running as we speak easily a hundred order of magnitude 100 million maybe even a billion cpus as we speak so every instruction matters there's not the the impact at least in terms of cpu is massive for everything that we do 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.
1:38:26Wow, great. Like so many jobs are like that. You're not going 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, FFM, Pay, X264. It's in the end of hundreds of millions of people and you have an impact. And so you can be proud of yourself. And so I think that in addition to doing a great resume, all those things are why people contribute. Yeah, those are side effects. My favorite quote on this topic is John Collinson. He said, the world is a museum of passion projects.
1:39:01You know, everything out there 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. 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 location. I have to do all sorts of things. Well, in the software world, that passion project can move quickly. It can be amplified by the network effect. And that amplification can be more than the sum of the parts. You can find people interested in extremely obscure things and have a network effect and make something that is truly amazing.
1:39:44Lex Fridman:And on that topic of passion projects, Tim Sweeney actually said in a reply to a tweet that was 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. It does seem that a small number of people, sometimes one person, can create something incredible in the software world. Like you said, it's over and over and over. I think JavaScript is an incredible thing created by initially a single person. Some of the programming languages like Python and C and Java, like this one person has this vision, has this design, and brings it sometimes over a weekend is the initial spark.
1:40:31Yes, Linus built Git in two weeks.
1:40:35Lex Fridman:Wow. It changed the world. Git, I mean, it really changed the world. Linus, passion for it. Hey, uploading this table to an FTP, like deal with it. But for me, it's not just in software, right? And I believe 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. It is useful. It will be useful. And whether it's going to, like, build trains or cars or rockets or something, like, I believe people who believe in themselves and have a vision can have a huge impact for humanity. Let's actually zoom out before we zoom back in. will just keep going up and down the stack.
1:41:15Lex Fridman:So, you know, we've been talking back and forth, VLC and FFmpeg. Karen, you said that FFmpeg and VideoLand VLC coexist and there's no central point of importance. It's a kind of what you call the binary star system. They succeed because of each other. Can you explain the difference, how they interact? Are they competitors? I don't think they're competitors. 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 coexist because of each other. So they are a binary star system is the analogy I used.
1:41:55Lex Fridman: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. And when you start doing the physics, it's a nightmare, right? Hence the three-body problem. But anyway, so a lot of FFmpeg pipelines involve the X264 project, which is a video land project. I would put a finger in the air that say 80 plus percent of those pipelines are dependent on a video land project. VLC, obviously, we've discussed a video land project, uses FFmpeg, gives it reach, exposure to weird files, historically use some donation money to fund FFmpeg development.
1:42:36And we'll talk a bit maybe about some of the reverse engineering later. So it's a binary star system. 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.
1:42:48Lex Fridman:And we should mention that X264 is the encoder for H264 video standard. So H264 is the standard. X264 is the implementation, open source implementation of the standards. That's used by basically everybody for everything. Yeah. So that is the main driver of this. When you think of an MP4 file that has H264 codec in it. If it came from a software environment, like a data center or somewhere, the chances are it was created with X264. And that's under the flag of Videoland. That's a Videoland project. So in the Videoland graphic, it sits in the Videoland world. And Videoland has a bunch of stuff in it.
1:43:29Lex Fridman:Go to the Videoland website. There's a bunch of icons. Like if you look, there are so many libraries, right? lib dvd css lib dvd nav lib dvd psi lib vlc of course vlc unity lib brew yeah and there is so many more right like lately the david project that we might talk about is the last project from video land it's everywhere right and we do we have a lib spatial audio lately that we announced check ism which is like an insane project but amazing um so and x264 is one of those video land project and my opinion for example is that x264 was in 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 x264 and x264 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 projects that are interwind and work together yeah unfortunately 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's like i said it's not that that's not the case that we work together and to give you an idea right when i compile VLC for Windows, I compiled around 16 million lines of code, right?
1:45:06One million of those are inside the VLC repository, and FFmpeg in total is probably two, around two, right? But that means that so many dependencies are outside. And if you also look at FFmpeg per se, FFmpeg also is integrating third-party libraries like x264, butlibopus, and so many others, right? So we all depend on each other.
1:45:28Lex Fridman:Yeah, that's why I was hoping to do this episode as we are doing that just kind of joins FFMPEG and VLC because it's really two of the same, like you said, binary star system and we're all just orbiting it. Can we give a shout out to some of the people along the way? We didn't really quite talk about the history of FFMPEG. So maybe can you tell me about Fabrice? Can you tell me about Michael Niedermeyer? can you tell me about some of the key figures here about the the eras of fmpeg because there's key eras and key people that made this possible uh fabrice bellard as you mentioned creating the concept and then probably in the 2000s era i would call the era eras tall of fmpeg is that the 2000s era was michael niedemeyer 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 used to so this was 2000s era video codecs where there were flavor after flavor of weird weird decoders 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 real player to play real media formats.
1:46:50And those were the other key thing in FFmpeg at the time were native decoders for those. I actually 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. Because at the time when you downloaded real player, 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 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 2000s 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 div x windows media and real player 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 vlc 1.0 was out on those times 2000 2009 2010 yeah and this is like where it exploded
1:48:05Lex Fridman:yeah without codec packs it just works across all these different the fact so it's just like all the codex packs are ffmpeg inside vlt plus we have other modules for all the type of at the time that wasn't these they were weird in the 2000s there were weird codec packs with dll's coming from this place with spyware with spyware with you know what it wasn't reliable you didn't know and having a single player that was open source or single playback module slash 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 Sisyphe.
1:48:40And it was really, the number of edge cases are beyond comprehension in terms of, you could have a Chinese CCTV system that did one weird variant of MPEG-4 part two, what's known as MPEG-4 ASP. And that was a weird variant. And you had to fix that without breaking everybody else times a million.
1:48:58Lex Fridman:So you said that's where a lot of the reverse engineering was happening. It started in the 2000s with the Windows media stuff, because that was proprietary. It started with the real media, so with Benjamin Larson. Kostya Shishkov. Kostya Shishkov, that era. Those were the key, that was the key groundwork. And then in the 2010s was kind of the Paul Mahal, Kostya era building, doing some of the most difficult codecs. JB, maybe you can talk about GoToMeeting 4 and GoToMeeting 5. What? What's the GoToMeeting? So, like, let's talk about this amazing Ukrainian guy called Kostya, who was at the time living in Germany and who was in love with Sweden, right?
1:49:41And the guy was the most, he's like, a lot of the people in the community are very clever. He's one of those who are like borderline geniuses, right? He was able to reverse engineering extremely complex codecs. And he does that. And we do a bit of engineers with Kiran, but clearly not at this level. No, no. He reverse engineered binary blobs, which are 20 megabytes. So just for reference, 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.
1:50:22But this guy is doing it for very difficult and very obscure codecs. And did that for fun, right? Yeah. And so GoToMeeting was a big problem with VLC because that was like the number one feature request for a long time. So I put a bounty. And the guy at some point said, OK, 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 DCT that I used to see on WMV and so on. He did that. And the funniest part is that the code is written is a ton of jokes. And there is a ton of JB, right, my name, and Kempf and Kostya jokes inside the code.
1:51:08The code is beautiful, right?
1:51:10Lex Fridman:So one of the things I want to comment is I've gotten a chance to speak to some of the developers, some of the assembly language level people, and they all always make everything sound like it's kind of easy. there's a kind of humility because i mean 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 so in the community like some of the most impressive people are the ones doing reverse engineering and the other ones doing the assembly folks right um and both of those type of people are amazing um x264 for example became amazing because uh of a guy called lorraine merit who was from the university of washington i think at the time and who was like who made everything great and fast doing a ton of assembly um yeah so this is like the the the golden era i guess where so many things if you look at costja for example he looked at the world as a binary specification he didn't need documentation or anything it's i have a binary and i can figure all of this out and he regularly used the phrase binary specification i know it's not a problem and he went and he would go away and he would come back and he would do interesting stuff can you actually speak to the details or any add color and texture to what it takes to reverse engineer a blob yeah so so let's look at go to meeting for example is a good one because um i record a meeting on go to meeting for example how do i play it back without needing this go to meeting player they 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 first of all there's a ton of other stuff there there's an 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 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 because you will need that as a point of comparison for when you actually do the reverse engineering because 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 is a kind of not a rule book but there's always a pattern of some sort um for example go to meeting you know it will be a lot of screen codec tools there's also different variants so often i think there's what's go to meeting four five two three four i think two three four yeah so i should mention here going to perplexity go to meeting uses its own proprietary codec for older 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 This is key, right?
1:54:30Because the GoToMeeting is something that not many people know anymore, right? You know about Zoom and Teams and so on. But like, now let's fast forward 10 years, 15 years. And like, this is 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 support for the future. and this is why those type of work are
1:55:02Lex Fridman:exceptionally useful for humanity. I just have to say though, that reverse engineering process is mind-blowing. It's crazy. It's kind of like, you know, I've been reading a lot and I interview archaeologists. I mean, you just have so little signal. Yes, yes, you know, over time you get so much experience, you understand the structure of the original coast, so you can kind of start inferring basics. But you're like an archaeologist with a little brush trying to reconstruct the entire human civilization. Kiran is too humble, but Kiran has done some reverse engineering. Of Cineform, yeah, at the time.
1:55:39Cineform, nice. Yeah, at the time before, actually led to the open sourcing of that work. So in parallel to doing the binary side, you obviously have samples. In many cases, you don't have many samples. So you have to figure out what all the different flavors are, and you may have a Cineform, for example, is actually a collection of different approaches and toolkits within that codec because often it grows naturally. 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.
1:56:16It 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 build up and build up until you go, hey, here's a few bits here. I miss this if branch that it does and go, oh.
1:56:30Lex Fridman:So when we say samples, you mean sample videos. Yes. And then you're tracking, trying to infer, like, what is this codec doing? Yes. By observing the sample and then looking at the machine. The machine code saying, I have this byte is six. Take this branch. And then a different sample. Oh, it's nuts, man. That is nuts. So you see, this is nuts. Then you go to things like GoToMeeting. It's like... Mine was easy, right? Imagine two orders of magnitude of more complexity. A guy alone somewhere in Germany doing that. 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 steps from the entropy decoding, the intra-prediction, the motion prediction, the IDCT, and so on.
1:57:18For a long time, you don't see anything, right? So you're debugging purely in memory. 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 and you're doing that on binaries that are tens of megabytes millions of instructions right 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 pausing the program on the cpu level pausing it there on the cpu level watching what's going on trying to figure out sometimes you need to like be in a vm so yes you can pause the vm yeah pause the vm dump the memory because it 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 like when i joined the call in 2003 john lesh johansson basically broke the dvd specification and created dcss showed us how he was breaking a DRM, which was MP4 Fairplay from Apple.
1:58:19What he did on his laptop, and I was young, I was 21, was just like mind-blowing because he was basically debugging Windows inside a type of VM with, like, wow. It's incredible.
1:58:31Lex Fridman: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? 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 ask and you have to ask for samples. I remember Videoland used to tweet for samples at one stage. Hey, I need this obscure sample. For a long time, I was, oh, I need this codec and I need this codec. And if you were really lucky, you would find like, if you were unlucky, you'd get like one or two, you'd get nothing or you'd get one or two.
1:59:04And then sometimes you'd find a goldmine. Like, yeah, my company has 100 ,000 of these files because we depended on it for some reason. and so those are those are kind of the best if if because then they can test bit exactness across the huge range of coding tools can you explain bit exactness 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 bits in exactly the same data that comes out of a decoder.
1:59:39Lex Fridman:For like a large number of samples? 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, most of both of us were in diapers, I suspect, but have acknowledged, I would give a shout out to juri resnick he's acknowledged that was one of the big mistakes of the era and you're saying the encoders needed to be able to run tests and then the the bit exactness i mean that's a nice thing to guarantee like there's a parallel sort of development here on uh the way the web browser works which is you know takes html and displays it and there's no bit exactness there across the different engine i would i would point out actually ffmpeg is unique in the sense that it's it has been a winner-takes-all scenario.
2:00:35Browsers 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 across a wide range of codecs. FFmpeg has kind of won it all, I suppose, in a sense 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 man this is really
2:01:06Lex Fridman:cool uh going to perplexity yuri resonek is a multimedia and signal processing researcher got his phd in computer science from kiev university with over 150 papers and more than 80 granted u.s patents contributor to major multimedia standards including issue 64 mpeg 4 avc h265 uh mpeg 4 als g718 g718 is telco stuff And so he was more connected to company. Real audio, real video, right? That was very important at the time. Zen Coder, Bright Cove, Context. Man, I need to hang out with Yuri. He's legit. And he's like one of the most nice person ever, right? Like, for example, for my startup that I'm doing right now, called Kyber, right?
2:01:53I met Yuri because I met him every year at the Mile High Video Conference, which is in Denver. and he gave me so much good ideas and good things. He's a really amazing person. He tells us how great it is to even know us and you look at that and I think it's the other way around, Yuri.
2:02:14Lex Fridman:That reminds me of a thing that you mentioned to me about FATE testing and the insanely rigorous process that's used to test everything that's incorporated into FFMPEG. Can you take me through the testing process? Yeah, so FFmpeg has a system called FATE, FFmpeg Automated Testing Environment. 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 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.
2:02:55Lex Fridman:I'm looking at a page fate.ffmpeg.org 81 minutes ago, 76 minutes ago, looking at the different architectures, the operating system, the different compilers, Apple Clang version. Combinations are crazy. The combination is insane. These are all run by volunteers. So these are all volunteer systems. The ones at the top, for example, the Macs I host in my office, for example, host all sorts of different stuff. Other people host other things. so it's really there to make sure 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 oh there's like there's a log of all the compilations log of all the compilations all the tests i think one of the other ones will show all the tests passing if you click you can see all the tests back all tests successful in logs test yeah so you see all All those tests are parsing.
2:03:55Of all the different codecs, all the different filter transformations, all the level of scale is quite crazy. On all the combinations, it's not just a matrix at this point. It's like a pivot table of different combinations. That's nuts. And it's a key part of what we do because 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 video 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 you see power pc you see risk you see there was there was weird stuff in the past like dec alpha you see visual studio different visual studio
2:04:50Lex Fridman:intel compiler apple client you name it 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 for me it's really easy because so i have a day job my company builds the company i started builds um equipment for broadcasting sports matches between tv stadiums studios for example we have to work with 10-bit video and 10-bit video has 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 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 because 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 are some are industry ones and some are internal to our own hardware that we build we have a i think a five by five or six by six matrix of every single format to every single other format conversion in fact 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 by the way the company you're talking about is open broadcast yeah so no no relation to the free OBS streaming service yeah yeah 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 it would be accepted that C is fast as you can see from that C is not fast so here it says 62 times faster than c 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 In most companies, it would be, I'll write this in C and it's fast and we're done, but actually you can get a lot better.
2:07:12For me, some of the headaches we have is around some OS that are difficult to support, right? Because 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. We work on macOS 10.7 to the latest macOS, whatever it is, right, 26. We work on iOS since iOS 9, where we are actually iOS 26, right? We support many types of Linuxes, BSD, Solaris. The last version still runs on OS 2, right? Like there is maybe 10 users of OS 2 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 all the other ones support more OSes than Microsoft or Google or Apple.
2:08:15And they have infinite amount of power and resources. But for example, the worst is iOS. In order to build on iOS 9, we need to do some very clever mixing of several versions of the Xcode IDE and SDK from Apple from several versions 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 compiler of 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 os's 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 non-stop while you could optimize
2:09:27Lex Fridman:more which is a lost art you gotta tell me about this lost art or this uh the carriers of the flame of assembly what what is what is assembly why is it beautiful why is it challenging how does it work 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 is a good example the compiler would use that to create assembly language and machine code instructions for you based off your C code. And there's a specific flavor of assembly that we use in FFmpeg that's called SIMD, single instruction, multiple data.
2:10:14So this means, for example, 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 want to have a number of, I have the number 10 and I want to add five. I use the add instruction and I add 5 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 5 to that, 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 is a pixel grid, so I can perform operations on multiple pixels at the same time.
2:10:58The 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 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, a not percentage, 10x to 50x speed improvement. That function is 62x. That's nuts. On the FFmpeg account, as you know, posts and tweets a lot about that to try and say, hey, we're doing this stuff.
2:11:41Lex Fridman:You are a person who sees the beauty in assembly, but it's also extremely useful for these kinds of applications to actually significantly outperform even C, which is crazy. It is necessary, right? Because like one of the projects that we need to talk about is called David, right? So David is a decoder for the format that was done by Allianz for Open Media, which is a video decoder called AV1. So for people who don't know, we've been talking about H264. AV1 is another hugely popular standard and codec that is increasingly taking over the Internet. And when this format was launched, many people said, especially even from the Alliance for Open Media, right, which is Google, Netflix, Amazon, Mozilla, say, well, this format is so complex, it must be done in hardware to do decoding, right?
2:12:40And, well, I arrived with a few other people, mostly Ronald, Henrik, and Martin, and we said, we need to have an extremely good software decoder because it's going to take time to have hardware. And so we wrote this project, which is beyond insane. We are talking about 30 ,000 lines of C, but 240 ,000 lines of handwritten assembly. Right.
2:13:10Lex Fridman:Handwritten assembly, 240 ,000 lines. That's incredible. I mean, some of the stuff we're talking about is probably the biggest assembly code bases. 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. All codecs. And just this one has 240 ,000. It's a video land project, of course. 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 3 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, And you often don't have a hardware decoder because not many devices have a hardware decoder.
2:14:11And with David, we realized that in one or two cores, you were able to decode 720p correctly. So it is like literally incredible, right? That's David. Look at that. Yeah.
2:14:23Lex Fridman:So this is another spicy tweet from you. This is what peak video codecs should look like. 79.9 % assembly, 90.6 % C, and 0.5 % other. And what's incredible is with those tweets, which is factual, people get crazy. They are unhappy, right? For the last two years, they go crazy. No, intrinsics is fine. The compiler is... Oh, they go. You can optimize your compiler. Auto-vectorization is your fault. You don't understand. And we've tried that forever, right? For two years and two years later, They're showing hundreds of examples of handwritten assembly. No, no, no, you're doing it wrong. The compiler can do this.
2:15:05Lex Fridman:So 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. Yes. And the presumption is if you have a good enough compiler, if you continue to improve the compiler, you're going to generate code. Yeah. They can perform like optimal performance. You cannot possibly beat it. And you're consistently challenging that thought that if you do it by orders of magnitude, by orders of magnitude, a handcrafted assembly can outperform C.
2:15:40The 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.
2:15:56Lex Fridman:So can we, I don't know if you can say something philosophically, because 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... Karpathy learned assembly because of the tweets, by the way. He's like, oh, I think this is a move. Let me figure out what's happening. 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 have the end of the more low.
2:16:27We have limitation 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 requests for power, CPU power, GPU power are exploding while the hardware is not exploding in speed. Right. So 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. Not just that. Not just that. We abuse the machine. We go and use the machine in ways that the creator didn't expect. Sometimes we use an instruction that's completely unrelated to what we do.
2:17:10We use a cryptography instruction in video processing to do nothing related. And one of the other things that we do, for example, in David, which is a bit crazy, is that we don't use the function calling convention from the operating system. We should explain that. That is extremely complex. But basically, usually when you do move from one function in code to another, there is a way to save the registry, the state of the CPU to enter another function. And this is like standard. It's a bit complex. I would simplify this a bit. 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.
2:17:52How is the data shared between the functions? Because 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 want to call Lex Friedman's library, 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 every operating well not every operating system but there are at least four that i can think of on x86 linux 32-bit windows 32-bit windows 64 linux 64 they all have their own calling conventions and so one of the amazing things lauren 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 But David takes this even further.
2:18:44For speed reasons, it does its own calling convention within itself to bypass the rules of functions and say, okay, actually, I'm going to 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 challenge is in general, yes, and 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 matrix has got bigger in recent years because of RISC-V, because of ARM64, because of the new SVE.
2:19:25There'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. And then from then on, off you go. Or you could be on a machine with RISC-5. 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.
2:20:10So 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 why Kiran calls it an art, right? It is an art. I think in a mass world, there isn't something on billions of devices. 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-produced thing that's on a billion devices that's hyper-specialized running on hyper-specialized hardware.
2:20:49We're running on all hardware from...
2:20:51Lex Fridman:Sorry to linger on it, but that's a really counterintuitive, almost revolutionary 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 from myself included you know i program for many many years in cc plus plus going up the standards of c plus plus fell in love with c plus policy metaprogramming and so on and then transition more and more because the machine learning about 15 years ago to python and so like for me in this python world javascript world now oh, vibe coding where I'm just using natural language sitting in my jacuzzi drinking a drink and just talking to the computer.
2:21:38Lex Fridman:Like record stops. Why is the value to go back all the way down to the low level? 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 good analogy is what you see in quantization in LLMs, right? and people are doing, oh, I'm going to do that in FP8 or FP4 or some crazy things like Microsoft Fear, 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 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 get faster and you cannot always get harder, more powerful hardware, right?
2:22:26So you need to analyze code and see where is the mission critical, where is the things that are called non-stops. And for example, David is a good example. It's going to be run billions of hours per day. That makes sense. It doesn't make sense to be on the glue of FFMPEG CLI. It makes sense over there.
2:22:48Lex Fridman:Yeah, this has to do, also we'll talk about it more, but your new company, Kyber, is doing that kind of thing for ultra low latency. So the slogan being every millisecond counts. So when you're actually extremely highly constrained in some dimension. We're 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 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 vibe code are optimization for the hardware to be as fast as is possible i'd love to talk to you about who and how should learn assembly.
2:23:48Lex Fridman:But first, I think we need a bathroom break. Quick 10-second thank you to our sponsors. Check them out in the description. It really is the best way to support this podcast. Go to lexfriedman.com slash sponsors. And now, back to the episode. All right, and we're back. There's this nice repo with the assembly lessons. First of all, do you think developers should learn how to program an assembly? and how would you go about learning it what is this asm dash lessons so i personally wasn't happy with the way assembly is taught in books and online because it's very grammar focused and you don't in general learn a language from learning the grammar and the structure you learn a language by asking someone what their name is and you start from there and you go and solve real problems that you have when you want to communicate.
2:24:43You don't learn sentence structure. This is the interrogative and the adverb. And 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 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 the only logical sort of analogy. And that doesn't really scale online. It doesn't do the thing. So I started a set of assembly lessons 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 and really low power, cheap devices.
2:25:27And 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, 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 to get this dying art to continue because we've shown it's possible with david to produce something amazing there's still a lot of codecs in ffmpeg that are only maybe partially assembly optimized.
2:26:06And so 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.
2:26:21Lex Fridman:And describes all kinds of registers, general purpose registers, vector registers, really nice examples. This is cool. It's a classic example of how big, but some of this assembly language is really beautiful. 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. There's nothing in between. it's you and the the joystick of the cockpit and you you move that joystick and it's physically connected to the earlier ons and you can push that plane beyond what it can normally do and there's a level of yeah beauty and 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 it's literally uh no i should i was gonna say wizards handing it down i realized i look like a wizard wearing this hat but you're basically just like the sages the wise sages handing down the craft can i ask about llms like can they help they have 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 it's going it there isn't the corpus of information like stack overflow to work on there is not enough data to train on um and this is the biggest issue um i started my career actually doing some uh assembly for etanium right so the etanium is a dead um processor type right which was done by intel in hp a long time ago when they wanted to do 64 bits well they lost and then we got AMD who did it AMD64 which became X64 but Ethanium was extremely interesting in the sense that those were processors who had a ton of computing power to do floats FMAs which is similar to what we need now 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, the memory bus only allowed 1.5, right?
2:29:00So your CPU was four times faster. So you had to do crazy things to pack things in memory, reuse the registered, and those type of semantics, no language could do that, right? So like I have the Itanium programming book because Intel did amazing books, but that's exactly what Kieran says. if you don't know what 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. And people have, people have, there are patches and it's, oh, I studied your lessons and here's my first changes.
2:29:39That's amazing. And part of that in the lessons is a framework called X86 Inc. written by Lorraine when he was working on X264. And it allows you to do more things about that to create a type of like not caring too much about different calling convention. And we had a lot of students who gave code to X264 using that a long time ago. Right. So it's really doable. And I believe it's necessarily to understand 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 computer, right?
2:30:27Understanding register, L1, L2, L3, RAMs, SSDs, disks, and so on, which are very important because then you have a good programming culture that will make you a better programmer.
2:30:40Lex Fridman:What do you think about the Rust programming language? Because that's a bit of a meme. We have very different opinions with Kiran. I think it's valuable what they're doing in terms of memory safety as a concept. Can it achieve some of the speed up that assembly achieves? Not assembly by hand, no. I think that's a given. C, potentially. But I see it very, it has a very big Esperanto vibe about it. It's like, we're going to solve this and we're doing this in a particular way. Meaning it's a bit too utopian? There's a lot of focus on the self-importance rather than solving real world problems. It reminds me of the Sinclair C5.
2:31:15sir clive sinclair of sinclair computers built a car and he said oh everyone will be traveling around in you know one of these electric cars and it was um frost 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 percent of the feature set of what what we need like things like core utils that last one percent takes 99 of the time um 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 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 you know it still has only one compiler implementation yes so 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 probably all agree that that's the goal?
2:32:37So 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, which was one of the main architecture decisions, 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 so we did some Rust modules. And so I have experience on that and I wrote some of it. And also like my new startup called Kyber is an open source project mainly done in Rust. What Rust is extremely good in the sense that 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.
2:33:32However, 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 interrupt with the existing part. And some part of the Rust community believes that they need to rewrite everything and everything will be better with Rust. And the answer is like, no. Like I'm almost always and all my years of being engineer, manager, CTO of startup and so on, don't rewrite, right?
2:34:00Lex Fridman:That's the initial instinct for a lot of people when they show up to a code base, probably before LLMs, is like, probably because they don't understand 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. 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. Yeah. And you see that also with LLM. They can write code, but analyzing is a lot more difficult. And so when you arrive to a very complex piece of code, right, you don't understand it, right?
2:34:44Because it's so much more effort to understand the code from someone else because you don't have the thought process. And often I joke about some languages, mostly Perl, for example, 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? 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 write it.
2:35:24And the thing is, no, you don't, right? Because that's, as Kiran said, right? I'm going to reroute core utils in Rust. And then, of course, you arrive very quickly at 80%. 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, networking, because of the memory checker, borerage checker, it's amazing and there is nothing else. To answer a bit differently for us, imagine i take a piece of software like 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 write handwritten assembly because we can jump anywhere.
2:36:28So in my opinion, we need to do something that is secure assembly, right? So which is compile time, check the assembly, which is similar to the check assembly project that we're doing on David and X364 with Videoland, 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 i just want i would say on a personal level i'm so in awe about the assembly i actually once it never gets old the speed improvements to show 62x there are months on a personal level i run our internal test suite at work and just see i'm
2:37:22Lex Fridman:still in awe of the gains we have there's a source of joy and happiness programming for different reasons but i think one of the greatest happinesses is in the optimization of code and it sounds like you're like at the cutting edge of that that was cool in the community i want to speak about two people who are wizards of assembly, right? The two of them are actually working, living in North of Europe, Sweden and Finland. And 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.
2:38:09He 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, etc. That person is like the best person on assembly in the world and he's the nicest person that you've seen. He arrives, you don't see, he's amazing. And the other one is called Martin. Martin Storcio, and he's 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 keyboard, like virtual keyboard you have, while watching his kids play in the playground, right?
2:39:02Like, this is just like wizard level.
2:39:05Lex Fridman:so those two people are like yeah 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 so x86 in particular yes arm in particular but xx i mean these are complicated architectures right yeah but uh um in some ways is more x86 with uh out of order execution it's not so bad um you really need to understand all the different generations of arm processor because they're all different there's a72 etc etc 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 x86 but broadly speaking you have intel amd you have sub variants but generally speaking there's something fast is going to remain fast on all of the variants whereas an arm is a completely much more complicated ball game we're taking a non-linear journey through history here but we're talking about michael niedermeyer uh and i wanted to ask about this for a time there was a split in ffmpeg and a lib av yes so um in open source projects um sometimes you disagree right um that's such a nice way of putting it yeah and the good thing is because of the license you're allowed to basically do your own, right?
2:40:30And this is normal, and this has happened all the time, right? At the point, there was a GCC at the time of GCC2 and eGCS, which became then GCC3, right? There is what we told, KHTML with WebKit, with Blink. It is a sane 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 split in the open source community on FFmpeg, which became Libévy and FFmpeg. And after a few years, well, the community merged back and people moved on. It's a bit drama that is normal in open source community, but folks are even, they're important because they change the status quo of a community.
2:41:18Not talking about FFmpeg and eBay here, but the GCC fork made GCC a ton better because some people wanted to change the architecture fundamentally to make it faster. And of course, it's always a question of people and so on. But in the end, you realize that FFmpeg today is better than it was before the fork. And now, well, we're back all together, right? And I spent a lot of time, and Kieran can say, in the community it's not often to be honest very well explained because a ton of the reasons are not very public but I think that's normal and that's good
2:42:02Lex Fridman:Yeah I mean you're making it sound really nice but there's pretty heated battles inside open source projects I mean it is a very passionate community and you are kind of in a distributed way have to define the direction of things so here looking at perplexity FFMPEG and LibAV split in 2011 mainly over project governance, leadership style, and development processes, not because of a fundamental technical disagreement. FFMPEG effectively absorbed LibAV's work while LibAV withered most distributions and developers moved back to FFMPEG. Yeah, that was a weird, from a user's perspective, that was a weird experience because I'm a Linux user, so whether it's Ubuntu and so on, all of a sudden, I think for a little bit, bond to i feel like am i remembering correctly switched to lib av 12 14 something like that yeah something like that and then they switched back i was like what is happening so i'm sort of you you get to feel the ripple effects of the different internal debates that are happening to be fair on apple when you type gcc you get c lang like they did something like that as well so yeah so to me it's like the fork was like heated drama but most of the development from libevi was merged back into ffmpeg right so de facto fmpeg got a superset around libevi and so that gave the user because in the end we work the user for the users a larger set of features and a ton of things that were um discussed for example the debate on reviews and on how we push are something that now is completely settled in FFmpeg and is following mostly what everyone in the community agrees, right?
2:43:48So the fact of everyone who was active on Libavy came back and worked on FFmpeg because the disagreements were fixed. And in the end, FFmpeg is stronger than it was before, right? And I know people love drama, but...
2:44:04Lex Fridman:Well, my main concern, I understand, and I think looking at the long history, it's all for the good. But I am concerned because there's so few humans that are critical to the success of open source projects that I have seen it 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's a moment that happens because like, what is the motivation of doing it? 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 has been a bit too much heat from the drama.
2:44:47Lex Fridman:So like at the project level, the project continues and often flourishes. But sometimes there's these individual humans. They're just like, I've had enough. Yeah, but it's not just about folks, right? What you are referring to is one of the most challenging and most interesting part of open source today is maintainers burnout, right? And AI is a problem because of that. And Daniel Steinberg, which is the maintainer of Curl, who's probably one of the best promoters 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 humbled to be on the same community as him.
2:45:32He's against what he called AI slop, right? Because it gives a ton of fake reports or bad reports, bad patches. And then a lot of maintainers have a lot of burden to maintain the software. and this is straining the um the the mind of open source developers much more than folks and for example the xz fiasco was because there was one guy maintaining it and he got basically hammered by two attackants who were asking him questions non-stop 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 attackant. So burnout in open source community is something that exists, but mostly it's about maintaining things, right?
2:46:24Lex Fridman:For sure. I wonder how we help that because those people are so important. The human beings are so important, the core of these projects. So for example, now I am maintaining a ton of multimedia and non-multimedia library as maintainer because the maintainers got fed up, right? Someone on VideoLand, some outside of VideoLand, because sometimes you need a tough skin, right? Because you get, like, it's not really attacks, but, oh, this is not working, this is not working. And you feel it personally. And this is also why resources or the Google fiasco was a problem, right? They don't realize that in the end you have, 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 internet.
2:47:13You see the one, right?
2:47:14Lex Fridman:Yeah, this is the meme. I mean, it applies to a lot of Microsoft projects, 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 a handful of folks that are maintaining that. 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... LibXML is... Yeah, LibXML, right? There was a big stop. No one is maintaining LibXML anymore, which is like the only library that is able to pass XML everywhere.
2:47:54All 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. I was like, yeah, but the body of knowledge to actually resolve that is massive. 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? 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 report and so on.
2:48:29Lex Fridman:Some of it is financial, but some of it, and people should definitely support open source financially all across the board. But some of it is also like spiritual on a basic human level. There's something that happens like with this image of 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. In the security community, they certainly did. That was one of the things I think that argument came out is there was a portion of the security community. No, these guys write crap code. They need to fix their crap code.
2:49:05I'm like, no, no, no, no. This is a guy's hobby project. You 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 99.99999 percentile he didn't think about because it's his hobby project decoding Star Wars games.
2:49:23Lex Fridman:Look at the hobby project aspect of it. It's just hard work, and it's beautiful. The right approach there is to celebrate people for doing incredible work. incredible work it's just incredible that humans step up sure not getting really paid 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 to give you an idea i received death threats on video land right and you mentioned that to me like what what is what is behind that so that must be what 2009 2010 right um uh apple is moving from power pc to core duos 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 power pc 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.
2:50:23So I received a death threat with some powder in it, right? Remember, there was some anthrax threats at that time, right? And it was because I had taken the decision to not maintain the power PC port anymore. And of course, it wasn't anthrax. Of course, it was some type of floor and so on. But I received that as a later of like, you're a piece of shit. You should die. Power PC forever and so on. And it was 2009 or 2010, right? I was young. I was just like, why? What did I do, right? Yeah, they can break your spirit. It's like, why? My mother freaked out, right? We had to go see the police and so on.
2:51:06And now, like, I'm going to say that I'm quite happy that this happened at that time. It fooled me a lot, right? I can take a lot of hate on me. I'm okay with it, right?
2:51:20Lex Fridman:It sucks that that's part of reality because all the people that love VLC, all the people that love FFMPEG, like me, you know, I legitimately, 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. And every once in a while I'm like messaging it. 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 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.
2:52:02And like, I take pictures and then I shared that to the signal, to IRC. Yes, we use IRC on -
2:52:10Lex Fridman:I saw as a quick tangent, you mentioned IRC is like Slack for old people. So you still use IRC? Of course. I have it on my phone as well. Of course. Every day. Works fine. Wow. It works fine. Works fine, yes. You have the power with the crank. No, but there's no ads. There's no ads. There's no tracking. There's nothing. The biggest issue, to be honest, compared to Slack, is that it doesn't have threads. That's annoying. It doesn't have emojis for reaction. Sometimes it would be nice. V3 has. Yes, V3, but no one does it. And you cannot edit your messages. Yeah. Right? And the rest, it works perfectly fine.
2:52:44How do you communicate without emojis? Well, that's why I said it's for old people. Old people. And we know emojis with, like, you know, the columns and that. Yeah, exactly. And parentheses, right? That's cool.
2:52:56Lex Fridman:So anyway, Agio Communica on IRC, what were you even talking about? Yeah, we were talking about death threats. But having people thanking you. And sometimes they got people who sent me a message and, oh, thank you for VLC. And I always answer because I want to validate the fact that you need to thank the open source community. Yeah, please, everybody listening to this, celebrate FFMPEX, celebrate VLC, celebrate all the incredible open source projects, Linux, everything. There's so many. There's so many. And you know what? I mean, even outside of open source, just celebrate companies that create software that you use a lot and love.
2:53:39Celebrate human endeavor. Celebrate the human effort to not just build something that's okay. Yeah. build something that is damn good yeah this is important right like because as we said right we work for technically we do something very complex for the normal people like we want our excellence in tech to be useful for everyone 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 uh because it's making everyone's life easier want to solve hard problems work on something interesting work on some interesting technical challenges we're engineers we love to build things right when i was young like very early i knew i wanted to be 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 and they need to be challenging right because you want your brain to turn on when the two of you
2:54:35Lex Fridman:first fall in love with programming with with building with engineering when is the first time you program kieran microsoft q basic as i was on windows 3.1 and windows 95 microsoft q basic wow what'd you build uh like a multiplication just counting loops like 10 20 30 40 nice uh then i thought i could do everything after that i wanted i jumped from doing that as i want to create a soccer no a football soccer video game and i drew all the i drew everything out like i want to do it and I didn't quite grasp that actually, I didn't grasp that actually it's a massive piece of work to jump from basic and drawings and pictures to a video game, but there we go.
2:55:12I think I did also basics and then Turbo Pascal when I was, yeah, end of elementary school. But mostly the first time I actually did some serious programming was the first year of, you call that middle school, when you're 11. I lived in Italy for a year in Florence and it was an amazing year. And the math teacher told us to work in a programming language called Logo where you had a turtle that was designing things on the screen and you would turn left and right. And in the end, we used that to do very complex programming because of course you could do things. And this changed. I knew I wanted to do things with computers and program.
2:56:04Lex Fridman:I don't think we quite talked about X264 properly. We talked about David. Can we return, backtrack a little bit to X264, this thing that powers basically all of the video on the internet? So can you tell me the story of X264? And Kieran, you're actually a contributor to X264. So X264 is a video encoder for the H264 video standards. 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 broadcasting and all sorts of other areas x264 was a big step change um because it kind of happened at the right time as well a lot of development took place when hd video was coming out intel core 2 and nihil mcpus were getting fast you could do real-time video but the most important thing was a key sort of focus on visual metrics so industry and academia for 20 years before was obsessed with 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 leads to blurring because you actually want to you want to minimize you want to add a little bit of error to everything to reduce the mean squared error as opposed to having a big error and that led to loads and loads of blurring so 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 and there's a big iterative feedback loop with the community they did some stuff differently um two two big things psycho visual rate distortion so using block energy trying to compensate for human perception when making decisions so the psycho visual distortion that's the critical 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 of compression make it all about being pleasing visually to the eye yeah yeah so compressing in a way that loses the least amount of information for the stuff that matters for us humans yes exactly as opposed to what industry some parts of industry are still obsessed by this which is mathematical numbers that don't look good in reality and then adaptive quantization was the other big one where it was biasing bits against complex areas 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 it's the running around in the park 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 so for people who are just listening we're looking at a bunch of humans running along a rivers 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 you could show clearly that encoders with high psnr will blur everything will blur everything and you could see actually i could turn on psycho visual stuff i could turn off adaptive quantization and it would just look so much better but your your metrics and these metrics are at the time what at the time were considered so holy yeah these are the holy metrics that are untouchable psnr is the most important thing can you speak to how do you measure psychovisual stuff like how do you turn how pleasing a compression is for a human eye into a number is that even possible that's what that's what netflix have been trying to do with v math they said they've used a machine learning model that's a more recent thing but back in when x06 was being developed that's by eye it was by eye it was developers on their laptops so it's not like even with big companies with professional screens or anything it's and that was actually one of the goals which was i don't the developers at the time lauren merit in particular is i don't want to test this on a 30 000 screen it's i want this to look good on someone's laptop at home yeah brilliant and there is another sample which is um a sample that is a planet earth killer sample that i absolutely love and you are going to see why I love this.
3:00:54It's a ton of birds, right, flying. And the more it goes, the more there are birds. And at the end, right, it's almost like you have millions of birds. It's the most complex thing ever to encode, right? Well, you're watching it on YouTube and you see how bad the YouTube encoding is actually, right? And this is phenomenal to optimize and get perfect quality in a constant bitrate. There was a lot of optimization, mostly by Loren also, on anime. For a long time, anime was very badly encoded because there was a ton of bending. And you see those issues, 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 hvc everyone compares to x264 one of my favorite films um cinema paradiso i know the engineer who created the blu-ray and he showed me the comparisons of x264 versus others and uh that'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 french box set with that's a 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 because they're in a big company that big company can buy whatever they want and they said 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 to this day i personally still try and avoid watching the most cinematic films on streaming services and buy the physical disks because they look they look good without even having to buy an expensive tv i think that's the key thing and x264 is yet another example of open source project it was started by laurent when he was at the ecole central paris where vlc was born and then you got a generation of people like loren like jason like mons like uh so many henrik and henrik and this is anton and this is where the assembly thing that we use now on FFM Peg David and so on was born, right?
3:03:06So X264 is like amazing project with people who were really all over the world. And I think most of them never met each other. But all of them, according to Kieran, are large percentage love anime.
3:03:17Lex Fridman:There's several things I've never got into, and one of them is anime. I watch anime so much. Especially at the time, it was like a lot of anime content doesn't exist commercially. We are before Crunchyroll, right? So what happens is usually people who love anime, who take some DVDs in Japan and rip them, because there is no commercial offering. And some of the people who are what we call fan subbers are basically translating themselves to make subtitles. Right. And at that time, 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.
3:04:03Right. Because they needed tools to encode, to do fan subbing. One of the most amazing open source projects for subtitles is called AEG Sub. and it's a subtitle, it's done for anime, for South Asian and Japanese languages. 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 because anime is not done in a normal fashion. Yeah, the way you produce it is not, you mostly produce it like on screens, right? Since a bit of time and you have all those gradients, right? In colors because they are very easy to produce digitally, very complex to produce in real life.
3:04:45And the subtitles also are very complex because you need to have often the Japanese and then you need to have the diacritics, right? What we call the Uribe, right? Which is the Hiragana and the Katakana for the Kanji. And then because, of course, so that you have the official subtitling, but you also need the English subtitles or the French subtitles because you want to learn that, right? And there is so many things crazy on subtitles and we had like crazy samples on subtitles that we've seen all around. So this is an important part of the culture, but also because there was no official offering.
3:05:22There was no way of doing that.
3:05:24Lex Fridman:Can you speak to the difference between H.264 and AV1 and then 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? Let's be honest, all of those codecs since MPEG-2 video are the same concepts. The same concept about inverse transform, about intra-prediction, motion compressing, entropy coding, all of them. However, each generation gives you a bump between 25 % and 50 % more compression for the same quality. and so you had the mpeg2 you had the divix area you have h264 which was like changing right h264 improved so much and then you had more right you had hvc you had vp9 at the same time of hvc vp9 is a bit similar to hvc in terms of quality compression but it's royalty free because in multimedia, there is a ton of patents and the licensing after H.264 became out of hand, right?
3:06:37And could cost hundreds of millions of dollars per year. So it made no sense. So Google did this VP9 and the Alliance for Open Media did this new codec called AV1. So you can imagine that AV1 saves between 40 and 60 % less bandwidth than H.264 for the same quality, visual quality. at a given bit rate at a given bit rate right so that's really like you increase the quality either you you set the bit rate and you increase the quality or you set the quality and you decrease your bit rate but because now you move from from sd to hd and hd to 4k and 4k to 4k hdr like you 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.
3:07:29It's more coding tools, more bigger blocks, lots more subpartitions in each block. It's just exponentially more complex. It's more complex because the encoder needs to search more possibilities, right? So for example, one of the things that is easy to understand is to predict a block, 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 and that would i could north north east northwest and and so on right but that's eight directions then you can do more direction you can do 16 or 69 or 128 right you can and every time your encoder is going to spend more time to see oh well these blocks is exactly this one 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 h264 in terms of cpu cycle right order of magnitudes right yeah and as we discussed cpus are not getting faster you're just throwing more cores at the problem but also it's a fact that you encode once and you have hundreds of millions of users, right?
3:08:43So 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 and CPU usage 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 batteries, better for your modem, etc., etc.
3:09:19Lex Fridman:So we can lay out, let's say, the top five codec container combos would be ASUS X4 inside MP4 containers, AV1 inside MP4 WebM containers, uh prores for non-linear editing uh inside mov containers so for people who don't know i guess prores is 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 there's no or very minimal uh temporal compression there's none There's non-inferrous. So you can cut, so you can do cuts. This is what we call intra-only codex, right?
3:10:07So I'm going to explain quickly what is IPB frames. Yes, please. So iframes, often keyframes, but is complete frames. It's like an image. It's a JPEG, right? You can start, you see everything, right? And then 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 5 and 7 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 the previous I frame, right? And then, of course, you have more complex ones, which are B frames, which are B predicted frames, which can depend on different type of frames, some in the past, some in the future.
3:11:02And so ProRes is an intra-only codec. For the people who can see, this is a very good one, right? So iframes are complete frames. P-frame basically depends only on iframe, and B-frames can depend on in-front.
3:11:17Lex Fridman:And this GOP group of pictures, I think the default for actually FFmpeg for H264 is like 250 frames, something like this. Yes. And to me, it's just magic. Like you can predict that you can have a complete frame every... Several seconds, that means. Several seconds. And then you can still, you can have this chain of predictions you make. And the fact that you can, the fact that somebody like me can use FFMPEG to compress something and not notice that the result still plays back smoothly it's like magic. You can even have and we use that in terms on Kyber is what we call intra-refresh where basically it's there is no iframes.
3:12:07You have one at the beginning you never send an iframe. How does that work? You build up an iframe gradually as the stream continues so you refresh certain parts of the image. But so you never have an iframe. This is intra-refresh that we use, right? For me the biggest mind-blown when I started was the B frames. B frames, means B predicted frames, can depend on frames that are coming in the future. That means that in order to decode this B frame, you need to wait for the next frame that is dependent. Buffer that, decode that one so that you can decode the B frame, right? So the way you decode the frame, the decoding order, is not the same as the display order 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 so this is like mind-blowing yeah the fact it works so smoothly every day is kind of miraculous in some ways it works so you can have a stream that works across the world on their decoder versus one in the u.s versus one here of different manufacturers and they produce bit for bit exactly the same material that's quite remarkable and do quite complex things and getting more and more complex and still be a bit exact there's a lot of work that goes into that there's a lot of knobs you
3:13:32Lex Fridman: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 can 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 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, RFCQ, QP. You can do the longer or shorter group of pictures, GOP, that we mentioned.
3:14:10Lex Fridman:I mean, all that kind of stuff. It's crazy. Number of B-frames. Yeah, what is crazy is that a ton of people's job is to optimize those parameters right 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 a 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 just to optimize all that 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 it does which is one way like broadcasting type thing it's also has to upload videos from all the places so they're also doing encoding at scale for videos they're going to be watched by like five people and it still has to deliver them like on a moment's notice no no delay nothing no late very minimal latency and and also serve it in all different resolutions like youtube is basically the web version of vlc well actually it's funny because like google video which was something they did before they acquired youtube was actually using the vlc plugin so that you could run vlc inside the web browser using the activix plugin and so it worked in internet explorer and you were actually running vlc inside your browser which is funny because today we have the opposite where we have VLC WebAssembly where we compile all VLC NFFMPEG to decode to run VLC inside the JavaScript virtual machine with WebAssembly.
3:16:16Lex Fridman:Okay, there's this legendary story that you pointed me to that it was discovered via WikiLeaks release of all seven documents. the CIA was using a modified version of VLC to basically try and trick people, what, to steal their data? Yes, exactly. So can you explain what the heck happened? So this was a surprise, right? Because at some point, WikiLeaks mentioned some documents. There were a few ones with something related to Blu-rays and VLC, but 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 where they had a specific plugin yeah exactly this is like we had to write a press release on that video land wrote a press release saying the only safe source for getting vlc media player is the official video website i mean i suppose that's a security vulnerability for basically any piece of open source software, somebody can trick you to download in a fake website or targeted advertisement, right?
3:17:27That 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, which was basically reading your document folder, encrypting that and 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 fans are going up and say, and there is a ton of TCP usage because you're using VLC, right?
3:18:04That's normal. But the thing is, what you don't see is that actually a powered version of VLC that is used by CIA. We had exactly the same problem with Chinese hackers that were targeting Indian people. And that got VLC banned from India until I had 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. And they used that DLL to do another program. So you had a VLC.exe and was calling LibVLC, but it was calling it into a fake one, and they used that to target. There is not much we can do, actually, to block those type of hacks.
3:18:52Lex Fridman: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. Yes, because that means that they were not downloading it from our website. Do the search engines help you? No, they don't. Just to clarify, because you can, you know, to prevent threats from people manipulating SEO to get up there on the links? Absolutely not, right? We have a big issue for like more than 10 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 analyze it.
3:19:33And 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 their website is in German and Google mentioned that before Videoland. And the weirdest thing is that it doesn't do anything on your machine for three weeks because that's how they do the detection. And after three weeks, there is a small program that is a service that's installed at the same time that wakes up after three weeks and 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 do that at some point.
3:20:11And 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? It's actually quite surprisingly effective.
3:20:24Lex Fridman: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 there is a security version of vlt right you received an email saying hey there is a security version update on vlt think about updating right now because it can hack your computer you come it's a website that looks decent and and you download it's a new version of vlt great you don't know a month later you're hacked you have no idea you're part of a botnet yeah so make make sure wherever you're downloading stuff it's legitimate part of the botnet uh speaking of which so uh you've mentioned that uh vlc sandbox is something you're working on and it's actually something quite challenging why is it important why is it hard so vlc is a core with around 500 plugins, right?
3:21:27One of them is FFmpeg, but we support so many other formats. We support 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? Mostly the hardware decoders, which are going to call your Intel, your NVIDIA, your IMD driver. And all 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're running VLC like every other program, like Adobe, right?
3:22:11You'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 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 ways 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.
3:22:52And when you crash, you launch something 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 applications are running 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 would have all the permissions, right? And so if you have a sandbox and you put some holes everywhere, it defeats a purpose, right? So what we are trying to do and we're actually doing is splitting VLC into several processes.
3:23:33One 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 tab, right? It crashes, 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 mem copies. Now, it's not a website which is 5 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 research topic that we are working on in order to have multimedia player that is secure.
3:24:16Lex Fridman:This is all the kind of stuff you have to think about when millions of people are using. You mentioned something somewhere where like 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. Best feature in VLC is called the puzzle filter, right? So you click the puzzle filter and it transforms your video into a jigsaw puzzle, right? And you can click and move the pieces, right? Yep. It's very, very useful when you're watching a French movie, right? You're bored because it's like very long things or a love triangle.
3:24:55We've seen that so many times. But you need to watch it because someone, your wife, told you to do that or your boyfriend told you to do that. So you're doing that, right? And you can click and move the pieces around. It's absolutely useless, right? Who cares about that? First, it was done by a math teacher in high school. in south of France, to teach his students about Bézier curves, which is something that everyone should know about, right? It's very useful. But the code was clean. So it got in VLC. It was merged in 2010. Five years later, I received an email saying, hello, JB, I have a problem with VLC.
3:25:33The puzzle is too simple. And I was just like, what? And yes, the puzzle was in the UI maximum by 16 by 16, right? Only 256 pieces. and he says, I'm sorry, but in a movie, I love puzzles. This is too simple, right? So there is a comment of me, you can check it online, which is JB changing that the dimensions are 256 by 256. 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? I saw that you can do ASCII. ASCII art. Is it useful? Very useful. Imagine you're debugging a multicast network, right? You have thousands, very complex networking stacks, right?
3:26:24You 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 it's all green or not all green, right? Amazing. So you can see. People don't realize there is so many things in VLC that are useful. and they have users because once you have hundreds of millions of users, you have people who use every feature.
3:26:52Lex Fridman:I would love to sort of zoom in and talk a little bit more about the distinction between kind of downloading a file and watching it offline versus streaming. So the complexities, the challenges of streaming. Is there something we could say about what it takes to stream files? Because we've been talking about codecs, and I think a lot of that implies encoding and decoding without having to communicate over the network. Sure, sure. So can you elaborate what's required to do over network stuff? Yeah, but it is less complex than it seems compared to everything that we've talked about, especially because the most complex thing is not about streaming in terms of streaming services, but it was what was done to actually broadcast through satellites.
3:27:48Because in most of the modern 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. When you go on a satellite, you have a specific size of the link, right? You cannot have a burst of bandwidth even for a second, right? Because you don't have the space for that in 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 late 90s and early 2000s about broadcasting and streaming through satellite.
3:28:30They're different. They're control systems challenges, whereas some are more mathematical. I think there's a difference. 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 has difficulty downloading things fast enough to play them. So what happens is that locally the player is going to read a lower resolution of it. But there are some very clever algorithms to do that, but most of it is quite basic, to be honest.
3:29:12Even on the buffering side, it's pretty basic. Yeah, you start to download a segment, what we call a segment, and then you time, right? And if it takes more than 50 % of the time to download the segment, you go down to, right? And the difficulty is more about when do you go up in bandwidth, in quality. But this is not very complex to do. When you encode, you're going to encode seven resolutions, right? And you're going to give the bitrate. The difficulty is to have your encoder give the same bitrate, but it's not as strict as it used to be.
3:29:47Lex Fridman:So 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 bit rate and uh how long should it wait before it increases the bit rate even though the connection is better because maybe the changes in the bit rate is what like affects you psychologically i think actually the interesting one is the audio that's true that you can kind of notice when they move from um full fat aac to the 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'm surprised people I know who are not video engineers how tolerant they are how tolerant they are to watching sports at 30 fps for example whereas it should really be 60 the world is a lot more tolerant to that but audio people are very there's it's an immediate feedback mechanism of if you hear a glitch you realize it directly yeah 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 people in general are able to kind of blur their consumption they can look past certain imperfections but then when you combine an event that is for example a sport event that is probably going through satellite or somewhere else and goes to a central place for encoding and then you need to encode this older resolution in real time you don't have time for QA you need to push that to cdns you need to add probably drm or protection you need to have that over a ton of different 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 television where you had like a defined set of box or cable box that that you know where you control end to end um so it's a challenge, but it's less.
3:32:08I think the networking part, while you agree to have 10, 20 seconds of latency, I don't think this is very difficult.
3:32:18Lex Fridman:Speaking of networking and latency, so your new effort, as we mentioned, is Kyber, which is aimed at ultra low latency. As you say, every millisecond counts and you're applying that to remote control machines like robots, drones, computers. Can you tell me about it? Sure. 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 can we go? And this question is very important because there are many use cases where you need to be fast.
3:33:04And it's when you have feedback interaction, right? We are not just listening to something. You're actually controlling it, right? And that's the biggest difference compared to what we've done so far is that I need video to have a feedback on something that is happening live. Whether it's a drone flying, whether it's controlling a humanoid robot from distance, whether it's controlling a rover, whether it's playing a video game in the cloud gaming, because this is what I did on a previous job, right? I was CTO of a cloud gaming startup. And this is a very interesting topic because you push to the limit the network.
3:33:45You need to care not about the quality like we've done on video and we've talked about with X264. You care about latency because a millisecond is meaningful when you're controlling a car, right? Well, you've seen, you've used Waymos, right? When Waymos don't work, and that happens even if 1 % of the time, there is someone that is basically remote controlling that. And this is exactly the stuff that we're building. It's really an SDK platform to do end-to-end control of machines.
3:34:23Lex Fridman:So this comes up quite a lot in a lot of different contexts in robotics. So obviously teleoperation, teleop is becoming more and more important, including for training robots via machine learning. Yes. And what we do is a bit different from everyone else. is that we take only one socket, one connection, which is a quick protocol based on UDP, 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 HTTP end-of-line problem. It's SIFR by default, but on the same wire, we send multiple streams, like multiple tracks. We send audio, we send video, but we also send the commands, right?
3:35:06Mouse, 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 and if you want to train correctly your robotic ai model you need to have all those that are in sync and currents and 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 Kiran knows 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 played back.
3:35:54And 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, 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 seven, it's more complex. So you want to make sure
3:36:14Lex Fridman:that the visual snapshot perfectly matches the time it actually happened. 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 so we have on 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 of Kyber to control robots. I also think like remote drones, remote, whether it's defense or non-defense, remote cars, remote submarines. There is many places in industry or remote surgery where the experts cannot go everywhere the machine is because it's dangerous or it's too costly, right?
3:37:01So you allow people to have machines next to you, right? The goal of Kyber is to make distance disappear because it's either projection of skills or projection of power, right? So imagine we are all like you've seen the meta Reba 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 that's on the cloud, on the phone to stream that. And so all of these use cases need 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 encoder frame in four milliseconds.
3:37:42And Kiran with his company also goes under those type of latency because you need to optimize at max the local latency, right? because it's a decoder, the encoder, and so on, because this time is going to be added to your networking time. And it's not just about low latency. It's also about reliability. We do clever things like forward error correction, right? So forward error correction is you over-transmit a bit of data, right, a few percent. And while over-transmit, you're allowed to lose some packets because all of that is very difficult over an internet network where you're going to do things very far away.
3:38:32And 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 reconstruct on the client side when there is things that are broken, right? And a few days, weeks ago, we were doing the demo around Las Vegas for the CES about, we had a rover that is fully 3D printed. It's very simple. It's a car, right? It's a small car with a telescopic arm. And it was actually controlled from France, right? And the video was with a webcam and a very small server, right? A small PCB was basically running and send that to someone that is on the other side of the planet.
3:39:18and 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 so sync everything together well but how like what
3:39:42Lex Fridman:What kind of latency can you get to? Like when you say milliseconds, what's the goal? So my goal is four milliseconds glass-to-glass latency. What's glass-to-glass mean? 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 done through the network. And you want, if you take a 1000 hertz camera, you can take a picture and you want that to be at four milliseconds. Four milliseconds means 240 hertz, right? Yes, nuts. So far, we achieve seven milliseconds from Windows to Windows or Windows to Mac.
3:40:27And if you look in the timing, most there is around 3.5 milliseconds inside the NVIDIA 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 or some better encoder that are faster. But four milliseconds would be the Graal. That's pretty nuts. I love it, though. I don't think anyone's ever achieved that, right? That's fast. You can achieve that with custom hardware, with SDI, with professional hardware. But I want that to work over the internet.
3:41:12I want that to work with any robots where you're going to have a small Jetson Nano in it or N-150, right? I want that because there is going to be millions of robots or drones are just rolling robots or flying robots 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 tele observe them right you need to check what's happening yeah and in my view in the future like all those remote cars will be tele observer observed by an ai model which is just going to say well everything is gone good and when it's not good say hey there is a problem and then you have an operator, right?
3:41:57And 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 driving, I want like the car to stop when it should stop. And if needed, someone takes care of that, right? And so there is so many cases, scenarios about real time. And so the goal of Khyber is to make real-time control of machine distance disappear it's it's incredible and some of the same
3:42:30Lex Fridman:technology some of the same ideas we've been talking about is is connected to what you're doing and for for me it's amazingly challenging right because i would say that on video i'm doing okay but networking i have so much more to learn right it's uh um about like congestion protocols bit rate adaptation in real time um but it's it's quite funny 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 so how do you make money it's a dual license commercial and agpl right you remember what you said 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 and the the very small guys who want to do that they can use the technology they build something that is open source and cool 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 like like the the rover we have is 3d printed um we are finishing a demo where it's an actual wing, right?
3:43:51Like a type of drone wings that is also fully 3D printed. We are trying to do a sailboat that is 3D printed and we'll work on some humanoid. 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.
3:44:09Lex Fridman:Cool. You're talking to the right guy. I love robots. There's a bunch of them upstairs. IntelliOp is going to be really, really important, especially as the number of robots goes across the world. 100%. Let's talk about the future of multimedia. FFMPEG, VLC, but 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? So AV1 is this codec that is done by the aliens for open media, right? Where there is Google, Netflix, Amazon, Apple, VideoLand, where we try to make a royalty-free, very good codec, right? And now it's being deployed.
3:44:53But actually, the codec was finished in 2018. But a codec takes years to be used in wide scenarios, right? So AV2 is the next generation of this codec. It's 30 % better, right? So if you keep the same quality, you get 30 % bandwidth reduction compared to AV1.
3:45:16Lex Fridman:What's the connection with the DAVID and AV2? We are going to do a DAVID2, right? That I call DEVID because DE is 2 in French. Ah, well done. And you have to know that DAVID is an actual, what we call a recursive acronym, right? Because it means D, DAVID, is an AV1 decoder, right? Oh, nice. Nice. I didn't even think of that. And people should know that David spelled with a one. Yes. And so David 2. It's going to be spelled with a two. It's going to be D-A-V-2-D. Sorry, I don't know how you pronounce that. And again, we did a demo at the CES of VLC running the first demo of AV2. So can you clarify to me the specification of AV2 and then the encoding and the decoding?
3:46:05Sure. So the specification is like the document who explains how the codec is supposed to work, right? And that's really AV2. That is AV2, like H264, 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 X264 is an encoder to H264. The same way that X265 is an encoder for the H265 codec. And the decoders for AV1 is David. The decoder for AV2 is David2. The decoder for H264 is FFH264 inside FFmpeg. The decoder for HEVC is FF-HEVC inside FF-MPEG. And there is a next generation codec from the MPEG world after H.264, H.265.
3:47:06There is one that is called H.266, also known as VVC.
3:47:11Lex Fridman:So HEVC is H.265. VVC is H.266. Why is H.266 super sexy so much better? So the question often we have is why are they two names? Because most of the time, it is a conjunct work from the ISO world and the ITU, which is the International Telecommunication Union. These are these two regulatory bodies. One is a private entity and one is the United Nations. Which one is the private? ISO is private. In theory, H.264 is MPEG-4 part 10 H.264 slash AVC. And this is the full name. Nice. So it's the concatenation of the ISO name and the ITU name. Yeah. Even though they work together. This is politics, historical, you know.
3:48:06And for HEVC, it's MPEG-H H.265 HEVC. Got it. And there is H.266, which is also named VVC. Is there a high-level thing to say about the improvement? 30 % each generation is the best summary. This is true both for the AV codex and the H.264, 5, 6. So the professionals who are listening to us are going to kill us because they say, no, it's 35%, 25%, 50%, blah, blah, blah. But globally, you need to know that H.E.V.C. is 30 % better than H.264. H.264, H.264 is 30 % better than H.265 because there is so many cases and so many scenarios. For example, there are cases, especially for screen recording, where the gains are humongous because you have the right tool that is done for that.
3:48:56And so for a specific video, a new generation is going to give you 70 % gain or 80 % gain. 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. And I guess the major difference would be the cost of encoding. Yes, and the royalty of the patents. And this is the reasons why you see the AV version of Codex is because 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.
3:49:40There is two places where you have the most patents. It's everything related to 3G, 4G, 5G, RF, and multimedia because it's very mathematical and you can get great gains and so on. So Google and Meta and Netflix wanted something where it was royalty-free. There are people who say that they have patents outside, but they are fringe patents, right? So it's mostly true that it's patent-free. We should extend patent checking was done as part of the standardization process in AV1, AV2, whereas patents are not even discussed in the MPEG world. Patents are off-topic completely. Can you educate me at the patents side?
3:50:23So usually, so MPEG does a format, right? And then there is, everyone comes around and says, well, I have all those patents or formats, and they do usually a union called, what's called MPEG LA, MPEG Licensing Association. And you put all your patents in and then you ask everyone who's using this format to pay for it. Wait, can you elaborate?
3:50:45Lex Fridman:What does it mean to have a patent of a codec? Why is there many patents? Imagine I'm doing something where I'm going to, instead of doing blocks, which are square, I'm going to do rectangles, right? Oh, so every idea. Yes. Somebody patents it. Yes. oh man yes oh man people and there's how many lawyers are i mean it pays for a lot of lawyers right like the biggest issue is not the following right because at time of h264 the patents were let's call it like sane but there was there was so much money in that that for htvc 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 just one could add a patent on it.
3:51:35And so it became that for HCVC licensing, there was MPEG LA plus another patent pool called HCVC Advance, plus I think Nokia was outside of the patent pool. Yeah, a few of them are outside and some other one. 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 HCVC in their Windows laptops because the cost was increasing of those patents. And it arrived at 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.
3:52:17And they said, you know what? As 100 millions 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 created AV1 and created AV2. 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 back to 30 years ago are, of course, out of patents. So, for example, there is things like a golden frame, a S frame, or different type.
3:52:59These are all patented ideas. No, I can't believe it's not butter. I can't believe it's not a B frame. I mean, it's kind of what it is. In some ways, it's like a... Oh, so it's a different variant of a B frame. Yeah, to try and sidestep things like that. And so you need to have double creativity, right? Creativity in terms of being more efficient, but creativity of being sure that you don't infringe existing patents. And so, for example, VVC has all the patents of HEVC plus new ones, right? It's why AV2 tries to be as royalty-free as possible. To what degree does FFMPEG and VLC have to think about this kind of stuff?
3:53:37We don't. And one of the reasons why VLC was in France is that France rejects software patents. So most of those patents are, are illegal in France. Because I once made the calculus that if I had to pay all the licensing fee for VLC, I needed to pay more than 200 euros per user, right? It's the same in dollars. 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.
3:54:12Lex Fridman: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 have friends in europe uh the 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 in the future of europe Is Europe over from a tech perspective? Just look at the two of us, right? 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 is weighted heavily.
3:54:55What you probably don't see yet is that there is a new generation of entrepreneurs in Europe and mostly in France. UK has done it since a long time because well it's more it's more Anglo-Saxon type of business look at business but especially like what happened in France and of course sometimes a bit overdone with everything called French tech but today most of the people who come on the market wants to create startups 15 years ago it wasn't the case everyone wanted to work on big companies because when you failed in France, for example, 20 years ago, 15 years ago, and you destroy your company, which is normal for startup, right?
3:55:38You were not allowed to create a new company, right? There was a lot of stigma. This stigma is gone. There is so many things happening on AI in France and so on, right? So there is, sure, overregulations. I know that, right? I'm an entrepreneur. But it has some good things also.
3:55:58Lex Fridman:I mean, is there some paralyzing aspects? If I look at the case of somebody I've become close with, Paul Durov, he was blamed directly by the French government for the kind of things his, quote, platform was hosting. 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. That's right, right? it like we had we like we we had issues like we like i mean 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 you don't think about it and that's that's okay right like but what if they come in when they show up and there is no office video land doesn't have office i mean this is what's happened with paul they arrested him right so arrested him for particular videos or or a particular content that's being shared on the platform sure i don't have any platform everything is on the client side.
3:56:58Yeah, but they can still arrest you. On what ground? I'm not sharing anything. I'm not, the content doesn't go through my stuff. For sure, but it's still lawyer fees. That's the problem.
3:57:08Lex Fridman:Yes, that's correct. It's paperwork. So like, actually, if you had infinite trillions of dollars, you would win easily because you're on the right side. But the thing is, there is a degree to which they suffocate you with paperwork. That's the downside of bureaucracy. through paperwork, through process. Yes. You know, it's the Kafkaesque thing. You have to realize that one of the good things, for example, in France or most of Europe is that the... And answering to a court order does not make you bankrupt, right? It's not like in the U.S. where it can actually bankrupt you, right? The way the law system works is that I receive lawyers letters every week, right?
3:57:56And I can tell you that the cost of lawyer fees for video line is less than$10 ,000 per year, right? So that's not really scary.
3:58:06Lex Fridman:I mean, similar with Pavel, the intelligence agencies tried to like say, can you put a backdoor on VLC? Yes, two of them. What do you say? No. I was a lot less polite. I see you're, yeah, yeah. You're basically saying hell no. Like if we had to compromise our software, we would shut it down. This is clear. And what's the definition of compromise? Like allowing a government to do a backdoor. 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.
3:58:48We do everything offline on places that have never been connected to the Internet. The way we do signing, there is double signature, especially because, for example, we've seen and we believe it's a it's a governmental agency that is not from the western world to try to push a fake binary into our own servers and that scared us a lot and video land is open source how can you kill it like i moved to where right i moved to malta i moved to uh i don't know cayman islands and i changed 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.
3:59:32We are not a platform. 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.
3:59:44Lex Fridman:Does VLC ever like censor the kind of videos it can play and not based on the content of the video? No, never. We never do that. Because like 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. So again, there's no government that can say, you know, like the French government come in and say, we don't want, I think anime is destructive to society. We don't want any anime, not a lot of people. No, 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.
4:00:24So no on that too. So for surveillance, no. No, no, because the only infrastructure we have is a downloading infrastructure. There is no telemetry in VLC. It would be difficult because 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 somewhere in the US as part of video and who'd be able to see that. It would be extremely difficult. The only thing that we can do which happened is like we had the issue. We had the case with some police in the U.S. who said we have a murder case. Right. And the file is destructed or doesn't play in that version of VLC.
4:00:58Could you help us? Right. We never have access to the video. It's like a normal support. Right. Oh, it's really about playing the file. Yes. And like I remember in the middle of the Afghan war. Right. I received an email from someone in the army. 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 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?
4:01:35And 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 is allowed on the U.S. Army laptops, right? Because I guess someone in the U.S. military actually looked at it and said, well, okay, this is okay, right? And the way we document how we process, that was okay, right? So the only way we work with authorities is to help them doing support.
4:02:06Lex Fridman:That's amazing. That's really, that's an amazing story, yeah. We don't see anything happening on how people use VLC. and this is strong. 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. Does that, that's a small team, right? Yeah. How big is VLC, like the core, contribute? How many? Six, eight. And everything legally is only me. Everything that is legal is only me. you're not stressed about this I used to stress about that a lot but the thing is we're doing what we can for everyone for the greater good we work that we make some extremely complex technology easy for everyone we're a tool and every tool is going to be used for great things and for bad things right you cannot blame a tool I think and this is like very important for us I used to be a lot in a lot of stress.
4:03:12I'm not anymore, right?
4:03:13Lex Fridman:What's the secret to your zen? I mean, over and over, in the chats I've had with you in the conversation today about every even tense topic, you're very zen. What's the source of zen? I have a way of thinking about what is the worst case scenario, always. And the answer is, at the end, if I take like a chess player right in the end am i dead yes or no right and and i do that non-stop right and that's also how i do my my startups right is that i'm here to get something great what is the worst case it got bankrupt that's life a company lives a company dies that's okay right like and so my moral way is always like am i dying in the end am i hurting someone if i'm this answer is no then too bad right like oh some lawyers are not going to be unhappy what are they going to do take all the money off video land wow they're going to have 50 grand amazing right what are they going to do is that the cuts the source code is out there it's not stoppable also because what we do is good and it's done for everyone that's beautiful uh karen you you said that there's an active archiving preservation community.
4:04:33Lex Fridman:I think that's super fascinating. You wrote that there's stretch 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. Yes, it's one of the coolest communities in open source multimedia, mainly led by someone called Dave Rice. I'll give him a shout out. I think from City University of New York is the archiving community. They've done so much stuff that they value open source. One, because yes, they lack budgets, but two, they see the fact that archiving video is important for the world.
4:05:17But being able to play that is a big problem. Famously in the UK, there was something called the New Doomsday Book and they archived lots of stuff on BBC microcomputers. within 10 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 20 years imagine that in a thousand years i think one of the great things about ffmpeg is it's written in c c is the closest to mathematics you're probably going to get the closest to logic you think in 1000 years we'd still have c compilers 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 again limited funds they funded the development of the ffv1 codec so that's a lossless codec so for so that 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 yeah 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 compressed 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 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 something like that so they're a really great bunch of people they funded gpu encoding in ffmpeg to make ffe1 encode faster and it's really about preserving the world's multimedia heritage in a way that's usable and there's a lot of great teams and a lot of archival groups across the world who've chosen FFmpeg and FFV1 as their archiving solution.
4:07:16And they can really provide us also super specialist advice. They can explain, ah, in the 1950s, colorimetry was done like this on this certain type of tape. And so there is this special case that you need to handle and you'll never get this anywhere else. They know things on video that we don't. like every time I talk to Dave Rice or the people from the British film it's just like every time I just learn something new and I've been doing video for 20 years they have especially on colorimetry and colors storage these other things I mean they have a deep
4:07:54Lex Fridman:deep appreciation of the content itself of the video itself and like especially when you're thinking lossless they're terrified of losing something essential about the thing and in so doing they're deeply understanding the thing that is 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 and when you enter the habit hole of film scanners right so you take those those things to make to digital life it's like a huge topic that like would take another five hours of podcast just on that topic 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 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 going to tell a lot you know in a thousand years we may be drowning in ai slot this stuff needs to be important and you know archived well what was what was life like yeah it feels like capturing the 20th century in the 21st century is essential because it feels like a transition point where we went from scarcity of data to slop oceans of slop and that transition point is good to archive 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 and tape 70s and 80s there's tape and there's not enough tape heads in the world to read all the types so they have to decide what they want to archive and throw away the rest of the tapes 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 but and there's digital stewardship i suppose for want to i've made that phrase up that's not a real phrase um to make sure the world can have this information in something that's playable by everybody not playable on some device that doesn't exist anymore and then there's like realistically speaking there's a needle in a haystack where there's a lot of value in in archiving all that footage and then over time finding the gems that we don't know are there hey there was something in that corner that we just didn't yeah and now that would have been compressed away because some little thing oh wow there's something there and that's they've made sure that it's lossless.
4:10:48They can prove mathematically that it's lossless. They can run different trade-offs for if there's bitfropped. They lose a bit, a single bit flips. I can make sure that I only lose a portion of a given frame. They can do error recovery on previous frames. They could do all sorts of different things.
4:11:05Lex Fridman:Do you think VLC and FFmpeg will be here 100 years from now? FFmpeg, yes. VLC, maybe. be. What's the future of where is FFMPEG going? Where is VLC going? Like in the next, if you think about like 5 years, 10 years, 20 years 5 years, 10 years is easy. The question is after that, right? The question is do we arrive at something called holograms, right? Yeah, so will VLC and FFMPEG expand to whatever multimedia? So multimedia might become, sorry for the pothead expansion of topic but you know if you look at something like neural link 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 that's one and virtual reality of course you will have vlc for neural link and you'll have ffmpeg dash I input format human brain.
4:12:11Lex Fridman:There's going to be codecs for the brain. Yes. 100%. Of course. I mean, today there is like, there are new codecs for, for example, what we call point cloud, right? Or volumetric videos, right? There is a ton of research on what we call RGBD, right? It's a codecs for depths that is useful for robotics and for 3D things. There is a ton of codecs for compression of 3D elements. Compression for astronomy. 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 do streaming of XR content for the glasses who cannot have enough power or inside the Apple Vision or the Quest.
4:12:52So we already work on 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 VLT and FFmpeg, right? It's obvious. So that's where it is moving. Like the community is open. Not everyone in the community sees that, but like as Kiran and I, we are entrepreneurs. We know where it's going. We see that, right?
4:13:22Lex Fridman:So 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. In order to answer that question, we need to answer the definition of what is multimedia. Yeah. 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 and a diffuser of odors. it will get into FFM page. So your D-Muxer is getting new. Yes, of course. Your D-Muxer has a new track type that is basically others, right?
4:14:14And you already have... Smell, touch. It's like audio. You love a left and right nose track. You have a left and right audio pair. It's easy. Yes, of course. Stereo smell. Stereo smell, yeah. So in VLC, for example, we already have a plugin for haptic. It's mostly for what we call 4D cinemas, right? You know, those ones on hydraulic... I don't know how you say that. Hydraulic arms. And where everything is moving, like you have in theme parks, right? And there is a data feed synchronized, which is basically transporting this information. Is there yet a standard for that? There are many standards, right?
4:14:49You make me so happy. And so, of course, like we have a plugin, which is not in the normal version of VLC, that is basically transporting those type of movements, which is physical movements, which is haptic movements, right? it is a human sense so it will get in 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
4:15:17Lex Fridman:it feels stressful like it's just looking on twitter it's like it's a huge amount of work to make it work on all these different operating systems an incredible effort 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?
4:16:07Now we're doing things in VLC, which is a spatial audio, right? We did the demo 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 is going to be the same for orders or haptic, right? We need to work with the architecture so that's modules can be added to add future capabilities so yes we are going we are multimedia frameworks so that's not just audio and video it's everything that is timed and represents something that you can sense and if it's brainwaves it's going to be brainwaves i think that's inevitable sorry i love this on so many fronts because so ffmpeg VLC are pushing companies and pushing the world to standardize.
4:17:01Lex Fridman:So for example, to standardize brainwaves, so standardize, it would push, like I hope Neolink comes up with a standard for
4:17:12Lex Fridman:multimedia via brain-computer interfaces, or for robots with haptic. 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 say well you know what 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 paper and then the leaders kind of pressured into it because it's better to do a standard example 3d audio right yeah six or seven years ago it was everything about 3d you had the cardboard on android 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 and not try to avoid closed i i saw somewhere you didn't have too many nice things to say about Dolby.
4:18:16Lex Fridman:No, I don't. Can you educate me on why, where they went, what they do bad that made you mad? It used to be an amazing company doing tons of great things with amazing engineers. They define what sound was. And now it's mostly lawyers and licensing things. Oh, so they're, yeah, they're closing stuff off. they're trying to get money on the license. It's just like they don't innovate as much as they did and so on. It's a bit like, I'm sorry to say, right? Like HP, right? Not true. Oh, since we talked about Twitter in a bunch of different contexts, do you have a favorite and least favorite, most embarrassing tweet on either video land or FFMPEG Twitters?
4:19:06My two favorites are TalkisCheapSendPatches. I think that embodies a lot of the stuff doesn't get, as we've talked about, stuff doesn't get built unless someone does it. It doesn't just appear from the ether. The other one that I like is FFMPEG. Nothing is beyond our reach. I think that comes from a U.S. military satellite patch where I think they invented some kind of monitoring system. They could see the whole world and this was released. Wasn't there something where FFMPEG was running on a rover on Mars? Yeah, so FFmpeg is used by the Mars rover, the Mars 2020 rover, to compress pictures. They really wanted, they wrote a paper about it, and they really wanted to use as much commercial off-the-shelf technology as possible.
4:19:47FFmpeg runs on Mars, so we are a multi-planetary open source library. Nice. Very often we've seen tweets for people using VLT in weird places. a lot of the people doing formula ones are in all the paddocks they use vlc to play the live feed we've seen the european space agency we've seen space six like monitoring the launches with with vlc and like it's like fills you with joy right so i've seen a particle accelerator oh yeah yeah we had one of the most amazing thing that i went for was to go to the cern at the lhc because they They were using VLC to monitor all the captors on the ring because the ring is 27 kilometers.
4:20:36And so they had some analog cameras 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. and like I visited that in 2010 with Laurent and like we fixed that issue in an hour or something like that, right? Because with some parameters, 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 were always antimatter and colliders and so on. And that was like one of the most amazing day of my physique background. Yeah, it's used like everywhere.
4:21:22Lex Fridman:Any tweets carrying your regret? Any tweets of regret? Or is it like that? How's the French song go? Regret nothing? Je ne me regret rien. Yes, 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. Because you've done it. So except if you have a time machine to go back in time, don't regret it. It's going to just tax your brain. Learn from your mistake. Sure. Don't regret it. 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.
4:22:05Lex Fridman:Hate is a very expensive emotion. Are you comparing me to Johnny Depp? Because that would be your first one. Well, gentlemen, like I said, I'm internally grateful for the software that 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 talk with me today and give me this sexy hat. I feel like a wizard. I feel special. 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.
4:22:49Lex Fridman:Thank you for having me. Thank you so much. Thanks for listening to this conversation with John Baptiste Kempf and Kieran Cunha. 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 edulation by the public, but because it is fun to program. Thank you for listening, and I hope to see you next time.
4:23:40Thank you.
From the publisher
Jean-Baptiste Kempf is lead developer of VLC and president of VideoLAN. Kieran Kunhya is a longtime FFmpeg contributor, codec engineer, and the person behind the now-infamous FFmpeg account on X.
Thank you for listening ❤ Check out our sponsors: https://lexfridman.com/sponsors/ep496-sc
See below for timestamps, transcript, and to give feedback, submit questions, contact Lex, etc.
Transcript:
https://lexfridman.com/ffmpeg-transcript
CONTACT LEX:
Feedback – give feedback to Lex: https://lexfridman.com/survey
AMA – submit questions, videos or call-in: https://lexfridman.com/ama
Hiring – join our team: https://lexfridman.com/hiring
Other – other ways to get in touch: https://lexfridman.com/contact
EPISODE LINKS:
FFmpeg on X: https://x.com/FFmpeg
FFmpeg: https://ffmpeg.org/
VideoLAN (VLC): https://www.videolan.org/
VideoLAN on X: https://x.com/videolan
Jean-Baptiste’s Website: https://jbkempf.com/
Jean-Baptiste’s LinkedIn: https://www.linkedin.com/in/jbkempf/
Jean-Baptiste’s GitHub: https://github.com/jbkempf
Kieran’s X: https://x.com/kierank_
Kieran’s LinkedIn: https://bit.ly/3OORhmC
Kieran’s GitHub: https://github.com/kierank
SPONSORS:
To support this podcast, check out our sponsors & get discounts:
Larridin: Measure AI adoption in your business.
Go to https://larridin.com
Blitzy: AI agent for large enterprise codebases.
Go to https://blitzy.com/lex
BetterHelp: Online therapy and counseling.
Go to https://betterhelp.com/lex
Fin: AI agent for customer service.
Go to https://fin.ai/lex
LMNT: Zero-sugar electrolyte drink mix.
Go to https://drinkLMNT.com/lex
Perplexity: AI-powered answer engine.
Go to https://perplexity.ai/
OUTLINE:
(00:00) – Introduction
(03:00) – Sponsors, Comments, and Reflections
(10:48) – Weirdest things VLC opens
(15:12) – How video playback works
(24:33) – Video codecs and containers
(35:20) – FFmpeg explained
(56:20) – Linus Torvalds
(1:00:59) – Turning down millions to keep VLC ad-free
(1:15:17) – FFmpeg & Google drama
(1:34:31) – FFmpeg developers
(1:41:08) – VLC and FFmpeg
(1:45:42) – History of FFmpeg
(1:48:59) – Reverse engineering codecs
(2:02:14) – FFmpeg testing
(2:06:21) – Assembly code (handwritten)
(2:30:39) – Rust programming language
(2:39:55) – FFmpeg and Libav fork
(2:48:17) – Open source burnout
(2:56:04) – x264 and internet video
(3:09:20) – Video compression basics
(3:16:17) – CIA and fake VLC
(3:26:52) – Ultra low latency streaming
(3:44:20) – AV2 codec and video patents
(3:54:12) – VLC backdoors
(4:04:27) – Video archiving
(4:11:04) – Future of FFmpeg and VLC
