A Rust CLI tool that encodes any file into a video that can survive YouTube's compression, allowing you to use YouTube as free cloud storage.
YouTube re-encodes all uploaded videos with lossy compression, which normally corrupts binary data. This tool uses a YouTube-resilient encoding scheme:
- Black & White pixels only — Maximum contrast survives compression
- 4×4 pixel blocks per bit — Redundancy protects against artifacts
- Brightness threshold decoding — Simple >128 = 1, else = 0
Each frame stores 7,200 bytes of data at 1280×720 resolution.
flowchart TD
A[📁 Input File/Directory] --> B{Password Provided?}
B -->|Yes| C[🔐 Create Encrypted ZIP Archive]
B -->|No| D[Create ZIP Archive]
C --> E[Add Header Metadata]
D --> E
E --> F[Split Data into Frames]
F --> G[Generate Black/White Pixel Blocks]
G --> H[Create PNG Frame Images]
H --> I[🎬 Encode to MP4 with FFmpeg]
I --> J[📹 Output Video File]
subgraph Header["Header (12 bytes)"]
E1[File Size: 8 bytes]
E2[FPS: 4 bytes]
end
subgraph Encoding["Pixel Encoding"]
G1[1 bit = 4x4 pixel block]
G2[Bit 0 = Black RGB 0,0,0]
G3[Bit 1 = White RGB 255,255,255]
end
flowchart TD
A[📹 Input Video File] --> B[🎬 Extract Frames with FFmpeg]
B --> C[Read Pixel Blocks from Frames]
C --> D[Sample Brightness per Block]
D --> E[Reconstruct Binary Data]
E --> F[Parse Header Metadata]
F --> G{Password Provided?}
G -->|Yes| H[🔓 Extract & Decrypt ZIP]
G -->|No| I[Extract ZIP Archive]
H --> J[📁 Output Files/Directory]
I --> J
subgraph Decoding["Pixel Decoding"]
D1[Sample 5 points per block]
D2[Average brightness]
D3["> 128 = 1, else = 0"]
end
flowchart LR
subgraph Local["Local Machine"]
A[📁 Files] --> B[Compress + Encrypt]
B --> C[📹 Video]
end
subgraph Cloud["YouTube Cloud"]
D[(YouTube Storage)]
end
subgraph Recovery["Recovery"]
E[📹 Downloaded Video] --> F[Decompress + Decrypt]
F --> G[📁 Restored Files]
end
C -->|Upload| D
D -->|Download| E
At 30 fps (default):
| File Size | Video Duration | Frames |
|---|---|---|
| 1 GB | ~1.3 hours | 138,889 |
| 5 GB | ~6.5 hours | 694,444 |
| 10 GB | ~13 hours | 1,388,889 |
At 15 fps:
| File Size | Video Duration | Frames |
|---|---|---|
| 1 GB | ~2.5 hours | 138,889 |
| 5 GB | ~13 hours | 694,444 |
| 10 GB | ~26 hours | 1,388,889 |
cargo build --releaseThe binary will be at ./target/release/youtube-storage
Compress a file:
youtube-storage compress --file mydata.zipCompress a directory:
youtube-storage compress --file ./my-folderCompress with encryption:
youtube-storage compress --file mydata.zip --password "your-secret-password"Creates mydata.mp4 (or my-folder.mp4) ready for YouTube upload.
Decompress without encryption:
youtube-storage decompress --file downloaded.mp4 --output ./restoredDecompress with decryption:
youtube-storage decompress --file downloaded.mp4 --output ./restored --password "your-secret-password"Works with videos downloaded from YouTube after processing. Files are extracted to the specified output directory.
-
Encode your files with encryption:
./target/release/youtube-storage compress --file ./my-documents --password "my-secure-pass" -
Upload
my-documents.mp4to YouTube (unlisted recommended) -
When needed, download the video from YouTube
-
Decode and decrypt back to original:
./target/release/youtube-storage decompress --file my-documents.mp4 --output ./restored --password "my-secure-pass" -
Verify your files are intact in
./restored/my-documents/
| Parameter | Value |
|---|---|
| Resolution | 1280×720 (720p) |
| Frame Rate | 30 fps |
| Block Size | 4×4 pixels per bit |
| Bits per Frame | 57,600 |
| Bytes per Frame | 7,200 |
| Encoding | Binary (black/white) |
| Output Format | MP4 (H.264) |
| File Size | Video Duration | Frames |
|---|---|---|
| 1 MB | ~5 seconds | 139 |
| 10 MB | ~46 seconds | 1,389 |
| 100 MB | ~8 minutes | 13,889 |
| 1 GB | ~1.3 hours | 138,889 |
- Binary encoding — Only two states (black/white), not 16 million colors
- Large pixel blocks — 4×4 = 16 pixels per bit provides redundancy
- High contrast — RGB(0,0,0) vs RGB(255,255,255) maximally separated
- Multi-point sampling — Decoder samples 5 points per block and averages
- Brightness threshold — Even if white becomes gray (200,200,200), it's still >128
This tool uses standard ZIP encryption (like zip -e), making encrypted archives compatible with standard ZIP tools:
- ZipCrypto encryption — Standard ZIP password protection
- Integrated with compression — Single-step zip + encrypt
- Cross-compatible — Archives can be extracted with
unzip, 7-Zip, etc.
When you use the --password option:
- Files are compressed into a ZIP archive
- Each file in the archive is encrypted with your password
- The encrypted ZIP is then encoded into the video
💡 Tip: For maximum security with sensitive data, consider pre-encrypting with GPG before compression.
- Video length — Large files create long videos (224 MB ≈ 36 minutes)
- Processing time — Encoding/decoding takes time for large files
- YouTube limits — Videos over 15 minutes require account verification
- Password recovery — No way to recover encrypted data without the password
- Always use encryption — Use
--passwordfor any sensitive data - Use unlisted — Keep videos unlisted to avoid attention
- Download highest quality — Always download the highest resolution available
- Save your password securely — Use a password manager
MIT
Warning
This tool is for educational purposes. Review YouTube's Terms of Service before using for storage. The authors are not responsible for any account actions or data loss.