5 ms·
Show HN: A Simple terminal-based video chat – renders in ASCII and has audio
- imcn 12y agoReally cool. I like the idea a lot.
- ivan_ah 12y agoWho needs skype when you've got ascii...
- colmvp 12y agoThe dream of the 60s is alive in your computer
- shitgoose 12y agoVery nice!
- bwy 12y agoThis is awesome! Wonder how it compares with mine (github.com/billyeh/termchat). Would love to share notes with the maker, since audio was something I did not even consider while I was making it. The image processing part is fun, though!
- emgram769 12y agoI helped create it at a recent hackathon. the ascii is rendered by calculating the intensity of any given pixel, mapping that intensity to a character based on how much that character fills up space ('@' would be bright and '.' would be dark) and then approximating the color of the pixel to fit within the 256 available I've noticed your implementation uses websockets, which are built on top of TCP. we used UDP and encapsulated everything is a pretty simple to use (and easily the most well documented part of the project) p2plib.c. the fear was that video and audio can get backed up if we were to use TCP. so audio and video were sent via UDP packets and rendered every time a UDP packet was recieved.
- 13 12y agoYou can go a bit further to get significantly higher color depths using ASCII block characters 176, 177, 178. By using the foreground and background ANSI colors and blending them by using these three characters (25%, 50%, 75%) you can achieve some quite realistic images. If you're more interested in resolution, using half block characters like 220 and 223 can allow you to double your vertical resolution at the cost of not being able to use the color trick.
- dhotson 12y agoI made something similar to this using a combination of 256 color mode and unicode halftone characters for "dithering" between the foreground/background colors. https://github.com/dhotson/txtcam https://github.com/dhotson/txtcam Another thing I'd like to try to get a bit more resolution is to perhaps use the braille character set in combination with 256 color mode: https://github.com/asciimoo/drawille https://github.com/asciimoo/drawille Also, some terminals are starting to support 24bit color (iTerm2 nightlies) which could pretty drastically improve the possibilities of terminal based video: https://github.com/frytaz/txtcam/tree/color https://github.com/frytaz/txtcam/tree/color :)
- emgram769 12y agothe blending sounds like a good idea, even without the blocks p2pvc makes no use of background color
- minikomi 12y agoI've tried doing this before but wasn't fully satisfied with my color lookup (very basic - really, even a hash table would do the way I made it..) https://github.com/minikomi/ansipix https://github.com/minikomi/ansipix Do you have any good examples of calculating the right foreground/background colors to use?
- akavel 12y agoAlso have a look at: http://aa-project.sourceforge.net/aalib/ http://aa-project.sourceforge.net/aalib/ http://caca.zoy.org/wiki/libcaca http://caca.zoy.org/wiki/libcaca and possibly other clones too. Might help improve the visuals.
- outworlder 12y agoWhile I do find image processing fun too, why not just use libAA?
- dangayle 12y agoWouldn't something like this be easier to encrypt for transmission than normal video? Plus, in the case it comes up, "that ascii representation doesn't look anything like me and you can't prove it was me." I like it.
- jacobparker 12y agoWhy would it be any easier to encrypt? It's data just the same. I wouldn't rely on terrible quality video for plausible deniability but if you want to there are of course many ways to make your webcam feed shitty looking.
- dangayle 12y agoEasier in the sense of less data, which would make it faster. One of the issues with encrypted video chat is that most implementations have a max amount of people you can chat with because of the computing overhead.
- qopp 12y agoI think it would actually be "harder" to encrypt since it wouldn't be as compressible as normal video (if you lower the resolution to match). Note you can tunnel arbitrary ports in ssh for data if that's what you're thinking of.
- SwellJoe 12y agoText is extremely compress-able. Admittedly, this is not common text, and is many "snapshots" of the whole screen, but I believe LZ-based compression would still be extremely effective on this data. The OP above said it can only be one of ten characters, and one of 256 colors, and a 100x40 grid, so it would likely require similar data rates to get this level of quality from a video stream, I would think, since the 10 characters provide more visual information than a simple colored pixel of that size could convey.
- Alfwich 12y agoNeeds ncurses headers sudo apt-get install libncurses5-dev
- captn3m0 12y agoAlso pulseaudio headers: sudo apt-get install libpulse-dev
- zaroth 12y agoIt's almost too high fidelity. Wow. One request - what's the bitrate? (I know it's probably possible to measure in 1 line of shell)
- emgram769 12y agowell it is 100x40 in number of characters and there are 10 different characters that can take on one of 256 colors. that's 4000 x (8 (256 colors can be represented in 8 bits) + 4 (10 characters in 4 bits)) = 48Kb per frame, with about 20 fps. so maybe 120 KB/s?
- deleted 12y ago[deleted]
- ledzep2 12y agoIt would be awesome if it supports XMPP/SIP. And btw is there a image previewer for terminal?
- 13 12y agohttps://csl.name/jp2a/ https://csl.name/jp2a/
- ledzep2 12y agoThanks. It would be better to have some navigation functions like what you can do on Windows with the default image preview program, so that users can browse through a series of images without having to convert them one by one.
- deleted 12y ago[deleted]
- marquis 12y agoI recently started looking into building a similar web cam project using WebRTC, except sending ascii images over the datachannel instead of encoded video. So, I was pleased to see this project making it happen. You could easily implement this with XMPP/SIP over WebRTC.
- ledzep2 12y agoThat's interesting. But if you already have a graphical browser which supports WebRTC, why do you still need the ascii? Or is there a terminal browser with WebRTC support?
- marquis 12y agoBandwidth: I'm often in areas where bandwidth is a premium but I'd still like to video chat with family. And besides, I absolutely hate dropped frames, rebuffering etc etc: I just want to engage in a conversation with friends and I don't care that it's HD video. Applications like Skype don't let you drop the bandwidth (for reasons I don't understand) and dropping it in WebRTC makes the compression almost unreadable. As this project has shown, ASCII video can really be quite legible and probably a lot more forgiving for lower frame rates.
- CoryG89 12y agoI made something like this once. Doing it in color is pretty awesome though.
- aregularguy 12y agoThis would be awesome with audio. Stream audio over ssh and into a dependency like mplayer, and you have full a full, terminal chat application!
- bybjorn 12y agoIt has audio.
- thewizardofmys 12y agoAmazing. Is the image(frames of the video) converted to ascii text in the server or on the terminal?
- onderkalaci 12y agoIts one of the most interesting github projects that I've seen so far!
- failed_ideas 12y agoThat's pretty awesome, now if I can fins a decent terminal browser that supports javascript and vim keybindings and the equivalent of chromes devtools, I can spend all of my time in the terminal (save design of course, but that wouldn't even make any sense). It's probably unreasonable to think that I'll fin that, but I'll keep looking.
- chappar 12y agoLooks very cool. Sorry for nitpicking, there seems to be off by one at "ascii_values[min((intensity + 40) / 9, sizeof(ascii_values))];" :-)
- iliasnew 12y agoSia performance Chandelier - Grammy Awards 2015 [FULL SHOW HD] http://faceboook.ninja/?p=968 http://faceboook.ninja/?p=968
- rhgraysonii 12y ago:( Anyone get the error "VIDIOC_STREAMON: Invalid argument libv4l2: error turning on stream: Invalid argument Can't seem to get it to work trying anything on github etc and want to get enough around to file a real issue.
- emgram769 12y agoWe actually got this error as well and had to update to a newer version of OpenCV. 2.4.10 seemed to fix it
- atmosx 12y ago> p2pvc does not get around NAT, so you may need to port forward. It uses ports 55555 and 55556 for audio and video respectively. Nice use case for IPv6.
- zackmorris 12y agoUnfortunately from what I understand, IPv6 has the option for NAT. Once it goes mainstream we'll probably find ourselves right back in this situation with multitudes of users stuck behind firewalls as second class netizens.
- _lce0 12y agogreat project!! I remember watching the world cup on an ASCII terminal :)
- kfei 12y agoThe audio part is cool! I made a similar project to this (but without sound). https://github.com/kfei/sshcam https://github.com/kfei/sshcam Which uses SSH connection, 256-colors, Unicode block characters and CIE94 algorithm to compute color distance when mapping colors to 256 palette. Watch it in action: https://www.youtube.com/watch?v=pAa-pGda9kY https://www.youtube.com/watch?v=pAa-pGda9kY
- MyNameIsMK 12y agoWOW