Back to PodcastsLex Fridman
- The important is, is your code good?
——最重要的是,你的代码写得好吗?
We care about excellent code.
我们在乎代码的质量。
We don't care who you are.
我们不在乎你是谁。
Like maybe you're a dog.
哪怕你是一条狗,
I don't care, right?
我也不在乎,对吧?
I don't care where you come from.
我不在乎你来自哪里。
I need to look at your code.
我要看的是你的代码。
Oh, yeah, but I'm an engineer at this very large company in Italy, in Germany, in the US.
哦,对,但我是意大利、德国或美国某大公司的工程师。
We don't care.
我们不在乎这些。
We care about the quality of your code because this is what defines our community and which means that we have a lot of people who contribute who are some very different backgrounds and very introverted.
我们在乎代码的质量,因为这定义了我们的社区——也正因如此,我们有来自各种背景、非常内向的贡献者。
Sure.
当然。
But that's okay, right? -
但那又怎样,对吧?——
FFmpeg is probably one of the biggest CPU users in the world.
FFmpeg 大概是全球最大的 CPU 消耗者之一。
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.
所以其复杂程度在很多情况下都难以估量。
-
——
FFmpeg has one hundred thousand lines of assembly for all the codecs. -
FFmpeg 为所有编解码器写了十万行汇编代码。——
For all codecs.
所有编解码器都有。
Mm-hmm. -
嗯哼。——
And just this one has two hundred and forty thousand.
而这一个就有二十四万行。
Every cycle matters.
每个 CPU 周期都很宝贵。
We are talking about probably three billion devices which are going to decode video nonstop because, for example, thirty percent of the video from Netflix is now in AV1, fifty percent of YouTube. -
我们说的是大约三十亿台设备会不间断地解码视频——比如,Netflix 现在有三十%的视频是 AV1,YouTube 有五十%。——
This is what peak video codecs should look like.
这就是视频编解码器的巅峰形态。
Seventy-nine point nine percent assembly, nineteen point six percent C, and zero point five percent other. -
79.9% 汇编,19.6% C,0.5% 其他。——
And what's incredible is with those tweets, which is factual, people get crazy. -
神奇的是,这些推文内容都是事实,但人们就是会抓狂。——
For the last two years, they go crazy.
过去两年里,他们一直在抓狂。
No, intrinsics is fine.
不,intrinsics 是可以的。
The compiler- -
是编译器——
You can optimize your compiler.
你可以优化你的编译器。
Auto-vectorization, it's your fault.
自动向量化?那是你的问题。
You don't understand.
你根本不理解。
And we've tried that forever, right? -
这条路我们走了很久了,对吧?——
For two years, and two years later, showing hundreds of examples of handwritten assembly.
走了两年,然后拿出几百个手写汇编的例子来说明。
No, no, no, you're doing it wrong.
不不不,你的写法是错的。
The compiler can do this.
编译器可以做到这一点。
The intelligence agencies tried to, like, say, "Can you put a backdoor in VLC?" -
情报机构曾试图说:「你能在 VLC 里留个后门吗?」——
Yes.
是的。
Two of them. -
有两家。——
Well, what did you say? -
你怎么说的?——
No.
不行。
Well, I was a lot less polite. -
嗯,我当时说得没那么客气。——
Basically saying, "Hell no." -
基本上就是——「门都没有。」——
Like, if we had to compromise our software, we would shut it down.
就是说,如果我们必须在软件里留后门,我们宁可关掉它。
This is clear.
这是明确的。
- Any tweets
——有那个推文——
Kieran, you regret? -
Kieran,你后悔吗?——
Tweets
推文——
I regret? -
我后悔?——
Or is it like that, how does the French song go?
还是就像那首法国歌——
Regret nothing. - Don't regret anything.
什么都不后悔。——什么都不后悔。
No, it's because regrets are attacks on your mind. -
不,因为后悔是对心智的侵蚀。——
The following is a conversation all about FFmpeg and VLC with Jean-Baptiste Kempf and Kieran Kunhya.
接下来是关于 FFmpeg 和 VLC 的对话,嘉宾是 Jean-Baptiste Kempf 和 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.
FFmpeg 是一个开源软件系统,是 YouTube、Netflix、Chrome、VLC、Discord 以及几乎所有触及互联网视频音频的平台背后的隐形基础设施。
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.
VLC 也是一款传奇软件。
It is an open source media player that plays basically anything you throw at it, any format, any platform, no ads, no tracking.
它是一款开源媒体播放器,能播放你扔给它的几乎任何格式,任何平台,无广告,无追踪。
It has been downloaded over six billion times, and again, for me, it has been one of my favorite pieces of software ever, with the most legendary logo, which I, of course, had to honor in this conversation by wearing the VLC traffic cone hat the whole time.
它已被下载超过六十亿次,对我来说,它是有史以来最喜爱的软件之一,配有最具传奇色彩的标志——我当然要在这次对话中全程戴着 VLC 交通锥帽来致敬它。
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.
本期节目的两位嘉宾都是了不起的工程师和人:Jean-Baptiste 是 VideoLAN 的主席,是 VLC 和 FFmpeg 背后的核心人物。
Kieran is a longtime codec engineer, FFmpeg contributor, and the man behind the now infamous FFmpeg account on Twitter/X that I recommend everybody follow for the memes and for the unapologetic celebration of open source and great low-level software engineering.
Kieran 是资深编解码器工程师、FFmpeg 贡献者,也是如今声名大噪的 FFmpeg Twitter/X 账号背后的人——我强烈建议大家关注,不论是为了梗,还是为了那种对开源和底层软件工程毫无保留的热爱。
Let me also say that it's inspiring and humbling that so much of modern civilization rests on software built by people who are not chasing fame or money, but are obsessed with the craft of engineering.
我还想说,如此多的现代文明建立在那些不追名逐利、只痴迷于工程技艺的人所写的软件上,这让我既感到振奋,又深感敬畏。
We live in a world where billions of people consume video every day without ever thinking about the invisible machinery underneath it.
我们生活在一个每天有数十亿人消费视频的世界里,却从未想过其背后那套隐形机器。
But that machinery matters.
但那套机器很重要。
Open source infrastructure matters.
开源基础设施很重要。
It is one of the great examples of human beings quietly collaborating across borders to build something useful, durable, and elegant for the rest of us.
它是人类跨越国界默默协作、为其余人建造出有用、持久而优雅之物的伟大典范之一。
And so this conversation is not just about codecs and media pipelines.
所以这次对话不只是关于编解码器和媒体管道。
It is also about the deeper spirit of engineering and generosity that makes projects like FFmpeg possible.
它也关乎那种让 FFmpeg 这样的项目得以存在的更深层的工程精神与慷慨。
Again, I can never say it enough.
再说一遍,怎么说都说不够。
Thank you.
谢谢。
This is the Lex Fridman Podcast.
这是 Lex Fridman Podcast。
To support it, please check out our sponsors in the description, where you can also find links to contact me, ask questions, give feedback, and so on.
欢迎收听,请查看描述中的赞助商,也可以在那里找到联系我、提问、给我反馈的方式。
And now, dear friends, here's Jean-Baptiste Kempf and Kieran Kunhya.
好了,亲爱的朋友们,有请 Jean-Baptiste Kempf 和 Kieran Kunhya。
So the legend goes VLC can open everything.
传说 VLC 什么都能打开。
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?
你知道吗,有很多人在用 VLC 来录制 VHS 录像,对吧?
Like, it's just like you plug it with a capture card and you can basically record VHS video.
就是接一块采集卡,然后基本上就能录 VHS 视频。
- Well, how does that work? - Basically, it's, you know, those type of capture card where you can put a Peritel in or- ... or RCA, and you put that, and actually VLC can play those type of cards, and there is a module which allows to control directly some of those VCR camcorders.
——那是怎么工作的?——基本上就是那种可以插 Peritel 接口——或者 RCA 的采集卡,你插进去,VLC 就能播放那些设备,还有一个模块可以直接控制某些 VCR 摄像机。
We support DVD audios lately, right?
我们最近还支持了 DVD 音频,对吧?
We spent the summer working on DVD-Audio support, and like there is no, no one's making any DVD audio support.
我们花了整个夏天开发 DVD-Audio 支持,而且几乎没有人在做 DVD 音频支持了。
There is a custom encryption schemes. - What about Lucasfilm? -
里面有自定义加密方案。——那 Lucasfilm 呢?——
Oh, yeah, and there is of course all the weird codecs support, game codecs supported by FFmpeg.
哦,对,FFmpeg 当然还支持各种稀奇古怪的编解码器,包括游戏编解码器。
There is of course all the weird codecs support, game codecs supported by FFmpeg. - The one Star Wars video game, the first ten- second opening sequence, someone has gone and implemented that and made sure that's bit exact on one disc that existed at one time of one little sequence in the game.
当然还有 FFmpeg 支持的各种稀奇古怪的编解码器,以及游戏编解码器。——那个《星球大战》视频游戏,开头十秒的片头动画,有人专门去实现了,而且确保在某张特定光盘的某个特定片段上做到了完全还原。
And then funnily, there was a...
还有个有趣的事……
At one VideoLAN conference, we made a competition to make the weirdest and most horrible file ever ... and see if VLC could play it. - What did it end up being?
在一次 VideoLAN 大会上,我们搞了个比赛,看谁能做出最奇怪、最离谱的文件……然后看 VLC 能不能播放。——最后是什么?
What's the file? - It was an MKV file made by Derek- ... which each of the frame was changing resolution, aspect ratio- ... rotation and it was like- -
文件是什么?——是 Derek 做的一个 MKV 文件……每一帧都在改变分辨率、宽高比……旋转,就像——
Did it work? -
能播吗?——
Yes.
能。
And there was another one where the whole video was actually animated subtitles, right?
还有一个,整个视频其实是动态字幕,对吧?
SSA, right?
SSA 格式,对吧?
So- -
所以——
Yeah.
对。
I remember that, yeah -
我记得那个,是的——
... each, this one was-
……每一帧,这个是——
And so each frame was a black frame, but on top of that there was a, 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, so. -
还有一个文件,同时是有效的 ZIP 又是有效的 MP3,就这样。——
So yeah, we'd made a competition of stupid files. -
对,我们就是在比谁做的文件最蠢。——
And it worked.
然后都能播。