Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/env bash
- #>okay. so how do I automate binary data into an image?
- # usage: script.sh <input> [<output>]
- if [ ! "$1" ]; then echo Specify an input.; exit; fi
- if [ ! -e "$1" ]; then echo \"$1\" doesn\'t exist.; exit; fi
- if [ "$2" ]; then output="${2%.*}.png"; else output="${1%.*}.png"; fi
- if [ -e "$output" ]; then echo Output exists, specify another name.; exit; fi
- size=$(bc <<< "sqrt($(stat -c%s "$1")/8)+0.5/1")
- cat "$1" /dev/zero - | ffmpeg -f rawvideo -s ${size}:${size} -pix_fmt rgba64be -i - -vframes 1 "$output"
- echo Playback with\:
- echo ffmpeg -i \"$output\" -f rawvideo - \| mpv -
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement