12

I already found how to watch YouTube videos in terminal, in ASCII mode, but my goal is to watch them in a bash session, without opening a different window.

So, supposing I already have a tmux session, and I do:

$ watch-youtube <video-url>

I want to watch it there, in that tmux window/pane (split).

How can I do that?


Relevant output

$ mpv --vo help
Available video outputs:
  vdpau          : VDPAU with X11
  opengl         : Extended OpenGL Renderer
  xv             : X11/Xv
  sdl            : SDL 2.0 Renderer
  opengl-old     : OpenGL (legacy VO, may work better on older GPUs)
  vaapi          : VA API with X11
  x11            : X11 ( XImage/Shm )
  null           : Null video output
  image          : Write video frames to image files
  opengl-hq      : Extended OpenGL Renderer (high quality rendering preset)
  wayland        : Wayland SHM video output

1 Answer 1

13

libcaca will display in your current terminal if $DISPLAY is not set. So you can do something like:

DISPLAY= mpv --quiet -vo caca 'https://www.youtube.com/watch?v=bvYgBty6nJs'

The same trick works with mplayer, though it doesn't (AFAIK) have integrated libquvi support, so you have to extract the video URL to pass it.

9
  • 1
    Getting [vo] Video output caca not found! Error opening/initializing the selected video_out (-vo) device. -- only audio is working Oct 9, 2014 at 16:41
  • @IonicăBizău is your mpv built without libcaca? Check mpv --vo help and see if its there. I'm using mpv 0.6, by the way.
    – derobert
    Oct 9, 2014 at 16:43
  • Probably? See the update. Oct 9, 2014 at 16:44
  • 1
    Yeah. So to use caca with mpv, you'd have to recompile it with caca support. Or use mplayer (if your mplayer has caca) as in the question you linked to. The key thing is that DISPLAY= part, to keep it from popping up a new window.
    – derobert
    Oct 9, 2014 at 16:46
  • 1
    @IonicăBizău I even tried starting three videos in three different panes (tried with both mpv and mplayer1); using bash in a fourth was still just fine. Maybe it's your terminal emulator collapsing? I'm using xterm.
    – derobert
    Oct 9, 2014 at 17:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.