YouTube as Storage

2026-02-149:10221155github.com

https://www.youtube.com/watch?v=l03Os5uwWmk. Contribute to PulseBeat02/yt-media-storage development by creating an account on GitHub.

CodeFactor TeamCity Full Build Status

Star History Chart

Stores files onto YouTube by encoding them into lossless video and decoding them back to the original file. Supports both a command-line interface and a graphical user interface.

  • File Encoding/Decoding: Encode any file into a lossless video (FFV1/MKV) and decode it back
  • Fountain Codes: Uses Wirehair fountain codes for redundancy and repair
  • Optional Encryption: Encrypt files with a password using libsodium (XChaCha20-Poly1305)
  • Batch Processing: Queue multiple files for batch encoding (GUI)
  • Progress Tracking: Real-time progress bars and status updates (GUI)

Visit my CI/CD pipeline, and click "Login as Guest". Visit the yt-media-storage project, click on the latest passing build, and click "Artifacts" to download the latest build artifacts for both the CLI and GUI. You may need to install some shared libraries (FFmpeg, Qt6, libsodium) to run the executables.

  • CMake 3.22
  • C++23 compiler
  • FFmpeg
  • libsodium
  • OpenMP
  • Qt6 (Core and Widgets)
sudo apt update
sudo apt install cmake build-essential qt6-base-dev \
  libavcodec-dev libavformat-dev libavutil-dev libswscale-dev libswresample-dev \
  libsodium-dev libomp-dev
sudo dnf install cmake gcc-c++ qt6-qtbase-devel ffmpeg-devel libsodium-devel libgomp
sudo pacman -S cmake qt6-base ffmpeg libsodium openmp
brew install cmake qt@6 ffmpeg libsodium libomp
vcpkg install ffmpeg libsodium openmp qt6

Or install Qt6 separately via the Qt Online Installer and FFmpeg/libsodium via vcpkg.

mkdir build
cmake -B build
cmake --build build

This produces two executables:

  • media_storage — Command-line interface
  • media_storage_gui — Graphical user interface
./media_storage encode --input <file> --output <video> [--encrypt --password <pwd>]
./media_storage decode --input <video> --output <file>
  1. Encode a file to video:

    • Click "Browse..." next to "Input File" to select the file you want to encode
    • Click "Browse..." next to "Output File" to choose where to save the video
    • Click "Encode to Video" to start the process
  2. Decode a video to file:

    • Click "Browse..." next to "Input File" to select the video file
    • Click "Browse..." next to "Output File" to choose where to save the decoded file
    • Click "Decode from Video" to start the process
  1. Click "Add Files" to add multiple files to the batch queue
  2. Select an output directory for all encoded videos
  3. Click "Batch Encode All" to process all files in sequence
  • The progress bar shows the current operation progress
  • Status label displays current operation status
  • Logs panel provides detailed information about each step
  • All operations run in separate threads to keep the UI responsive
  • Encoding: Files are chunked, encoded with fountain codes, and embedded into video frames
  • Decoding: Packets are extracted from video frames and reconstructed into the original file
  • Video Format: FFV1 codec in MKV container (lossless)
  • Frame Resolution: 3840x2160 (4K) at 30 FPS
  • Encryption: Optional XChaCha20-Poly1305 via libsodium
  • Qt6 not found: Ensure Qt6 development packages are installed
  • FFmpeg libraries missing: Install FFmpeg development packages
  • libsodium missing: Install libsodium development packages
  • OpenMP errors: Install OpenMP development packages
  • Cannot open input file: Check file permissions and paths
  • Encoding fails: Ensure sufficient disk space for output video
  • Decoding fails: Verify the input file is a valid encoded video

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.


Read the original article

Comments

  • By repeekad 2026-02-149:476 reply

    I once asked one of the original YouTube infra engineers “will you ever need to delete the long tail of videos no one watches”

    They said it didn’t matter, because the sheer volume of new data flowing in growing so fast made the old data just a drop in the bucket

    • By MagicMoonlight 2026-02-1416:021 reply

      Now that they can harvest it all for AI training, that decision was the cheapest and greatest thing they ever did.

      Imagine trying to pay for all that content, nobody on earth would be able or willing to supply it.

      • By paulryanrogers 2026-02-151:501 reply

        PeerTube is a thing. I like to think without centralized players like YT, that P2P supported federation may have gained a better foothold.

        • By water9 2026-02-1516:23

          There’s still time

      • By Kwpolska 2026-02-1410:582 reply

        Of course videos disappear for copyright, ToS violations, or when the uploaders remove them. They do not disappear just because nobody watched them.

        • By Gigachad 2026-02-1413:152 reply

          There’s a whole activity around discovering random 15 year old videos with almost no views. It’s usually some random home video

          • By epolanski 2026-02-150:30

            A friend of mine worked two years in YouTube as a content admin.

            Basically being given videos to watch all day, especially coming from the middle east (this was ISIS time so any video from the area had someone watching it as soon as uploaded).

            Needless to say there's endless gold no view videos according to him.

            It's also interesting that it was no open secret that already in 2018 they were all told that they were essentially training machines to do their job.

          • By nabhasablue 2026-02-155:34

            I was interested in the same thing and built a search for it

            https://ytstalker.mov

        • By leephillips 2026-02-1415:27

          They also disappear when the government of Pakistan tells Google to erase them: https://lee-phillips.org/youtube/

    • By lysp 2026-02-154:141 reply

      I seem to recall reading that the HD variations may get removed leaving only 480p or lower for older unwatched videos.

      The original upload would likely still be stored, but not available for viewing.

      • By Nevermark 2026-02-158:50

        That would be an odd thing to do. HD is low resolution already, and 480 is noticeably worse.

        If they really wanted to compress, take out every other frame, and regenerate those frames with a neural decoder. But I don't know why that would be worth the effort for a stable number of low res files either.

    • By wasmainiac 2026-02-149:524 reply

      I wonder if that still holds true? The volume of videos increases exponentially especially with AI slop, I wonder if at some point they will have to limit the storage per user, with a paid model if you surpass that limit. Many people who upload many videos I guess some form of income off YouTube so it wouldn’t that be that big of a deal.

      • By weird-eye-issue 2026-02-1410:161 reply

        What they said only holds true because the growth continues so that the old volume of videos doesn't matter as much since there's so many more new ones each year compared to the previous year. So the question is more about whether or not it will hold true in the long term, not today

        • By raincole 2026-02-1412:443 reply

          The framing here is really weird. The volume of videos increasing isn't 'growth.' Videos are inventory for Youtube. They're only good when people (without adblocks!) actually watch them.

          • By weird-eye-issue 2026-02-1415:081 reply

            Growth in this context is that there are a larger volume of videos each year. So each year a single video is exponentially a smaller and smaller percentage of the total.

            • By raincole 2026-02-1416:482 reply

              Yeah and the math doesn't check out.

              For example, if in year N youtube has f(N) new video. Let assume f(N) = cN^2. It's a crazy rate of growth. It's far better than the real world Youtube, which grew rather linearly.

              But the rate of "videos that are older than 5 years" is still faster than that, because it would be cubic instead of quadratic. Unless the it's really exponential (it isn't), "videos that are older than 5 years" will always surpass "new videos this year" eventually.

              • By whycombigator 2026-02-151:02

                Video sensors are continuously getting cheaper, better and more more prevalent over time. The trend is towards capturing all angles of everything, everywhere, at increasingly higher resolutions.

              • By weird-eye-issue 2026-02-1423:58

                > Unless the it's really exponential (it isn't), "videos that are older than 5 years" will always surpass "new videos this year" eventually.

                Such a weird strawman argument that you are making up. You've over thought this so much that you are missing the forest from the trees

          • By UltraSane 2026-02-1420:352 reply

            Yes. a video no one watches is a waste of storage.

            • By dotancohen 2026-02-152:00

              Maybe not.

              Maybe it could be used to train a neutral network. Maybe it contains dirt on a teenager, who might become a politician two decades from now. Maybe it contains an otherwise lost historical event.

            • By weird-eye-issue 2026-02-158:29

              Or it just helps to cement YouTube as the go-to place for uploading and sharing videos for almost any purpose which has a long-term positive effect for user engagement and retention

          • By amelius 2026-02-1413:03

            ^ This.

      • By ranger_danger 2026-02-1410:051 reply

        I wonder if anyone has ever compiled a list of channels with abnormally large numbers of videos? For example this guy has over 14,000:

        https://www.youtube.com/@lylehsaxon

      • By pogue 2026-02-149:551 reply

        I assume it's an economics issue. As long as they continue making money off the uploads to a higher extent than it costs for storage, it works out for them.

      • By pwdisswordfishy 2026-02-154:28

        > The volume of videos increases exponentially

        Source?

    • By jl6 2026-02-1413:243 reply

      One day, it will matter. Not even Google can escape the consequences of infinite growth. Kryder's Law is over. We cannot rely on storage getting cheaper faster than we can fill it, and orgs cannot rely on being able to extract more value from data than it costs to store it. Every other org knows this already. The only difference with Google is that they have used their ad cash generator to postpone their reality check moment.

      One day, somebody is going to be tasked with deciding what gets deleted. It won't be pretty. Old and unloved video will fade into JPEG noise as the compression ratio gets progressively cranked, until all that remains is a textual prompt designed to feed an AI model that can regenerate a facsimile of the original.

      • By asah 2026-02-1413:382 reply

        You can see how Google rolls with how they deleted old Gmail accounts - years of notice, lots of warnings, etc. They finally started deletions recently, and I haven't heard a whimper from anyone (yet).

        • By flux3125 2026-02-1413:573 reply

          The problem is that some content creators have already passed away (and others will pass away by then), and their videos will likely be deleted forever.

          • By shevy-java 2026-02-1415:162 reply

            That may be, but I assume for videos that had some viewership base, there may be a consideration. E. g. if a video was viewed 20 million times, it may be worth more than one that was viewed only 5 times.

            • By eMPee584 2026-02-1415:581 reply

              I've stumbled upon very valuable content with very low view numbers - the algorithms spiral around spectacularity and provocation, not quality or insight.

              • By asah 2026-02-157:321 reply

                Then it's on you to share it !

                • By eMPee584 2026-02-1617:07

                  But to whom, I have no followers and a blog update has been on my TODO list for two decades..

            • By coldtea 2026-02-1418:47

              >videos that had some viewership base, there may be a consideration

              Those would be the worst of the lot regarding how valuable they are historically for example. Engaging BS content...

          • By zaik 2026-02-1414:271 reply

            Hopefully the deletion will not affect videos with thousands of views, even if the account is lost.

            • By loloquwowndueo 2026-02-1414:431 reply

              [flagged]

              • By CuriouslyC 2026-02-1414:52

                Goog is 100% not going to delete anything that is driving any advertising at all. The videos are also useful for training AI regardless, so I expect the set of stuff that's deleted will be a VERY small subset. The difference with email is that email can be deduplicated, since it's a broadcast medium, while video is already canonical.

                I expect rather than deleting stuff, they'll just crank up the compression on storage of videos that are deemed "low value."

          • By dessimus 2026-02-1414:254 reply

            Monuments erode away and memories of those enshrined are lost time as well, nothing lasts forever.

            • By bentcorner 2026-02-1415:351 reply

                  I met a user from an antique land
                  Who said: Two squares of a clip of video
                  Stand in at the end of the search. Near them,
                  Lossly compressed, a profile with a pfp, whose smile,
                  And vacant eyes, and shock of content baiting,
                  Tell that its creator well those passions read
                  Which yet survive, stamped on these unclicked things,
                  The hand that mocked them and the heart that fed:
                  And on the title these words appear:
                  "My name is Ozymandias, Top Youtuber of All Time:
                  Look on my works, ye Mighty, and like and subscribe!"
                  No other video beside remains. Round the decay
                  Of that empty profile, boundless and bare
                  The lone and level page stretch far away.

              • By donkeyboy 2026-02-1422:181 reply

                This is amazing.

                • By tempestn 2026-02-150:033 reply

                  Would've been, once. These days I assume bentcorner asked their favourite LLM to generate a poem parodying Ozymandias about once-popular youtube videos.

                  • By 1bpp 2026-02-154:381 reply

                    It doesn't feel like it at all (I'd never expect an LLM to say 'pfp' like that, or 'lossly[sic] compressed', ASCII instead of fancy quotes) but who knows at this point.

                    I may have gotten incredibly neurotic about online text since 2022.

                  • By fragmede 2026-02-153:262 reply

                    or you could get over it and still enjoy it anyway. Like how Coke Zero tastes.

                    • By tempestn 2026-02-155:44

                      That is a fair point. Especially since, assuming it was AI-generated, it presumably wouldn't have existed at all otherwise.

                    • By joquarky 2026-02-155:22

                      Brought to you by Carl's Jr

                  • By bentcorner 2026-02-1515:231 reply

                    Nope, I hand wrote this.

                    I actually considered using an LLM but in my experience they "warp" the content too much for anything like this. The effort required to get them to retain what I would consider something to my taste would take longer than just writing the poem myself. (Although tbf it's been awhile since I've asked a LLM to do parody work, so I could be wrong)

            • By spriggancg 2026-02-1416:271 reply

              let's see what will last longer over the ages : engraved stone or google?

            • By herodoturtle 2026-02-1416:04

              Like tears in rain <3

            • By ralusek 2026-02-1419:21

              mono no aware

        • By 1313ed01 2026-02-1416:53

          Dropbox seem to be doing the same thing. After years of whining about my 2TB above limit I recently received a mail with a deadline to delete my files or they will.

      • By dyauspitr 2026-02-1415:312 reply

        It depends. At the rough 2 PB of new data they get a day that’s about 10 sq ft of physical rack space per day. Each data center is like 500,000 sq feet so each data center can hold 120 years of YouTube uploads. They’re not going to have to restrict uploads anytime soon.

        • By semitones 2026-02-1416:17

          Not all of the square footage of a data center is usable for racks

      • By jongjong 2026-02-150:10

        Oh. I noticed in an AI music generation service I use that old pieces were severely degraded to the point that they were crackling really bad... And I remember thinking that it's a good thing I downloaded an mp3 of my favorites. I confirmed that the quality is very different by listening to the downloaded recording with the hosted version side-by-side.

    • By ntoskrnl_exe 2026-02-1413:063 reply

      Wouldn't it also be a performance nightmare?

      The energy bill for scanning through the terabytes of metadata would be comparable to that of several months of AI training, not to mention the time it would take. Then deleting a few million random 360p videos and putting MrBeast in their place would result in insane fragmentation of the new files.

      It might really just be cheaper to keep buying new HDDs.

      • By stogot 2026-02-1413:12

        S3 allows delete and is efficient here. I’m sure Google can figure it out

        They allow search by timestamp, I’m sure YouTube can write algo to find zero <=1 view

      • By dev1ycan 2026-02-1413:102 reply

        This is why they removed searching for older videos (specific time) and why their search pushes certain algorithmic videos, other older videos when found by direct link are on long term storage and take a while to start loading.

      • By moffkalast 2026-02-1413:071 reply

        Besides with their search deteriorating to the point where a direct video title doesn't result in a match, nobody can see those videos anyway and they don't have to cache them.

        • By sfn42 2026-02-1413:261 reply

          It's not just the search deteriorating. The frontend is littered with bugs. If you write a comment and try to highlight and delete part of that comment, it'll often delete the part you didn't highlight. So apparently they implemented their own textfield for some reason and also fucked it up. It's been like that for years.

          The youtube shorts thing is buggy as shit, it'll just stop working a lot of the time, just won't load a video. Some times you have to go back and forth a few times to get it to load. It'll often desync the comments from the video, so you're seeing comments from a different video. Some times the sound from one short plays over the visuals of another.

          It only checks for notifications when you open the website from a new tab, so if you want to see if you have any notifications you have to open youtube in a new tab. Refreshing doesn't work.

          Seems like all the competent developers have left.

          • By r_lee 2026-02-1413:551 reply

            and if you do a hard refresh on the webapp, it literally takes like 10 seconds for the homepage to load

            • By sfn42 2026-02-1414:37

              Yeah, one that I forgot to mention is if you pause a youtube short and go to a different tab, the short will unpause in the background, or it might change to an entirely different short and start playing that.

  • By Smalltalker-80 2026-02-1411:491 reply

    Thechnically cool, but ToS state: "Misuse of Service Restrictions - Purpose Restriction: The Service is intended for video viewing and sharing, not as a general-purpose, cloud-based file storage service." So they can rightfully delete your files.

    • By ilaksh 2026-02-1412:373 reply

      Its interesting that this exact use case is already covered in their ToS. I wonder when the first YouTube as storage project came out, and how many there have been over the years.

      • By kingstnap 2026-02-1421:24

        The idea of exploiting someone else's server to store files is incredibly old.

        https://en.wikipedia.org/wiki/GMail_Drive

        When Google launched Gmail (2004) with a huge 1GB storage quota, Richard Jones released GMailFS to mount a Gmail account as a standard block device.

      • By Valkryst 2026-02-1413:46

        At-least as far back as 2017 when I wrote Schillsaver: https://github.com/Valkryst/Schillsaver

        None of us, in the original discussion threads, knew of it being done before then IIRC.

      • By altmanaltman 2026-02-1420:58

        I mean, it is pretty likely they figured out it could be a pretty obvious possible misuse before anyone actually started doing it.

  • By j-bos 2026-02-1410:271 reply

    This ia really cool but also feels like a potential burden on the commons,

    • By vasco 2026-02-1410:474 reply

      That great commons that are the multi trillion dollar corporations that could buy multiple countries? They sure worry about the commons when launching another datacenter to optimize ads.

      • By agnishom 2026-02-1410:592 reply

        You are right, but YouTube is also a massive repository of human cultural expression, whose true value is much more than the economic value it brings to Google.

        • By anjel 2026-02-1412:182 reply

          So was Flickr

        • By komali2 2026-02-1411:012 reply

          Yes, but it's a classic story of what actually happened to the commons - they were fenced and sold to land "owners."

          Honestly, if you aren't taking full advantage within the constraints of the law of workarounds like this, you're basically losing money. Like not spending your entire per diem budget when on a business trip.

          • By agnishom 2026-02-1411:571 reply

            This seems like a narrow understanding of value.

            Which do you think has more value to me? (a) I save some money by exploiting the storage loophole (b) The existence of a cultural repository of cat videos, animated mathematics explainers, long video essays continue to be available to (some parts of) humanity (for the near future).

            • By komali2 2026-02-1413:141 reply

              This is assuming doing A has any meaningful impact on B.

              Anyway in this situation it's less that YouTube is providing us a service and more, it's captured a treasure trove of our cultural output and sold it back to us. Siphoning back as much value as we can is ethical. If YouTube goes away, we'll replace it - PeerTube or other federated options are viable. The loss of the corpus of videos would be sad but not catastrophic - some of it is backed up. I have ~5Tb of YouTube backed up, most of it smaller channels.

              I agree generally with you that the word "value" is overencompassing to the point of absurdity though. Instrumental value is equated with moral worth, personal attachment, and distribution of scarcity. Too many concepts for one word.

              • By agnishom 2026-02-153:24

                "Siphoning back as much value as we can is ethical."

                I feel the same way. (Although, I am less sure of it.) However, I think backing up important parts of YouTube, as you have done, is a much better approach towards doing this.

      • By asah 2026-02-1413:402 reply

        no the "commons" in this case is the fundamental free-ness of YT - if abused then any corporations will have to shut it down...

        OTOH I'm 100.0% sure that google has a plan, been expecting this for years and in particular, has prior experience from free Gmail accounts being used for storage.

        • By justinclift 2026-02-1414:32

          > no the "commons" in this case is the fundamental free-ness of YT ...

          Hmmm, isn't the "free-ness" of YouTube because there were determined to outspend and outlast any potential competitors (ie supported by the Search business), in order to create a monopoly for then extracting $$$ from?

          I'm kind of expecting the extracting part is only getting started. :(

        • By rapnie 2026-02-156:31

          There is no "fundamental free-ness" for vids stored on YT. Videos are stored to serve the business plan of Youtube and under the rules Google sets for them, where they serve their advertisement and surveillance capitalism business.

          Looking at the Wikipedia page for "Commons" [0] the first meaning of commons "accessible to all members of a society" is not really true, unless "on the whim of the YT platform". The second meaning of "natural resources that groups of people (communities, user groups) manage for individual and collective benefit" is also not really true. There is no understanding that google will take any other than their own benefit into account. The third meaning of commons on that page is closest I guess to what is needed:

          > Commons can also be defined as a social practice of governing a resource not by state or market but by a community of users that self-governs the resource through institutions that it creates.

          And that is certainly not what Youtube can be considered to be. Youtube videos are not in the commons, but kept on a proprietary platform where the proprietor is the sole decider what happens to its availability there.

          [0] https://en.wikipedia.org/wiki/Commons

      • By szundi 2026-02-1410:50

        [dead]

      • By cheonn638 2026-02-1411:034 reply

        > That great commons that are the multi trillion dollar corporations that could buy multiple countries?

        Exactly which countries could they buy?

        Let me guess: you haven’t actually asked gemini

        • By cheschire 2026-02-1411:121 reply

          Have you? Assuming Google would want to not put all their chips on that one number and invest all available capital in the purchase of a nation, and assuming that nation were open to being purchased in the first place (big assumption; see Greenland), Google is absolutely still in a place to be able to purchase multiple smaller countries, or one larger one.

          • By arcticfox 2026-02-1411:24

            Greenland already has a wealthy benefactor, I'd be surprised if poor countries wouldn't be interested

          • By K0balt 2026-02-1411:37

            You don’t have to go ballistic!

        • By RobotToaster 2026-02-1412:38

          Nauru, possibly Tuvalu.

        • By russfrank 2026-02-1411:201 reply

          The USA.

          • By justinclift 2026-02-1414:33

            That one's not a "could" as it's already been done. ;)

HackerNews