Ascii video converter/translater?

Hi there !

I was thinking, if there any way in vvvv to translate a video stream into ascii ? I saw in user screen some nice ascii visuals (that"s what made me think of it ), but didn’t really find a way to do that. Maybe by tracking lightness types and replaces them with respective character (I did that one time in After Effects) but don’t really kno how to replace with character in vvvv (and the best way could be to do that with colors also by the same way, like aalib and libcaca does, which provide a mix between ANSI and ASCII ).
any idea ?

Here it comes ;)

video2AscII.v4p (16.6 kB)

I like that ;D

fingers.zip (710.0 kB)

wow fast !! thanks so much :D I’m going to try them now :3

hi !

I’ve tried your video2ascii patch, really seems powerful but I got little troubles with it.

the Sift filter index output always give an empty value, it seems that he never get e hit while comparing steps with HSV value output stream. (and I’ve tried it with many video file)

But what is weird is that, when I link HSV saturation or Hue output to the sift, it works, it finds lots of hits, and so display characters (but don’t create proper ascii image cause it should do it with image values)

after that, I tried to change randomly step values and finally manage to get characters , but a bit messy composition, not visually corresponding to the video, it seem that the sift filter output just return spreads with around 15 to 30 values (from 2500 incoming frome HSV, so it just repeat a small amount of values in the GDI renderer, that’s why ascii visualk don’t correspond I think )

Do you know a way to find good steps ? (maybe it depends on the video source ?) or maybe it should work a bit better using value ranges and not steps, I’ll try to find a way to do that on your patch , I don’t know really how, but i’ll try and feedback here ^^ )

Here is it !

I finally manage to do it with ranges, so the ascii translation works pretty good (just need to choose a better “character gradient”) and the video displayed in the IOBox is quite nice to see (if you like this kind of geek stuff ^^ )

now i’ll try to work also with color blocks behind letters (like aalib does, cause it’s really “beautiful” :D )

here is the modified patch :

video2AscII.v4p (30.9 kB)

Sounds strange, couldnt repeat this.
But you can use map node either for remapping values. It makes your patch smaller…

video2boxes.v4p (23.6 kB)

a yeah Map is perfect for that, (I’d never use it before) thanks ^^ !

Do you know if there is any way to replace, ine the substitute node, letters with ANSI blocks or special characters for example like this : ▓ ▒ ░

in fact they are encoded with the arial font, but vvvv don’t display them in the IOBox.

Okay, thats a hard one ;)
Do you know Mr. Inspektor (Ctrl+I)? With this guy you can set some “hidden” features of nodes. IOboxes do have a lot of them. You can change their appearance widely by this.
At Iobox (Sting) you can set your font via Inspektor. Default is Lucida. So, first you should set it to Arial.
Second step would be to change your bit depth of typeset from 8bit (Ansi) to 16bit (UTF8), which gives you more letters by this. So, every special letter in Arial font beyond 256 (8bit) needs UTF8 encoding to being visible. You can set encoding by Ispektor either.
Be aware that you have to set all ioboxes and string nodes in a line to UTF8 to not to loose your bit depth. Unfortunately, some string nodes doesnt support UTF8. But dont ask me which ;D

AnsiAndUtf8.v4p (7.1 kB)

just a hint, the brightness to character selection can be done with a GetSlice string more efficient:

video2AscII_simpler.v4p (14.1 kB)

Great thanks to both of you !
(frank you’re right, I’m must be ashamed, I didn’t get a clear look in the inspektor , it’s easy to find -_- not enough coffee for me :) )

and yep tonfilm, this way is really lighter and smarter, thanks for that !

tonfilm: Nice one. Im always surprised how much more simple it can be done by V4.
crasse: I needed weeks to understand that whole UTF8 thing. And tons of coffee ;D

hi there , still playing with it , now i’m adding color information to the text, but I got a little probleme:

it works but seems to bo very heavy for the cpu (so the framerate gets really low) Is there a lighter way to do it ? (because what is weird is when I add color information to the brush inupt of Text, it keep good framerate (an add colors to the background of each character, but when I try to bring colors to characters directly it totally slows down )

anyway here is the colored way :

video2AscII_simpler.v4p (19.4 kB)

Mmmh, I cant see a difference (Im using 14.9)
But what about taking textures/PNGs of characters instead; either pre-colored or colorized by a shader? That should be faster as its being rendered by DX on graphic card and not in GDI renderer, which is being calculated on CPU.

To come back to simplification topic ;D You can save AsValue and AsString node by using GetSlice (Color) directly with colors instead of GetSlice (String) with detours.