frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

Open in hackernews

FFmpeg Assembly Language Lessons

https://github.com/FFmpeg/asm-lessons
127•flykespice•2h ago

Comments

cr125rider•2h ago
I can’t imagine the scale that FFMPEG operates at. A small improvement has to be thousands and thousands of hours of compute saved. Insanely useful project.
prisenco•1h ago
Their commitment to performance is a beautiful thing.

Imagine all projects were similarly committed.

byteknight•1h ago
Seems so easy! You only need the entire world even tangentially related to video to rely solely on your project for a task and you too can have all the developers you need to work on performance!
ackfoobar•45m ago
I seem to recall that they lamented on twitter the low amount of (monetary or code) contribution they got, despite how heavily they are used.
hluska•15m ago
You know friend, if open source actually worked like that I wouldn’t be so allergic to releasing projects. But it doesn’t - a large swath of the economy depends on unpaid labour being treated poorly by people who won’t or can’t contribute.
Almondsetat•11m ago
Yeah no, I'd like non-performance critical programs to focus on other things than performance thank you
therealmarv•7m ago
like Slack or Jira... lol.
zahlman•1h ago
It'd be nice, though, to have a proper API (in the traditional sense, not SaaS) instead of having to figure out these command lines in what's practically its own programming language....
codys•1h ago
FFMpeg does have an API. It ships a few libraries (libavcodec, libavformat, and others) which expose a C api that is used in the ffmpeg command line tool.

They publish doxygen generated documentation for the APIs, available here: https://ffmpeg.org/doxygen/trunk/

zahlman•1h ago
Don't know how I overlooked that, thanks. Maybe because the one Python wrapper I know about is generating command lines and making subprocess calls.
javier2•37m ago
If you are processing user data, the subprocess approach makes it easier to handle bogus or corrupt data. If something is off, you can just kill the subprocess. If something is wrong with the linked C api, it can be harder to handle predictably.
Wowfunhappy•36m ago
They're relatively low level APIs. Great if you're a C developer, but for python just calling the command line probably does make more sense.
ansk•2m ago
For future reference, if you want proper python bindings for ffmpeg* you should use pyav.

* To be more precise, these are bindings for the libav* libraries that underlie ffmpeg

xxpor•23m ago
I get why the CLI is so complicated, but I will say AI has been great at figuring out what I need to run given an English language input. It's been one of the highest value uses of AI for me.
KwanEsq•1h ago
Prior discussion 2025-02-22, 222 comments: https://news.ycombinator.com/item?id=43140614
sylware•1h ago
There is serious abuse of nasm macro-preprocessor. Going to be tough to move away to another assembler.
oguz-ismail•1h ago
Where? There's very little code in those lessons
pveierland•1h ago
The lessons reference `cglobal` in `x86inc.asm`:

https://github.com/FFmpeg/FFmpeg/blob/master/libavutil/x86/x...

loeg•1h ago
Why move away?
ngcc_hk•1h ago
More interesting than I thought it could be. A domain specific tutorial is so much better.
Alifatisk•1h ago
How do they make these assembly instructions portable across different cpus?
KeplerBoy•1h ago
They don't. It's just x86-64.
ahartmetz•1h ago
The lessons yes, but the repo contains assembly for the 5-6 architectures in wide use in consumer hardware today. Separate files of course. https://github.com/FFmpeg/FFmpeg/tree/master/libavcodec
KeplerBoy•14m ago
Yeah, sure. I was specifically referring to the tutorials. Ffmpeg needs to run everywhere, although I believe they are more concerned about data center hardware than consumer hardware. So probably also stuff like power pc.
CannotCarrot•1h ago
I think there's a generic C fallback, which can also serve as a baseline. But for the big (targeted) architectures, there one handwritten assembly version per arch.
faluzure•47m ago
Yup.

On startup, it runs cpuid and assigns each operation the most optimal function pointer for that architecture.

In addition to things like ‘supports avx’ or ‘supports sse4’ some operations even have more explicit checks like ‘is a fifth generation celeron’. The level of optimization in that case was optimizing around the cache architecture on the cpu iirc.

Source: I did some dirty things with chromes native client and ffmpeg 10 years ago.

NullCascade•1h ago
What is the actual process of identifying hotspots caused suboptimal compiler generated assembly?

Would it ever make sense to write handwritten compiler intermediate representation like LLVM IR instead of architecture-specific assembly?

molticrystal•56m ago
It would be interesting to look into this to see if anybody has every hand tuned LLVM IR.

My best guess is you were doing codegen for several different instruction sets and the optimization or side channel prevention is something that would be too difficult or specialized to automate so you have to do it by hand.

nisten•38m ago
I feel like I just got a 3 page intro to autism.

It's glorious.

abhisek•31m ago
Love it. Thanks for taking the time to write this. Hope it will encourage more folks to contribute.

FFmpeg Assembly Language Lessons

https://github.com/FFmpeg/asm-lessons
128•flykespice•2h ago•30 comments

Show HN: I built an app to block Shorts and Reels

https://scrollguard.app/
236•adrianhacar•2d ago•75 comments

Who Invented Backpropagation?

https://people.idsia.ch/~juergen/who-invented-backpropagation.html
16•nothrowaways•32m ago•2 comments

The Weight of a Cell

https://www.asimov.press/p/cell-weight
18•arbesman•53m ago•3 comments

Launch HN: Reality Defender (YC W22) – API for Deepfake and GenAI Detection

https://www.realitydefender.com/platform/api
16•bpcrd•1h ago•6 comments

Web apps in a single, portable, self-updating, vanilla HTML file

https://hyperclay.com/
471•pil0u•9h ago•165 comments

Show HN: A Minimal Hacker News Reader for Apple Watch Built with SwiftUI

https://github.com/wieslawsoltes/HackerNewsWatch
43•wiso•2h ago•7 comments

Typechecker Zoo

https://sdiehl.github.io/typechecker-zoo/
37•todsacerdoti•2d ago•9 comments

The Road That Killed Legend Jenkins Was Working as Designed

https://www.strongtowns.org/journal/2025/8/18/the-road-that-killed-legend-jenkins-was-working-exactly-as-designed
77•h14h•49m ago•40 comments

Walkie-Textie Wireless Communicator

http://www.technoblogy.com/show?2AON
82•chrisjj•2d ago•40 comments

A gigantic jet caught on camera: A spritacular moment for NASA astronaut

https://science.nasa.gov/science-research/heliophysics/a-gigantic-jet-caught-on-camera-a-spritacular-moment-for-nasa-astronaut-nicole-ayers/
326•acossta•3d ago•71 comments

Electromechanical reshaping, an alternative to laser eye surgery

https://medicalxpress.com/news/2025-08-alternative-lasik-lasers.html
146•Gaishan•6h ago•66 comments

The Coming Robot Home Invasion

https://www.andykessler.com/andy_kessler/2025/08/wsj-home-robots.html
15•walterbell•2h ago•12 comments

Image Fulgurator (2011)

https://juliusvonbismarck.com/bank/index.php/projects/image-fulgurator/2/
9•Liftyee•2d ago•1 comments

Win10 users looking for a new OS? Apple $599 MacBook can't come at a better time

https://www.zdnet.com/article/windows-10-users-looking-for-a-new-os-apples-599-macbook-cant-come-at-a-better-time/
13•walterbell•28m ago•4 comments

Sky Calendar

https://abramsplanetarium.org/SkyCalendar/index.html
37•NaOH•3d ago•3 comments

MCP doesn't need tools, it needs code

https://lucumr.pocoo.org/2025/8/18/code-mcps/
139•the_mitsuhiko•6h ago•95 comments

SystemD Service Hardening

https://roguesecurity.dev/blog/systemd-hardening
176•todsacerdoti•11h ago•71 comments

Class-action suit claims Otter AI records private work conversations

https://www.npr.org/2025/08/15/g-s1-83087/otter-ai-transcription-class-action-lawsuit
71•nsedlet•2h ago•9 comments

Vibe coding tips and tricks

https://github.com/awslabs/mcp/blob/main/VIBE_CODING_TIPS_TRICKS.md
84•mooreds•3h ago•52 comments

MCP tools with dependent types

https://vlaaad.github.io/mcp-tools-with-dependent-types
56•vlaaad•6h ago•14 comments

8x19 Text Mode Font Origins

https://www.os2museum.com/wp/8x19-text-mode-font-origins/
48•userbinator•2d ago•16 comments

Texas law gives grid operator power to disconnect data centers during crisis

https://www.utilitydive.com/news/texas-law-gives-grid-operator-power-to-disconnect-data-centers-during-crisi/751587/
67•walterbell•2h ago•63 comments

The Lives and Loves of James Baldwin

https://www.newyorker.com/magazine/2025/08/18/baldwin-a-love-story-nicholas-boggs-book-review
63•Caiero•17h ago•11 comments

When you're asking AI chatbots for answers, they're data-mining you

https://www.theregister.com/2025/08/18/opinion_column_ai_surveillance/
112•rntn•4h ago•52 comments

Weather Radar APIs in 2025: A Founder's Complete Market Overview

https://www.rainviewer.com/blog/weather-radar-apis-2025-overview.html
18•sea-gold•2d ago•23 comments

Scientists discover surprising language 'shortcuts' in birdsong – like humans

https://www.manchester.ac.uk/about/news/scientists-discover-surprising-language-shortcuts-in-birdsong--just-like-humans/
33•gnufx•4d ago•20 comments

LLMs and coding agents are a security nightmare

https://garymarcus.substack.com/p/llms-coding-agents-security-nightmare
130•flail•5h ago•65 comments

Llama-Scan: Convert PDFs to Text W Local LLMs

https://github.com/ngafar/llama-scan
200•nawazgafar•18h ago•78 comments

AI is predominantly replacing outsourced, offshore workers

https://www.axios.com/2025/08/18/ai-jobs-layoffs
124•toomuchtodo•2h ago•105 comments