Watch YouTube-Videos in surf-browser on PocketC.H.I.P


This thread is for any of you who are searching for a way to play YT-Videos in their browser on PocketC.H.I.P.
At first you need to get youtube-dl:
Exchange the preinstalled surf-browser with the one from

  • sudo apt remove surf
  • wget
  • gunzip surf-0.7.tar.gz
  • tar -xvf surf-0.7.tar
  • cd surf-0.7/

read through the README and install all dependencies (including libwebkitgtk-dev)

  • sudo make clean install

edit config.h to fit your needs (see my config.h at, I edited the default flags for scripts and plugins to disable javascript and plugins by default
add the WATCH-function from my example config.h
add a key binding to start WATCH to your config.h (see example config.h, I chose to use ctrl+w)
download (see attachment) to /home/chip/scripts/ (55 Bytes)

  • cd /home/chip/scripts
  • sudo chmod +x

change to your surf directory

  • sudo make clean install

install st from

now you can watch YouTube-Videos in your surf-browser
start surf:

  • surf

press ctrl+g and go to YouTube
search for any video, when you reach the video page, press ctrl+w (or whatever keybinding you chose) and the video should play in about a few seconds.
youtube-dl -q -f 36 -o- $1 | mplayer -fs -

ytvid starts youtube-dl and tells it to be quiet (-q), use videoformat 3gp,320x180, to fit on PocketCHIP’s screen (-f 36), output to stdout (-o-). $1 is the URL from surf, the output is then piped to mplayer, which is started in fullscreen (-fs) and the final dash tells mplayer to read from stdin

see youtube-dl --help and man mplayer for further details
and have fun, watching YouTube-Videos :wink:

Best way to play YT videos on Pocket CHIP
Media player tweaks
New PocketCHIP user, reactions/wishlist from a GUI Designer and Linux Noob

Im still waiting for my pocketchip to ship. If it’s not any trouble could you (or anyone else) post video or at least few screenshots


Here you go, here’s PocketCHIP playing TWiT’s interview with Dave about PocketCHIP:


because you can not upload videos to this Website, I posted a video of me, playing a YT-video on PocketC.H.I.P. here:

and here’s an image of my PocketC.H.I.P. running the current version of PocketHOME Marshmallow Edition:


I feel I need to record a video of me using the pocketchip upload it to youtube then make a video of me playing the youtube video of me using the pocket chip.


Your post reminds me of the massive headache I got trying to watch INCEPTION! It was was worse than the one I got trying to figure out the ending to the third Matrix movie!
But in all seriousness, I do like it when people can show off the the neat stuff they are doing, so keep the videos coming!
I guesstimate my Pocket C.H.I.P. ought to be here in a couple week, so I cannot wait to try this!


I go home with a day or two! im so excited to use my pocketchip


Mine is still in customs… One week down, and one more to go… I hope!


Thanks. It worked perfecly.


Which GTK and webkit are you using? Tried installing and still getting make errors, No package ‘webkit-1.0’ and No package ‘gtk±2.0’


it seems like you need to install the development-package:

  • sudo apt install libwebkitgtk-dev


Have been on vacation without my PocketChip. When I get settled I will try this. Thanks for the heads up.


I modified your submission to not require ‘st’ of suckless to work , but just use vala-terminal as is included already.

As soon as i remember where tf i left my pocketchip, i’ll package and share :wink:

The only issue it has is that vala-terminal doesn’t close automagically when the -e script is done. Tiny ctrl-D action required :stuck_out_tongue:


Is there any way to stretch the size of the video to cover the whole screen?


as I use a customized version of st instead of the vala terminal for easier copy and paste (without the touchscreen), I’ll stay with my version


Cool, did you post it somewhere?


You can make the mplayer script stretch the video to fullscreen;.
The command line in my script now is ;

youtube-dl -f 36 -o- $1 | DISPLAY=:0 mplayer -vf scale -zoom -xy 480 -fs -


not yet, I’m on holidays right now, I’ll post it, when I’m back home, in october


So here’s a link to my st.tar. I’m not quite sure if I just needed to customize config.h or also the c sources. If you’re curious, you can have a look for yourself :wink: It supports scrolling up and down with shift+up or shift+down (I applied a patch from and copy and paste with ctrl+shift+c and ctrl+shift+v (this can be achieved just by customizing config.h).


sweet :smiley: i’ll try it it in a bit