News for hackers. Stuff that matters.
Re:Show HN: Termplay: Play videos in your terminal by tilpner on Monday June 19, 2017 @06:27PM (#14590921)
I see these every so often, but they never mention Sixels, which could be used to display videos with much more detail (like with https://github.com/saitoha/FFmpeg-SIXEL ).

Sixels aren't widely supported, and the implementations I tried were lacking in stability, but they offer some interesting possibilities, like embedding images into your text browser (and not with a hack like w3m uses), or playing Battle for Wesnoth inside your terminal [ https://github.com/saitoha/libsixel ]

Re:Show HN: Termplay: Play videos in your terminal by tbodt on Monday June 19, 2017 @06:45PM (#14591002)
Honestly, the main reason I like this is the way videos look with huge pixels.
Re:Show HN: Termplay: Play videos in your terminal by jakeogh on Tuesday June 20, 2017 @07:30AM (#14593674)
Re:Show HN: Termplay: Play videos in your terminal by LEGOlord208 on Tuesday June 20, 2017 @12:34AM (#14592223)
I was looking for image libraries. I couldn't really find more than /dev/fb0. Cool, I'll look into sixel!
Re:Show HN: Termplay: Play videos in your terminal by LEGOlord208 on Tuesday June 20, 2017 @02:08PM (#14596990)
Update: Sixels now work. I just need to fix scaling. The image turns out REALLY small.
Re:Show HN: Termplay: Play videos in your terminal by Retr0spectrum on Monday June 19, 2017 @05:04PM (#14590450)
Mplayer can do this by default e.g.

    $ CACA_DRIVER=ncurses mplayer -quiet -vo caca video.avi
Here's the Silicon Valley intro in glorious ASCII: http://i.imgur.com/YKP6nfP.png

I had some audio sync issues with mplayer, and it sounds like termplay avoids that. I'm also not sure if there's a way to use true colour with mplayer.

Re:Show HN: Termplay: Play videos in your terminal by anonova on Monday June 19, 2017 @11:24PM (#14591978)
mpv has a true color terminal renderer.[1] It's not the fastest though: http://i.imgur.com/919Rez5.png

  $ mpv --vo tct https://www.youtube.com/watch\?v\=PA4InNa0NSQ
[1]: https://mpv.io/manual/master/#video-output-drivers-tct
Re:Show HN: Termplay: Play videos in your terminal by jakeogh on Tuesday June 20, 2017 @07:07AM (#14593540)
I had to --vo=tct (xterm was not happy around the letterbox borders!)
Re:Show HN: Termplay: Play videos in your terminal by LEGOlord208 on Tuesday June 20, 2017 @02:10AM (#14592525)
Yep, it does avoid sync issues... well, partly. It doesn't know anything about the audio as that is handled by a pretty high level library. But it does make sure the frames goes at the speed they should. So assuming the audio isn't lagging behind or ahead (which I haven't encountered yet), the image and audio should be synced.
Re:Show HN: Termplay: Play videos in your terminal by jitl on Monday June 19, 2017 @06:46PM (#14591004)
You should allow the user to specify a pixel ratio that describes the width/height of each character of their terminal font. Otherwise, your images will be distorted, because your output pixels are not square.

Here's a screenshot demonstrating this issue, when converting a GIF to text in a terminal:

https://monosnap.com/file/HwrGbSHEwxWlTQCCeXyd9qcFxwL38V.png

On the left, the original image. In the center, a ratio-perserved resized render in a terminal On the left, a pixel-ratio aware resized render.

Re:Show HN: Termplay: Play videos in your terminal by LEGOlord208 on Tuesday June 20, 2017 @12:22AM (#14592181)
Re:Show HN: Termplay: Play videos in your terminal by tobyjsullivan on Monday June 19, 2017 @05:31PM (#14590632)
Great! Now can we get this integrated with Lynx so that can be my default browser?
Re:Show HN: Termplay: Play videos in your terminal by tbodt on Monday June 19, 2017 @06:00PM (#14590780)
I can't wait
Re:Show HN: Termplay: Play videos in your terminal by name_for_now on Tuesday June 20, 2017 @01:22AM (#14592376)
I've written something similar myself in C++ before, but I'm curious if people actually have interest in using something like this regularly. I had thought I would do something like configure lynx to use it but the novelty quickly wore off and instead I went and started playing with the Mandelbrot set in the terminal and forgot all about it.
Re:Show HN: Termplay: Play videos in your terminal by LEGOlord208 on Tuesday June 20, 2017 @01:35AM (#14592417)
Cool!

I think that playing YouTube in the terminal today is just a fun idea because the videos look so goofy. But like people say... Sixel... Everything is apparently possible!

Someday, somebody will make the whole YouTube platform.

Re:Show HN: Termplay: Play videos in your terminal by mfukar on Tuesday June 20, 2017 @03:25AM (#14592752)
It's 2017 and we still don't have a single decent bitmap terminal.
Re:Show HN: Termplay: Play videos in your terminal by majewsky on Tuesday June 20, 2017 @05:51AM (#14593263)
xterm and Konsole allow to display images in the terminal. To check it out, install w3m with the w3m-img patch (in Debian, the "w3m-img" package; in Arch Linux, the "w3m" and "imlib2" packages) and open a webpage that contains plain <img src="..." /> tags.

Example screenshot from Konsole: https://imgur.com/a/D98Kl (showing https://en.wikipedia.org/wiki/xterm)

The rendering is really buggy. Images glitch away all the time, possibly until w3m issues a redraw event, but it kinda sorta works.

Some day, I'll have to dig into either the w3m source or the Konsole source and figure out which ANSI escapes are being used for that. (If someone has a link to a spec or sth, that'd be much appreciated.)

Re:Show HN: Termplay: Play videos in your terminal by LEGOlord208 on Tuesday June 20, 2017 @11:39AM (#14595432)
You could do like the "fbi" tool, which uses the framebuffer (/dev/fb0) to draw to the screen. And that works for the TTY, but doesn't in Konsole.

Others have also told me about Sixels, so I'll probably add support for that at least.

Re:Show HN: Termplay: Play videos in your terminal by LEGOlord208 on Tuesday June 20, 2017 @02:48PM (#14597349)
Update: Sixels are now supported :)

Try it out with one of the terminals listed in https://github.com/saitoha/libsixel#terminal-requirements

Re:Show HN: Termplay: Play videos in your terminal by rnmp on Monday June 19, 2017 @04:35PM (#14590237)
From the creators of April Fools day…