This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| bts:badapple [2026/02/01 18:26] – created Yuki | bts:badapple [2026/02/01 20:42] (current) – Yuki | ||
|---|---|---|---|
| Line 7: | Line 7: | ||
| </ | </ | ||
| - | It should play a video. Yeah. It's impressive because curl doesn't play videos. There' | + | It should play a video. Yeah. It's impressive because curl isn' |
| + | |||
| + | how tf did you do that, you say??? | ||
| + | |||
| + | ===== step 1: convert mp4 to braille ===== | ||
| + | |||
| + | <code bash> | ||
| + | # convert movie to a series of PNGs | ||
| + | ffmpeg -i badapple.mp4 badapple%04d.png | ||
| + | # then convert each PNG using img2braille | ||
| + | clear > badapple.txt | ||
| + | for i in *.png; do | ||
| + | tput home | ||
| + | img2braille -d $i | ||
| + | done > badapple.txt | ||
| + | </ | ||
| + | |||
| + | ===== step 2: uuuuh, do something ===== | ||
| + | |||
| + | Now dump badapple.txt on a web server and it should work, right? Yeah it's going to be too fast so we probably should slow it down. | ||
| + | |||
| + | <code bash> | ||
| + | curl --limit-rate 343230 localhost/ | ||
| + | </ | ||
| + | |||
| + | Okay, no. Too many drop frames. Maybe we should do this server-side. | ||
| + | |||
| + | <code php> | ||
| + | <?php | ||
| + | $file = " | ||
| + | |||
| + | header(' | ||
| + | header(' | ||
| + | |||
| + | $h = fopen($file, | ||
| + | |||
| + | echo fread($h, 11); | ||
| + | |||
| + | $time = microtime(true); | ||
| + | while(!feof($h)) | ||
| + | { | ||
| + | echo fread($h, 11441); | ||
| + | time_sleep_until($time+1/ | ||
| + | $time = microtime(true); | ||
| + | } | ||
| + | </ | ||
| + | |||
| + | Yeah, it kinda works, now, now to put subtitles and why not a progress bar and also credits at the end and now it's 200 lines of code aaaaa | ||
| + | |||
| + | ===== TODO ===== | ||
| + | |||
| + | * japanese characters? | ||
| + | * sixel | ||