πŸ’»Encode Context, Messages or Content into a QR Encoded Video (mp4)

Encode Context, Messages or Content into a QR Encoded Video (mp4)

About This Project

URL: https://github.com/tariusdamon/qrvid


Introducing the Zip-to-QR Code Converter & Reassembler

Ever needed to transfer or archive files without relying on traditional methods? Meet the Zip-to-QR Code Converter & Reassemblerβ€”a high-performance Python solution that turns your zipped files into a series of QR codes, and effortlessly reassembles them back into their original form.

What is it?

This Python project efficiently processes ZIP files, converting every file inside into QR codes wrapped with XML metadata. Each QR code holds up to 2048 characters of data, enabling secure and easy handling, even offline. The tool is versatile, handling both encoding (ZIP β†’ QR codes) and decoding (QR codes β†’ original files).


Key Features

  • Complete Zip Processing: Handles every file within your ZIP archive.
  • Dual-Mode Operation: Dedicated scripts for encoding and decoding tasks.
  • High-Performance: Optimized parsing to minimize memory usage.
  • Chunked Conversion: Files automatically split into manageable QR-code-friendly chunks.
  • XML Wrapping: Data is neatly wrapped within an XML structure for easy identification and reconstruction.
  • Sequential QR Generation: Each QR code is clearly numbered (e.g., 1.png, 2.png).
  • File Reconstruction: Reliable and straightforward file reassembly from QR scans.
  • Metadata & Integrity: Preserves original file structure with built-in SHA-256 checksum verification.
  • Agent Mode: Ideal for automated, unattended processing workflows.


Getting Started

Installation Steps

  1. Download or Clone:

    • Place project files into a directory (e.g., C:\qrvid).
  2. Dependencies:

pip install -r requirements.txt
  1. Verify Source:

    • Confirm your ZIP file is in the configured location (default: C:\huggingface\gpt-2-master.zip).

Project Structure

qrvid/
β”œβ”€β”€ src/
β”‚ β”œβ”€β”€ zip_processor.py
β”‚ β”œβ”€β”€ qr_encoder.py
β”‚ β”œβ”€β”€ qr_decoder.py
β”‚ β”œβ”€β”€ file_assembler.py
β”‚ β”œβ”€β”€ xml_wrapper.py
β”‚ └── utils.py
β”œβ”€β”€ images/ (generated QR codes)
β”œβ”€β”€ output/ (reconstructed files)
β”œβ”€β”€ temp/ (temporary files)
β”œβ”€β”€ encode.py
β”œβ”€β”€ decode.py
β”œβ”€β”€ requirements.txt
β”œβ”€β”€ config.yaml
└── README.md


How to Use

Encoding ZIP β†’ QR Codes

# Default encoding
python encode.py

# Custom ZIP and output location
python encode.py --input-zip "C:\path\file.zip" --output-dir "qr_codes"

# Adjust chunk size
python encode.py --chunk-size 1800

Decoding QR Codes β†’ Files

# Default decoding
python decode.py

# Custom directories
python decode.py --qr-dir "qr_codes" --output-dir "reconstructed_files"

# Enable integrity checks
python decode.py --verify-integrity

# Allow partial reconstruction
python decode.py --allow-partial --force-reconstruct

Diagnostic Mode

# Check QR integrity and identify issues
python decode.py --diagnose --qr-dir "images"


Configuration Options

Customize your process by editing config.yaml:

zip_path: "C:\\huggingface\\gpt-2-master.zip"
qr_output_directory: "images"
file_output_directory: "output"
max_chunk_size: 2048
qr_error_correction: "M"  # Options: L, M, Q, H
qr_box_size: 10
qr_border: 4
preserve_structure: true
calculate_checksums: true
verify_integrity: true

XML Payload Format

Every QR code contains XML-formatted data:

<doc page="1" x="@tariusdamon" file="model.py" chunk="1" total="5">base64_encoded_content</doc>
  • page: QR sequence number
  • x: Static identifier (e.g., @tariusdamon)
  • file: Filename and path
  • chunk: Current chunk number
  • total: Total chunks per file


Example Workflow

# Step 1: Encode ZIP to QR codes
python encode.py --input-zip "C:\huggingface\gpt-2-master.zip" --output-dir "qr_output"

# Step 2: Decode QR codes to files
python decode.py --qr-dir "qr_output" --output-dir "reconstructed"

Advanced Options

  • Encoding arguments: --input-zip, --output-dir, --chunk-size, --log-level, --agent-mode, --no-cleanup
  • Decoding arguments: --qr-dir, --output-dir, --verify-integrity, --allow-partial, --force-reconstruct, --diagnose


Troubleshooting Tips

  • ZIP Not Found: Verify your ZIP file path.
  • QR Code Issues: Try alternative QR libraries or check image clarity.
  • Missing Chunks: Run diagnostics or force partial reconstruction.
  • Checksum Errors: Bypass verification temporarily for recovery.


Performance Notes

  • Memory Optimization: Chunk processing keeps memory usage low.
  • QR Code Limits: 2048-character cap ensures reliable scans.
  • Integrity Assurance: SHA-256 checksums guarantee data integrity.


Dependencies

  • qrcode[pil], opencv-python, pyzbar, Pillow, PyYAML, tqdm, click


Licensing

This project is licensed for Non-Commercial Use (personal, educational, research, open source, and small businesses under \$100k revenue).

For Commercial Use (corporations, revenue-generating applications), please contact for licensing terms, which include priority support, custom development, and legal compliance.


Contributions Welcome!

Feel free to contribute by submitting issues or enhancement requests. Commercial contributors may need to sign a Contributor License Agreement (CLA).

Explore the power and versatility of the Zip-to-QR Code Converter & Reassemblerβ€”secure, efficient, and ready for any task.