Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
HbHbNr committed Feb 20, 2024
1 parent ab7a672 commit 2520470
Showing 1 changed file with 41 additions and 2 deletions.
43 changes: 41 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![GitHub Workflow Status](https://github.com/hbhbnr/binary2video/actions/workflows/codequality.yml/badge.svg)](https://github.com/hbhbnr/binary2video/actions/workflows/codequality.yml)

# binary2video
Convert binary files to videos, e.g. MP4/WebM/AVI/MKV, and back. Supports h.264, VP9, FFV1 level 1 and 3.
Convert binary files to videos, e.g. MP4/WebM/AVI/MKV, and back, with the help of [FFmpeg](https://ffmpeg.org/). Supports h.264, VP9, FFV1 level 1 and 3 video codecs.

## Usage

Expand Down Expand Up @@ -44,6 +44,45 @@ outfile The name and path of the binary file to which the original data shou
restored to.
```

## Installation

Copy `binary2video` and `video2binary` to a directory of your path, for example to `/usr/local/bin/`, and make them executable. Expects FFmpeg at `/usr/bin/ffmpeg`.

## Examples

### Basic example

Encode `LICENSE` into a .webm video with default settings:

./binary2video LICENSE LICENSE.webm

Decode `LICENSE_restored` from the .webm video:

./video2binary LICENSE.webm LICENSE_restored

Verify the original file and the restored file are identical:

$ md5sum LICENSE LICENSE_restored
1ebbd3e34237af26da5dc08a4e440464 LICENSE
1ebbd3e34237af26da5dc08a4e440464 LICENSE_restored

### Example with parameters

Encode [KeePass-2.56.zip](https://keepass.info/) into a .mp4 video with 0.5 frames
per second, 640 x 360 pixels frame size, using the h.264 codec:

./binary2video -f 0.5 -w 640 -h 360 -c h264 KeePass-2.56.zip KeePass-2.56.zip.mp4

Decode `KeePass-2.56.zip_restored` from .mp4 video:

./video2binary KeePass-2.56.zip.mp4 KeePass-2.56.zip_restored

Verify the original file and the restored file are identical:

$ md5sum KeePass-2.56.zip KeePass-2.56.zip_restored
d0c2b3155838aa7f59f35d52a5484d2e KeePass-2.56.zip
d0c2b3155838aa7f59f35d52a5484d2e KeePass-2.56.zip_restored

## Compatibility matrix

| Container vs. Codec | **h264** | **vp9** | **ffv1** | **ffv1l3** |
Expand All @@ -53,7 +92,7 @@ outfile The name and path of the binary file to which the original data shou
| **.avi** |||||
| **.mkv** |||||

Other containers have not been tested and may also work.
Other containers have not been tested but may also work.

## Internal process

Expand Down

0 comments on commit 2520470

Please sign in to comment.