Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

pipetogrep

macrumors 6502
Original poster
Jan 27, 2021
349
499
Hi all,

tl;dr Get it here. https://github.com/llamallama/ibookg4linux/blob/main/bin/gimmevideo. Run this on Linux with xclip installed and set the GIMME_VIDEO_HOST environment variable to the location of your remote SSH server.

I wrote a script that does the work of downloading videos from multiple sources and transcodes them on a remote server before sending the video data back via SSH to be played locally on my iBook G4. The process is very quick and happens in real time.

Why would I do this? Let's use TikTok as an example. There is only one video quality available from TikTok and this laptop is too anemic to play it at full speed. It's also far too slow to transcode it on the fly via ffmpeg as well. So I figured why not let another machine do the work of downloading and converting the video while the iBook is only responsible for playing it.

The end result is this script. Please note that it assumes it will be running on Linux with the xclip command installed, but could be easily modified to work on OS X. To use it, set the environment variable "GIMME_VIDEO_HOST" to the location of your remote server. Then install xclip and copy a video URL to your clipboard. After that it can be ran. I suggest binding the script to a hot key.

If it's a Youtube video, it uses youtube-dl locally and sends it to mplayer. For any other video source, it SSHes into the remote host, pipes youtube-dl to ffmpeg, and then pipes the output of that to mplayer on your local machine.

The whole process is now as easy as copying a video link and pressing the bound hotkey. So far I have tested with Youtube, TikTok, Twitter, and Instragram but it should work for almost any source that youtube-dl supports. I now have access to far more video sources than I normally would with existing tools like PPC Media Center.
 

alex_free

macrumors 65816
Feb 24, 2020
1,103
2,357
Hi all,

tl;dr Get it here. https://github.com/llamallama/ibookg4linux/blob/main/bin/gimmevideo. Run this on Linux with xclip installed and set the GIMME_VIDEO_HOST environment variable to the location of your remote SSH server.

I wrote a script that does the work of downloading videos from multiple sources and transcodes them on a remote server before sending the video data back via SSH to be played locally on my iBook G4. The process is very quick and happens in real time.

Why would I do this? Let's use TikTok as an example. There is only one video quality available from TikTok and this laptop is too anemic to play it at full speed. It's also far too slow to transcode it on the fly via ffmpeg as well. So I figured why not let another machine do the work of downloading and converting the video while the iBook is only responsible for playing it.

The end result is this script. Please note that it assumes it will be running on Linux with the xclip command installed, but could be easily modified to work on OS X. To use it, set the environment variable "GIMME_VIDEO_HOST" to the location of your remote server. Then install xclip and copy a video URL to your clipboard. After that it can be ran. I suggest binding the script to a hot key.

If it's a Youtube video, it uses youtube-dl locally and sends it to mplayer. For any other video source, it SSHes into the remote host, pipes youtube-dl to ffmpeg, and then pipes the output of that to mplayer on your local machine.

The whole process is now as easy as copying a video link and pressing the bound hotkey. So far I have tested with Youtube, TikTok, Twitter, and Instragram but it should work for almost any source that youtube-dl supports. I now have access to far more video sources than I normally would with existing tools like PPC Media Center.
This is really interesting, piping over SSH. This is like the opposite of what PPCMC wants to do which is just use PowerPC hardware to achieve its goals. Really cool to see more unique ideas being implemented on our beloved hardware!

Instead of an environment variable, have you considered using an argument instead? You could even have this generate a config file once when using an argument, and then never have to specify it again.
 

pipetogrep

macrumors 6502
Original poster
Jan 27, 2021
349
499
This is really interesting, piping over SSH. This is like the opposite of what PPCMC wants to do which is just use PowerPC hardware to achieve its goals. Really cool to see more unique ideas being implemented on our beloved hardware!

Instead of an environment variable, have you considered using an argument instead? You could even have this generate a config file once when using an argument, and then never have to specify it again.
Good call on using an argument. I’ll definitely implement that. I also want to revise it so it’ll work on both OS X and Linux.

Thanks!
 
  • Like
Reactions: alex_free
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.