Rust Magic using ffmpeg

2023-07-03

Software Engineering Project

This project is directly inspired by DvorakDwarf's ISG and David Buchanan's infamous tweet.

there's an infinite storage glitch in real life in theory you can actually use YouTube as a kind of hard drive but how does it work? all files are made up of bits at the lowest level a bit can be either 0 or 1. now in order to upload our files to YouTube we need to convert them into videos one way to do this is to generate bits by blocks of pixels in Black for zero and wide for oncontinuing this over multiple columns rows and image sequences files can actually be uploaded to YouTube in video form.
The basic principle behind this code is straightforward. All files are composed of bytes, which can be represented as numbers ranging from 0 to 255. These numbers can be associated with pixels using two modes: RGB or binary.[Each pixel typically consists of 8 bits (1 byte) for a Black and White (B&W) image or 24 bits (3 bytes) for a color image-- one byte each for Red, Green, and Blue.]
RGB mode: This mode is more visually appealing. Each byte can fit perfectly within one of the colors of an RGB pixel. One RGB pixel can accommodate three bytes at a time. By adding pixels in this manner, data can be represented efficiently and quickly. RGB mode is more robust against corruption compared to binary mode.
Binary mode: This mode arises from the need to handle the severe compression used in platforms like YouTube. RGB mode is susceptible to corruption since even a small alteration in one of the colors of a single pixel can lead to file corruption. Binary mode overcomes this by using black and white pixels. Each pixel can be bright, representing a 1, or dark, representing a 0. By stringing these bits together, bytes can be formed, and this process continues until all the data is encoded.
Both RGB and binary modes can be affected by compression, so to mitigate this issue, the size of the pixels is increased, making them less prone to compression artifacts. In binary mode, 2x2 blocks of pixels are typically used, which enhances the resilience of the encoded data. video codecs compress the video data and encode it into a format that can later be decoded and played back or edited. To simplify user interaction, all the relevant settings used to create the video are included in the first frame of the video. This allows the program to determine the video's mode and size automatically, eliminating the need for the user to remember and provide these details explicitly.
Why?
well i was always intrigued by different techniques of video codecs especially avi because it uses lossy compression which in return saves lot of space.
It is possible to compress many types of digital data in a way that reduces the size of a computer file needed to store it, or the bandwidth needed to transmit it, with no loss of the full information contained in the original file. A picture, for example, is converted to a digital file by considering it to be an array of dots and specifying the color and brightness of each dot. If the picture contains an area of the same color, it can be compressed without loss by saying "200 red dots" instead of "red dot, red dot, ...(197 more times)..., red dot."
The original data contains a certain amount of information, and there is a lower limit to the size of file that can carry all the information. Basic information theory says that there is an absolute limit in reducing the size of this data. When data is compressed, its entropy increases, and it cannot increase indefinitely. For example, a compressed ZIP file is smaller than its original, but repeatedly compressing the same file will not reduce the size to nothing. Most compression algorithms can recognize when further compression would be pointless and would in fact increase the size of the data.

drawbacks?
- The encoded file is 3 times bigger than the original.
- You stand to lose your files if something changes with the YouTube image compression algo.
Aim?
To be honest it aims at nothing because youtube will cease it when used extensively. It's for fun. I agree it's not an original idea. Because the same pre-exists but it was using mpv before but this is using ffmpeg.
How?
I uploaded a video on youtube click here.

Do you need source code?
Yes?
click here

Afterthoughts & Cleaning up

Since this looks so much like TV static. It makes me wonder. What if there are clandestine analogue TV stations broadcasting “static” that actually turns out to be data. If you’ve tried turning an analogue TV after the switch to digital, you’ll have noticed that there are still odd signals trying to get through in places. It would be interesting to try to decode them, just in case, if anyone has the hardware laying around to try.
How about someone putting highly illegal content of explicit nature in an encrypted zip file, and then using this technique to post it online for other people to obtain, download and decrypt. If I, a law abiding citizen, could figure this out, then criminally minded monsters would, too.
Now imagine, how would typical government respond? A lawsuit? A complete ban for YT and similar services? A new law that gives police power to officially trace and observe online activities of everyone?

It could be used to host malware binaries. As the data is stored on the YouTube server, a request to download the binary to the victims computer could be made very legitimate-looking as the request originates from a very trustworthy domain (in this case, YouTube) with SSL enabled. Ofcourse, this could be done using any site where you can save and read content. Files can be saved to text as well, and encrypted asynchronously to make is unreadable (and thus unidentifyable as malware).