Skip to content

bsikar/video-to-ascii

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

video-to-ascii

A simple rust video to ascii converter

video-to-ascii 0.1.0
Brighton Sikarskie <bsikar@tuta.io>
A simple rust video to ascii converter

USAGE:
    video-to-ascii [OPTIONS] --input <INPUT>

OPTIONS:
    -a, --show_ascii <SHOW_ASCII>
            Should the output show ascii or not [default: true] [possible values: true, false]

    -c, --show_color <SHOW_COLOR>
            Should the output show color or not [default: true] [possible values: true, false]

    -f, --filter <FILTER>
            The filter used to resize the image [default: nearest] [possible values: nearest,
            triangle, catmullrom, gaussian, lanczos3]

    -h, --height <HEIGHT>
            The height of the output image
            If no height is given then it will scale the height based off the specified width, but
            if no width is specified then the input video's dimensions will be used

        --help
            Print help information

    -i, --input <INPUT>
            This is the video you are converting to ascii

    -o, --output <OUTPUT>
            This is the output file, if not specified, stdout is used

    -p, --pixel_size <PIXEL_SIZE>
            The pixel size used to resize the image [default: 16]

    -V, --version
            Print version information

    -w, --width <WIDTH>
            The width of the output image
            If no width is given then it will scale the width based off the specified height, but if
            no height is specified then the input video's dimensions will be used

    -x, --show_inverted <SHOW_INVERTED>
            Should the output's color be inverted or not [default: false] [possible values: true,
            false]

Be careful with you dimentions because you can make come VERY large frames, e.g this 20480x11520 frame that I made by mistake. If your compiliation times are off the charts your dimentions might be too high, this one frame took me over an hour on my computer.

This program works by taking an input video such as assets/videos/big_buck_bunny_720p_1mb.mp4 then applying flags on it

input video

The input video can be any video format

big_buck_bunny_720p_1mb.mov

output videos

The output video van be any format regardless of the input video's format. The video can be either played in the terminal or saved to a file. If the video is played in the terminal its frame rate is going to be based off how fast the terminal can draw the characters.

terminal

cargo run -- -i assets/videos/big_buck_bunny_720p_1mb.mp4 -a true -x true -c true
terminal.mov

file

cargo run -- -i assets/videos/big_buck_bunny_720p_1mb.mp4 -o ascii_inverted_color.mp4 -h 100 -a true -x true -c true
ascii_inverted_color.mov
cargo run -- -i assets/videos/big_buck_bunny_720p_1mb.mp4 -o ascii_inverted.mp4 -h 100 -a true -x true -c false
ascii_inverted.mov
cargo run -- -i assets/videos/big_buck_bunny_720p_1mb.mp4 -o ascii_color.mp4 -h 100 -a true -x false -c true
ascii_color.mov
cargo run -- -i assets/videos/big_buck_bunny_720p_1mb.mp4 -o ascii.mp4 -h 100 -a true -x false -c false
ascii.mov
cargo run -- -i assets/videos/big_buck_bunny_720p_1mb.mp4 -o inverted_color.mp4 -h 100 -a false -x true --c true
inverted_color.mov
cargo run -- -i assets/videos/big_buck_bunny_720p_1mb.mp4 -o inverted.mp4 -h 100 -a false -x true --c false
inverted.mov
cargo run -- -i assets/videos/big_buck_bunny_720p_1mb.mp4 -o color.mp4 -h 100 -a false -x false --c true
color.mov
cargo run -- -i assets/videos/big_buck_bunny_720p_1mb.mp4 -o none.mp4 -h 100 -a false -x false -c false
none.mov

Contributing

Contributions to the project are welcome. If you find a bug or want to add a feature, feel free to open an issue or submit a pull request.

License

The code in this project is licensed under the MIT License. See the LICENSE file for details.

About

A simple rust video to ascii converter

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published