Below is the chronicle of my journey to build this application as a solo developer. It has been all-consuming, eating up vacation days, evenings, mornings, weekends, and holidays. It took 912 days to get to the release candidate, and I am very anxious about the release. I worked a full-time job this entire time, so work was mostly constrained to weekends, paid time off, or holidays. That greatly stretches out the timeline for something this ambitious.
I have chronicled the major developments of this program over the last two and a half years, mostly through angry tweets and desperate text messages to my wife. Below is the long-form version of this entire project for anyone that wants to read it.
May 2024The Start
In May of 2024, I began attempting to migrate my online social group from Discord to a new self-hosted solution. I immediately ran into issues with Jitsi and Element. Their screen sharing capabilities were not up to par. They did not allow simultaneous screen sharing in the same room, and the screen sharing was low quality. On top of that, I also found it very difficult and annoying to try to set them up and get them working with the official documentation.
We tried Rocket.Chat, Mattermost, and Revolt and probably some others that turned out to just be wrappers around Jitsi's screen-sharing features. They all had the same performance issues. TeamSpeak still did not have screen sharing at this point (and in some ways they still do not have a fully functioning implementation).
So after very little thought and much hubris, I decided that I could just build my own voice/text/chat/screen share application. My exact words, which I have saved and looked back on multiple times in the past 912 days, were "Why can't I just write a peer to peer web rtc program? Am I missing something? Seems easy as well. Ok. You know what. I refuse to believe this is that fucking hard."
My very wise friend replied, "I bet it's hard."
And after much consideration, I retorted, "NO IT CAN'T FUCKING BE. EVERYONE CAN SHARE MULTIPLE WEB CAMS. SHARING A SCREEN/APP OVER WEB RTC IS LITERALLY LESS THAN 100 LINES OF CODE."
June 2024First Attempt
Within 24 hours, I had 250 lines of code using Fastify + Coturn for a very basic proof of concept that allowed peer-to-peer audio calls. Coturn was doing most of the heavy lifting.
I first decided to use this as a learning opportunity to teach myself something besides JavaScript and tried out some Go and Rust libraries but quickly gave up when I realized learning was getting in the way of actually doing the thing.
About a day later, I was able to get peer-to-peer screen sharing working with audio calls and let users set their audio input and output devices. This was all web-based, and I still thought the journey was going to be easy.
I started looking through different WebRTC JavaScript implementations, and most of them were out of date or had open CVEs. I ended up settling on MediaSoup for the server and client portions, and it has been great.
I briefly decided to call it ezre.gg, a slight alteration of "gg ez no re" because, if you were on voice chat, you wanted to re. Everyone hated this name, and I don't like it in retrospect.
On June 15th I laid out my plan and settled on the name Speakeasy.im, end to end encryption that is easy to use to talk to people with. The encryption part being the a reference to speakeasy bars and combined with it being easy to use and its primary function being voice chat.
I had thought of taking this gimmick further and making servers just have a single password with no auth system. You could just drop in if you knew that server's password, but that lasted about 10 minutes before I realized no one would actually like that gimmick. I am considering adding it as an optional feature in the future, though, as a neat little callback to my original idea.
Anyways, it became apparent very soon that my application was having the same screen-sharing performance issues that all of the other non-Discord apps had. They were all using the Firefox/Chromium embedded screen share utility, which did not use hardware encoding and did not allow you to isolate the audio for a single application, so all of the noise came through.
I began evaluating my options for how to extend this into a real application. I decided to use Electron because I thought it would be easy, but this was a huge mistake that I regret now (https://x.com/compose/articles/edit/2124576248126910464). I needed a way for Node to access the GPU/Windows API/etc., but the functionality just doesn't exist out of the box. I started reading about Node-API and decided to write a custom C++ program for the screen capture.
Originally, I was going to use FFmpeg for a lot of this, but the licensing scared me, and I decided I didn't want any part of that, so I started down the rabbit hole of Windows Media Foundation APIs. This all dragged out from June through July.
September 2024Windows Media Foundation
The Windows Media Foundation APIs are dusty, and I am not sure if anyone has ever even tried to use them for what I am using them for. The first problem I ran into was that the DirectX FramePool captures pixels in a raw BGRA format (either float or UInt).
I wanted to convert everything to H.264, VP8, or VP9, and the WMF transcoder pipeline only wanted pixel formats that were not raw RGB formats. This was not in the documentation anywhere. In fact, the raw pixels are listed as a valid input type to the media transcoder function.
It turned out to be valid in the sense that it was an acceptable format to pass, but the encoder didn't do anything with it. The encoder wanted YUV or NV12.
I had no experience in this domain, MS docs were inaccurate, and there was almost no discussion of using a DirectX FramePool to grab surfaces from an application and feed them to an MFT pipeline. Most people were doing this with webcams, and for whatever reason, there is a whole separate webcam-specific branch of code that handles all of these problems for you. I tried to hijack that route and abuse it to my own ends but was unable to figure it out.
This was just around the time that GPT-4o came out, and I was trying to use it for help. With GPT-4o and StackOverflow, I was able to write a process to take the raw pixels and convert them, row by row, to YUV/NV12 pixel format. This allowed me to feed the frames into the first part of the IMFSinkWriter.
The performance metrics were incredibly poor for the hand written conversion I did, so I learned a tiny bit about pixel shaders and moved to one of those. That was moderately faster. Eventually I moved to using much more perfomant pixel shaders but I don't remember when that specific optimization happened.
I finally got the pixel formatting issue resolved on September 16th, only to be greeted with a video consisting of incorrect colors, mostly everything was green. That is when I realized I had just been glossing over the pixel format abbreviations in the documentation: BGRA. Not a typo in the paragraph above. The colors are ordered with blue first, then green, then red, and finally the alpha level. I had to rewrite the pixel shader to convert them appropriately. This took about 2 days or so.
Now that I finally had the correct pixel format, I thought it would be smooth sailing.
I did get a full H.264 MP4 out of the IMFSinkWriter 2 days later (September 20th), but when I opened it up, the timing was all wrong. Everything was moving too slowly.
After another day, I finally got timestamps and frame pacing issues sorted out with video only. I was able to capture the Rocket League application at 120 FPS and save it as an MP4.
The IMFSinkWriter is supposed to simplify this entire thing. You just give it the tracks you want to include in the transcode operation, and it's supposed to magically take care of the rest in a single call.
October 2024Audio Process Isolation
The next big hurdle was isolating audio to a specific process. I had this working off and on multiple times. An implementation I thought was working would encounter a new Windows idiosyncrasy, and I'd need to approach identifying the audio process for a given window handle differently. Eventually I ended up with a function to walk the Windows process tree up to a certain point and grab all audio below that part.
But there were also issues with the IAudioClient inside the Win32 API. The 3 versions are IAudioClient, IAudioClient2, and IAudioClient3. I was using IAudioClient2 because that was what all of the examples used and that was what GPT-4o knew. I didn't want to ship something out of date, though, and wanted to move to IAudioClient3. All of the documentation said it was backwards compatible and only an extension of IAudioClient2. However, I was not able to get IAudioClient3 to work. This burned a couple of weeks, and I gave up and just went back to IAudioClient2.
It took me entirely too long to figure out how to get the audio API to capture a specific process. The LLMs were not helpful in this regard in October 2024. They wanted to install separate loop back programs or create our own virtual audio out cable and all sorts of nonsense.
But by October 13, I had finally isolated audio from specific processes and had it on the same timestamp/pacing as the video. I now needed to mux them together into a single file.
The IMFSinkWriter required that audio and video be ready at the same time, and they could not be updated after the sink writer was initialized. It also did not allow you to adjust any timing or anything once the writer started.
If you tried to capture an application whose audio was not available at the start of the application (say a video game that has been alt tabbed away and mutes itself), the program would just ignore it. Some applications did not have a process available to emit audio until the audio started playing. You didn't need actual audio, but you needed the stream formatted and attached to a process, etc.
This also presented a problem for applications that changed size in some way after the capturing began.
So I set up this very goofy hack work around that would create an in-memory audio stream that sent silence to the sink writer, and then the captured audio would be sent to the virtual in-memory audio stream instead of to the sink writer.
This is when I abandoned the IMFSinkWriter paradigm and switched to IMFMediaSink, which is what IMFSinkWriter is an abstraction of. With IMFMediaSink, you have to write everything yourself.
So that is when I picked up the Windows Media Foundation Topology pipeline. It is supposed to have all of these prebuilt functions for media streams, transformations, outputs, etc. (https://learn.microsoft.com/en-us/windows/win32/medfound/about-topologies).
The idea was that I would have two media source nodes that would feed a media stream node, which would feed a transform node, then into an output node, and finally a file/stream sink node.
I fought the topology pipeline for two or three weeks, maybe longer. I never got it to work at all. I tried endless variations on the setup. I tried reading more. I tried a book. I tried brute force. I tried LLMs. I tried StackOverflow. If I fixed one error in the pipeline, a new part of it would break.
November 2024Media Session Manager
Keep in mind that at this point I had solved the voice chat portion. That almost works out of the box with WebRTC clients now. I had been stuck on capturing application audio/video for streaming since June 1. Five entire months of trying approach after approach only to hit random dead ends along the way.
I did get it to actually output a correct file a few times, but it seemed non-deterministic. Obviously, something was changing somewhere, but it seemed to have something to do with the application or something, as I was never able to get this to work in successive runs. That being said, I managed to get my first video clip with synchronized audio at the correct frame pacing on November 1 at 1:59 PM.
I was able to drive the application capture to an MP4 file at some resolution I do not remember at 60 FPS with correct color grading. I thought I was home free.
I needed to take this audio/video file and instead of writing to an MP4, I needed it to go into a memory buffer to feed back into Electron, to send to the WebRTC SFU, to forward to other clients.
The last problem I had with IMFTopology before giving up on it was that the IMFSink would not write to a buffer. It wanted to write to a file, and I could not figure out how to get it to not do that. I finally settled for a fake file that was actually just a memory buffer.
Then it turns out that the IMFTopology pipeline cannot do streaming. It only does entire transcodes of a format and has a finalize step to turn it into a valid MP4/H.264 file. There was no way around this part. I started learning about the different kinds of MP4s and found out some only work when the entire file is complete and finalized, and others are meant to be streamed. The IMFTopology pipeline could only do the finalized versions of MP4s and did not give me the ability to change the specific type of MP4 it produced.
This was a long journey where I learned about NALs, fragments, key frames, B-frames, etc. So I went back to the drawing board and started looking for another way to do this.
There has been a lot of churn in the Windows API. I would hit on what I thought was a solution only to find out it was deprecated. The worst example on the IMFTopology pipeline was an article about creating a custom sink writer. The article was published in June of 2023 as part of the Windows 11 SDK. By November of 2024, it was deprecated. The madness with IMFTopology continued through the entire month of November.
December 2024IMFSinkWriter Returns
On December 7th, I abandoned the IMFTopology pipeline. I tried to go back to the IMFSinkWriter and use named pipes. This kind of worked, but the stream would consume memory for the duration someone streamed it, and I could not figure out the right way to have it roll off after consumption. I was creating fMP4s using Media Source Extensions in web browsers, which the WMF API did not support out of the box.
So I intercepted the memory buffer and rewrote the raw MP4 headers/frames/NAL units to turn them into a fragmented MP4 on the fly. This actually worked after a ton of manually digging around MP4 files with ffprobe, mp4box, bento4, and ffmpeg. I was able to stream from client A to client B with audio. But there was a catch.
To view an fMP4, you need the start of the stream, so I had to capture the init fragment and store it so someone could join the stream in the middle or rejoin after watching initially. So I had to have this whole init frame storage system and make sure the init frame was delivered first to a new or resumed client.
Then the next problem was, again, audio not being ready. There was no audio at the start of some of the streams, so the init fragment had no audio information. So I tried all sorts of goofy stuff like updating the init fragment at a regular cadence or not starting until audio was available.
I finally realized I could just discard the stream until I had a valid init fragment with correct audio.
January 2025Manually Rewriting MP4s In Memory
This worked until it didn't. Sometimes there isn't any audio, and that is a valid stream that would never start. Then my in-memory file rewrite started showing flakiness. The AAC audio would sound weird or garbled sometimes. It wouldn't pace with frames correctly and would speed up or slow down to try to match the video.
Trying to debug this was very difficult. You can't use a normal debugger in this case (or I couldn't and never figured out how) because you've got all of this real time streaming happening, and you need to see and hear it to figure out if it is correct. You can't look at GBs of uncompressed pixels and sine waves to know if it is working. You can dump things out to a file, but then that is a new, separate code path you might cause to be out of sync.
So a ton of debugging was print statements. Incredibly inefficient.
I finally found Windows Media Foundation Media Session Manager, that allowed for near total control over the entire operation, but also a LOT more manual handling of the code.
February 2025A Month Off
I had a lot of work-related stuff in February, so nothing happened almost this entire month except poking at the program every once in a while. Almost nothing got done this month. I took a vacation from the project as I neared the one year mark.
March 2025An Actual Application
I had to start adding a user auth system. I needed people to be able to choose what streams they watched (the first alpha just auto-opened a stream as soon as it was available).
Once I got this set up and started testing, I noticed weird problems between the client and server. I couldn't get the MediaSoup JavaScript client to communicate to the MediaSoup server correctly. MediaSoup is just using the Chromium/Electron WebRTC functionality and exposing it in a programmatic way. Chromium WebRTC had some sort of issue with the data I was sending.
It kept trying to throttle down the bandwidth because I wasn't communicating the parameters of the transmission the right way, so you would get random lag in the stream, stutters, etc. I tried to fix that but discovered that Chromium was forcing the H.264/AAC stream into its own secondary encoder when it took over. This caused a ton of issues in terms of performance. The WebRTC function inside of Chromium is mostly a black box in the compiled program. I couldn't fix any of this. It also didn't use hardware encoding for this unneeded re-encode, so that caused performance and quality issues.
The month of March was spent troubleshooting this issue I had no control over.
April 2025Move to C++ Sender
For April, the entire month was spent moving all of MediaSoup's client side code for starting/sending media streams to C++ from JavaScript. MediaSoup offers both, and the functions and patterns are very similar, so it wasn't a huge lift, but it was very annoying to redo it all. With the C++ version, I was able to bypass the built-in Chromium WebRTC setup and only do the encoding one time. This also removed the need to bring the encoded data back across the V8 memory boundary, which added a lot of latency to the process.
May 2025Rendering Video
In May I started trying to figure out how to render 4k@120FPS reliably inside of a web browser. I tried painting the canvas, regular video tags, dedicated web workers, etc. Eventually I settled on WebCodecs, which I was not previously aware of. It turned out support for it was not added to Firefox until September 2024 or to Safari until September of 2025, so it was not in widespread use since it wasn't standardized across browsers yet. If I had made it to this point a little earlier, I'm not sure what I would have done.
WebCodecs just allow for hardware accelerated video streaming inside of a web browser with a high degree of control over the encodings and such.
This also led to removing the MSE patching on the sender side since MSE wasn't needed with WebCodecs (or wasn't compatible, I don't remember now). Since I could hand off the raw H.264 and AAC streams to the C++ portion on the sender side and then set the receiver to use a specific codec and just include key frames, I no longer needed init fragments or anything like that.
June 2025Finally An Alpha
After a year, I thought I was in a good spot and did an alpha test with some friends this month. It was moderately successful. Everyone was able to join and share their screen. We had about 6 people chatting and 4 screen shares going at once. I was happy. I was pivoting to an authentication system and building out the rest of the application. At this point, it was just a server with .htaccess that you could hit when I turned it on. You just typed a display name and started chatting.
July 2025 through October 2025Polishing
These months were spent addressing concerns and feedback from the alpha. The UI got a major overhaul to move it from something like GeoCities to something more like Craigslist. I implemented BetterAuth, got a Postgres backend wired up, added a SQLite database for storing local user information, and just began general tidying up of the application for an actual launch. I thought I'd have a release in August at this rate.
I also worked hard to secure Electron. This is very difficult, and most people do not do a good job of it. Maintaining the separation between the Node back end and Chromium front end can be frustrating, especially when you can turn it off with the flick of a switch and do things the quicker and less secure way.
November 2025 through January 2026A Second Job
I still had not released the program yet. After more than a year of not getting it good enough for people and with no profit angle for all of the work, I was getting burnt out.
I had an opportunity to pick up a second job on the side. I worked that ~35 hours a week on top of my normal programming job and figured that it was the end of the project.
February 2026A Return
I returned to Speakeasy in February and decided that since I was entering year two, I might as well loop back around to the end-to-end encryption aspect.
I started doing research on Discord's DAVE protocol, Meta's Labyrinth architecture, and Signal's open source repositories.
I began implementing mls-rs and transmitting via data streams in WebRTC but ultimately found it difficult to use.
I switched to raw web sockets outside of WebRTC for the text based chat. The first version worked like Signal, where someone has to send you an invite to a specific encrypted room. This is not how Discord works. I was not thinking when I did this. If no one was online, you could not join the room. This was not an easy fix, and all of the E2EE work for text chats had to be thrown out.
Luckily, E2EE for WebRTC using insertable streams was relatively easy. Doing key rotation for forward secrecy whenever someone joins a room was a bit complicated, but that turned out to not be a big deal since there isn't conversation history to preserve or worry about.
March 2026E2EE Rewrite
March was an E2EE rewrite. The method now works more like Discord. The server's RBAC determines what text rooms you can access. If you can access a room, then there is a stored key package for the client to consume that adds that client to the MLS roster. Once the client joins that MLS roster, it creates a new key package for anyone else who wants to join.
The assumption is that the server will only permit people to access key packages they are authorized to access.
I then started working on direct messages, group messages, direct calls, and group calls. These work more like the Signal type where an admin has to invite you to that group. Once you accept their invite, you're allowed in that room.
April 2026Root Signing Keys
I didn't think through multiple devices, so a user who signed up with device A could not authorize another device under their name and have it show up as a trusted identity. This caused a lot of problems for syncing history between devices and receiving new messages on your phone's web browser and the desktop web browser and the official application.
So again, the E2EE had to be redone to use root signing keys so that you could authorize your device in other places, similar to Signal's desktop app when you link it to your phone.
May 2026 through July 2026E2EE Polish and Race Conditions
E2EE added a whole new set of race conditions and a need for more polish. There are all sorts of scenarios that have to be taken into account when you're doing forward secrecy or syncing history. Since someone joining a room for the first time consumes a one time use key to add themselves to the MLS roster, you have to handle situations where their connection drops in the middle and they don't produce a new key for the new MLS roster state, or two people grab the key at the same time, or someone removes themselves from the roster at the same time the key is consumed.
There were also some minor race conditions on the voice/streaming side, but those were trivial. I also had to fix some performance issues there where I was using some inefficient algorithms for encrypting the media streams. Again, though, still minor.
But the race conditions took a long time to sort out. The UI and logic and state had lost their separation of concerns. This was all completed in July.
August 2026Adaptive Streaming
I thought I was done but then realized I had forgotten about adaptive streaming. Users needed to be able to consume low bandwidth streams if they were on a bad connection. In the application as it existed in August, the sender sent one single stream. A receiving client that could not keep up just dropped frames.
I started working on faking temporal and spatial layers as most hardware encoders do not support multicast. The current setup right now is that every broadcaster emits three different resolutions and three different frame rates per resolution.
This was quite difficult to get working from a performance stand point. Variable FPS layers are almost free, but you have to separately encode the different resolutions. This involved a lot of very careful management of memory to ensure I wasn't making unneeded copies of the DirectX texture or the encoded frames.
September 2026Hardware Failures
Towards the end of August, I started noticing some performance issues with media streams when working on the multi resolution encoding. The receiving clients would randomly lock up and freeze. I thought it was a performance issue from my addition of the multiple layers.
Then I thought it was a bug in Chromium. Claude and ChatGPT both agreed. So then I started debugging that. I compiled my own parts of Chromium to add in custom debugging and breakpoints. I then patched MediaSoup to emit more traces to try to nail down why this was happening. No identifiable or repeatable pattern was anywhere to be seen.
Then other things started breaking. Video games started crashing. The computer would randomly lock up.
It turned out I was chasing a bad stick of RAM. I removed the bad stick, and all of the problems went away. This added another month for no reason.
October 2026A False End
After identifying the RAM issue, I had to go back through and redo all of my checks to figure out what was RAM related and what was an actual problem with Speakeasy.
I set up a bunch of fuzzing tooling to run the real actual application and just spam it endlessly for hours. I had LLM agents imitate a QA team and drive the application. I did some TLA verification. I used ast-grep to comb through the code for any potentially defective patterns.
Everything was looking good, bugs were being found and fixed. I was mostly throttled by available CPU to actually run the fuzzers on my local machine and do all of the screen sharing tests, so I decided to get a new computer since I had already lost a stick of RAM.
I paid for a brand-new custom prebuilt PC, and when I got it home, it started BSODing endlessly, multiple times an hour. I ran MemTest86 on it and found a bad stick of RAM. I took it back to the store after two weeks. They began doing diagnostics on it. It took them a week to run MemTest86. Bad RAM, again. This put me three weeks behind schedule.
November 2026The End/The Beginning
My previous RAM failure did not seem to produce any actual defects that did not also cause a BSOD. With the new computer, the bad RAM caused a lot of different issues that were happening even without a complete crash. All of the aspects of the program that were compiled code had compiled incorrectly. I had to go back through and compare versions to those on GitHub, recompile everything, throw away two weeks of tests, etc.
And now we're here, and I'm going to release it. I hope it is good.
I am currently working on Speakeasy 2.0, which uses native GUIs instead of Electron.