tplay icon indicating copy to clipboard operation
tplay copied to clipboard

mpv or vlc plugin for video output

Open landonpoch opened this issue 11 months ago • 2 comments

Is your feature request related to a problem? Please describe. There are things that aren't supported by tplay that are supported by mpv and vlc, such as transport controls, streaming video sources instead of downloading them completely first, aspect ratio locking, etc... The assumption is that if tplay were provided as a video output plugin for these players, those features would be included.

Describe the solution you'd like Honestly, this is a great project. It is way more performant than libcaca and also has much better colors. I'm not aware of anything else that allows you to specify your character maps that is as good as this. If this were a video output option for those players, it would be awesome!

Describe alternatives you've considered I've looked around for other video output plugins for those players that are just as good and haven't found any. Using this direct is currently the best solution but it still has some gaps. Buffering and playing the video prior to downloading a whole file is one of the big gaps.

Additional context Honestly, I realize this is just an open source project so if you don't do it, no worries. I'm just appreciative of the great work you've already done. Looks great! Thanks man!

landonpoch avatar Feb 17 '25 05:02 landonpoch

Thanks for the kind words. Sorry for the late reply, I've been quite busy with my main job and neglected this fun side project.

I think this would be quite an interesting task!

In principle this should be possible with some work, since I can already tplay video streams from a webcam... I mean, the hard part is done by OpenCV, I'm merely wiring some things together.

Perhaps there is some clever command-line-fu that one can do to stream a video source to something like /dev/video0! I'll have a look once I have some down time

maxcurzi avatar Jun 28 '25 19:06 maxcurzi

@landonpoch so I tried some command line things (thanks chatgpt) and we can get something to work In a nutshell this:

sudo apt install v4l2loopback-dkms v4l2loopback-utils
sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="tplay_virtual_cam"
ffmpeg -re -i ffmpeg -re -i https://cdn.bitmovin.com/content/assets/art-of-motion-dash-hls-progressive/mpds/f08e80da-bf1d-4e3d-8899-f0f6155f6efa.mpd -f v4l2 /dev/video10

and on another command line

tplay /dev/video10 

And of course you can streamline this with a script, say tplays (s for stream) so that tplays <some stream> would do all the above for you.

It should be doable from within tplay, but I understand it's not the same thing as having a video output plugin for VLC, something I'll look into, and maybe hopefully is something up my alley with my limited skills

maxcurzi avatar Jun 28 '25 20:06 maxcurzi