This project consists of two main scripts: an encoder that converts files to a series of images and then to a video, and a decoder that reverses this process to recover the original file.
The encoder script converts a file into a series of images, which are then compiled into a video.
python encoder.py --encode <path_to_file> [--output <output_video_name>]
--encode
: (Required) Path to the file you want to encode.--output
: (Optional) Name of the output video file. Default is "output.avi".
python encoder.py --encode my_secret_file.zip --output encoded_file.avi
This command will:
- Convert
my_secret_file.zip
into a series of images. - Compile these images into a video named
encoded_file.avi
. - Delete the temporary image files.
The decoder script extracts images from a video and reconstructs the original file.
python decoder.py --decode <path_to_video> [--output <output_file_name>]
--decode
: (Required) Path to the video file you want to decode.--output
: (Optional) Name of the output file. Default is "restored_file.zip".
python decoder.py --decode encoded_file.avi --output recovered_secret_file.zip
This command will:
- Extract frames from
encoded_file.avi
as individual images. - Convert these images back into binary data.
- Save the reconstructed file as
recovered_secret_file.zip
. - Delete the temporary image files.
- Ensure you have the required dependencies installed (
opencv-python
,numpy
,Pillow
). - The encoder uses the FFV1 codec for lossless compression.
- The default image size is 1920x1080. Modify
IMAGE_SIZE
in the scripts if needed. - Temporary files are automatically cleaned up after processing.