Hello everyone,
I just wanted to establish that it is possible to "listen" to youtube videos using mplayer in a TP-LINK MR3020 router.
This is not a post with a question about something then but rather an informative one. I thought it may be of interest to people using a router as a music player as I do. I didn't find anything specifically about mplayer-youtube on this device or other router actually, but luckily I found the qi-hardware project which is based on Openwrt.
I know it may sound odd to only listen to Youtube, but there are a lot of videos uploaded that are just music with still pictures.
For accomplishing it, I used the feed's definitions from:
src-git qipackages git://projects.qi-hardware.com/openwrt-packages.git
.
The branch used was AA. I had to tweak mplayer's Makefile a bit, but I don't know exactly what is that finally did the trick.
+libfaad2 +libffmpeg-full were added to the DEPENDS list and also --enable-x264-lavc and --enable-demuxer=FLV_DEMUXER as Configure arguments.
I don't know if all the changes are necessary but now it works.
It is necessary to add TARGET_CFLAGS+= -DFIXED_POINT to the Faad Makefile when building from AA feeds. I know that change is already in the feeds coming from trunk as an option in the menu.
After compiling and installing everything I installed python from the repos and then wget-ed the youtube-dl script.
I reused a cgi-ash script that I already had for controlling mpd and netcat + madplay, which in turn were being used for listening to Youtube through a much more complicated (ugly, really) setup involving a raspberry pi in another room doing the transcoding. The youtube API allow me to make a search and give me related videos and thumbnails. So from a WiFi-equipped cellphone it can all be controlled.
My scripts are really messy and ugly as I stop thinking after they do what I want. What I mean is they are certainly not efficient. I know some day I'll have to rewrite them all. Also, using python in such a small device is a bad idea because there is like a 20 second delay until youtube-dl gets the link from youtube and I think that could be much faster if it was written in C for example. Just loading python in console takes like 5 seconds in this device.
If, as I said, this is of interest to anyone and/or you have a question about it, please feel free to email me.
Cheers,
Guillermo.