converts a string of text into an mp4 with audio
Python 3 and ffmpeg
$ echo "Pick a lane and drive like hell." | python3 six_bit_mp4.py
A file called hexbit.mp4 should appear in the directory when it's done.
Takes a string from the command line then converts it to video and audio. The video is a series of varying patterns but the audio tends towards headache inducing frequencies. There's a 1000Hz low pass filter in the ffmpeg command to avoid those. If you want high tones that your dog will hate then comment it out.
-converts characters from strings into 6 bits: 'a' to '100100' and squishes them together
-then it puts the big bunch of bits together repeatedly until there's enough to make a 360x360 jpg
the first iteration will contain only the first letter of the string: PPPPPPPPP..
the second iteration: PiPiPiPiPi..
and so on until all the characters from the string are exhausted
- [0-9], [A-Z], [a-z], [_], [.]
'0' = '000000'
...
'.' = '111111'
Yeah this happened to me with VLC. I think the 2 fps rate is unusual and scrambles the media player's brain.
It's possible but you'll have to figure out how to make the audio accept the increased or decreased video byte rate. To increase try changing the mp4's pix_fmt to rgb8 and changing fps from 2 to 6.
Probably. You'll have to install ffmpeg which is free and available here: http://www.ffmpeg.org/download.html#build-windows
Then alter the subprocess.call command: - change ffmpeg to [ffmpeg directory]\ffmpeg.exe
- delete ', shell=True' from the end of the subprocess.call command
Yeah sure totally go for it and you don't even have to credit me. It's a public domain license.
If you build a twitter bot please let me know so I can make videos.
It uses int.to_bytes which isn't available in Python 2. Sorry!
#####If you have questions or whatever I'm on twitter as @happyhorseskull