• Stars
    star
    143
  • Rank 257,007 (Top 6 %)
  • Language
    Python
  • License
    MIT License
  • Created 9 months ago
  • Updated 9 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Converting files to video

Cloud storage is a popular way for people to upload and share files online, but it often comes at a cost. YouTube is a service that allows for unlimited uploads, and if one could leverage video formats to convert files into video, you could theoretically share files online through YouTube videos that others can download and convert.

This project turns files into videos where each pixel is read left to right, row by row, in clusters of five pixels where black represents a binary digit '1' and white represents a binary digit '0'. Each frame is a new chunk of data, where each frame at the default 5x5 pixel size can store approximately 10kb of data. At the full size of a 1080p frame, it can store approximately 0.26MB of data per frame. We do not use this though, as this is too fragile for commonly used compression algorithms.

This is a proof of concept and should not be used as a legitimate replacement for Google Drive. Users should also not use this to store sensitive files.

Execution

To execute this project you'll need to install the dependencies included in the requirements.txt file. Navigate to the folder in a terminal and run the following command.

  pip install -r requirements.txt

Prepare the file you want for encoding and modify the source code of encoder.py to add the input and output files. You can also add music to the video if you wish, where the function to do so is commented out. Run:

  python encoder.py

This will take some time. Larger files require more RAM, and a 100MB file was observed to use 100GB of RAM. This is not a practical way of storing files.

Documentation

This program was written for an article on XDA-Developers by Adam Conway, Lead Technical Editor of the site.

XDA-Developers article