Transcoding
|
Posts: 22
Threads: 1
Joined: Oct 2015
[Solved]
Nov 05, 2015, 01:22 AM
@Mike
So much crap these guys are messing with, I don't think they are directly countering this method but infact developing newer technologies, the problem is considering they are a fork of XBMC/Kodi you would think they would embrace arm, and freedom of choice or at the very least allow the transcoder on or off by the user for transcoding not the developers server side fed disallow scripts.
Posts: 22
Threads: 1
Joined: Oct 2015
[Solved]
Nov 05, 2015, 06:10 PM
(This post was last modified: Nov 06, 2015, 08:39 PM by tragidy.
Edit Reason: updated sh script
)
For those wanting one-click style installer here you go, does most things for you.
https://github.com/Tragidy/plex-scripts/
https://github.com/Tragidy/plex-scripts/...bserver.sh
Instructions:
wget https://raw.githubusercontent.com/Tragid...bserver.sh && bash plexwebserver.sh
Code:
#!/bin/bash
# PLEX ARM Chromecast bypass installer for Debian and Ubuntu
# By TRAGiDY https://github.com/Tragidy/
#
# Released Under Apache 2.0 License
# http://www.apache.org/licenses/LICENSE-2.0
# This script will work on Debian, Ubuntu, maybe other debian based distros
# of the same families, although no support is offered for them. It isn't
# bulletproof but it will probably work if you simply want issue one command
# on your Debian/Ubuntu box. It has been designed to be as unobtrusive and
# universal as possible.
clear
echo "PLEX ARM Chromecast bypass"
echo "script by TRAGiDY https://github.com/Tragidy/"
date;
echo "This script should be ran with root"
echo "Running this script as "$USER""
sleep 3
# Change DNS Servers, keeping Google DNS away however you are welcome to use them
echo "Using reliable DNS Servers"
rm -rf /etc/resolv.conf
touch /etc/resolv.conf
echo "nameserver 208.67.222.222" >> /etc/resolv.conf
echo "nameserver 208.67.220.220" >> /etc/resolv.conf
chattr +i /etc/resolv.conf
echo "DNS set to use OpenDNS, resolver file locked"
# Setup plex server ip
echo "Type the plex server ip that you want to set in hosts file, followed by [ENTER]:"
read plexip
#echo "$plexip app.plex.tv chromecast.plex.tv" >> /etc/hosts -- issue reported.
echo "$plexip app.plex.tv" >> /etc/hosts
echo "$plexip chromecast.plex.tv" >> /etc/hosts
echo "Setting plex services ip to $plexip"
sleep 2
echo "That's all we need proceeding with installation."
echo "Making sure system is up to date..."
echo "Running UPDATE Please Wait..."
apt-get update -y >/dev/null 2>&1 &
wait $!
echo "Updating packages completed"
clear
echo "Installing NGINX, DNSMASQ and OpenSSL"
apt-get install openssl dnsmasq nginx -y &
wait $!
echo "Installed Applications, creating folder structure"
# Create folders, download plex.js and change permissions
mkdir -p /var/www/chromecast/production/js
mkdir -p /var/www/webjs/web/js
cd /var/www/chromecast/production/js
echo "Folders created.. fetching latest chromecast plex.js"
wget http://chromecast.plex.tv/production/js/plex.js >/dev/null 2>&1 &
# Re-write Contribution by Mike @ HTPCGuides
wait $!
sed -i s'/canPlay:function(e,t){/canPlay:function(e,t){return false;/' plex.js
echo ".... fetching latest web client plex.js"
cd /var/www/webjs/web/js
wget http://app.plex.tv/web/js/plex.js >/dev/null 2>&1 &
wait $!
sed -i s'/validateTranscoder:function(e,t){/validateTranscoder:function(e,t){return false;/' plex.js
cd /
chown -R www-data:www-data /var/www
echo "Fetching javascript files complete"
sleep 1
# Create NGINX folders, and generating SSL
echo "HTTPD and SSL "
mkdir -p /etc/nginx/ssl
openssl req -x509 -nodes -days 36500 -newkey rsa:2048 -keyout /etc/nginx/ssl/nginx.key -out /etc/nginx/ssl/nginx.crt &
wait $!
touch /etc/nginx/sites-enabled/webjs
touch /etc/nginx/sites-enabled/chromecast
echo "server {" >> /etc/nginx/sites-enabled/chromecast
echo "server_name chromecast.plex.tv;" >> /etc/nginx/sites-enabled/chromecast
echo "listen 80;" >> /etc/nginx/sites-enabled/chromecast
echo "listen 443 ssl;" >> /etc/nginx/sites-enabled/chromecast
echo "" >> /etc/nginx/sites-enabled/chromecast
echo "ssl_certificate /etc/nginx/ssl/nginx.crt;" >> /etc/nginx/sites-enabled/chromecast
echo "ssl_certificate_key /etc/nginx/ssl/nginx.key;" >> /etc/nginx/sites-enabled/chromecast
echo "access_log /var/log/nginx/chromecast.plex.tv.access.log;" >> /etc/nginx/sites-enabled/chromecast
echo "error_log /var/log/nginx/chromecast.plex.tv.error.log;" >> /etc/nginx/sites-enabled/chromecast
echo "" >> /etc/nginx/sites-enabled/chromecast
echo "root /var/www/chromecast;" >> /etc/nginx/sites-enabled/chromecast
echo "autoindex on;" >> /etc/nginx/sites-enabled/chromecast
echo "}" >> /etc/nginx/sites-enabled/chromecast
echo "server {" >> /etc/nginx/sites-enabled/webjs
echo "server_name app.plex.tv;" >> /etc/nginx/sites-enabled/webjs
echo "listen 80;" >> /etc/nginx/sites-enabled/webjs
echo "listen 443 ssl;" >> /etc/nginx/sites-enabled/webjs
echo "" >> /etc/nginx/sites-enabled/webjs
echo "ssl_certificate /etc/nginx/ssl/nginx.crt;" >> /etc/nginx/sites-enabled/webjs
echo "ssl_certificate_key /etc/nginx/ssl/nginx.key;" >> /etc/nginx/sites-enabled/webjs
echo "access_log /var/log/nginx/app.plex.tv.access.log;" >> /etc/nginx/sites-enabled/webjs
echo "error_log /var/log/nginx/app.plex.tv.error.log;" >> /etc/nginx/sites-enabled/webjs
echo "" >> /etc/nginx/sites-enabled/webjs
echo "root /var/www/webjs;" >> /etc/nginx/sites-enabled/webjs
echo "autoindex on;" >> /etc/nginx/sites-enabled/webjs
echo "}" >> /etc/nginx/sites-enabled/webjs
# Complete
service nginx restart
clear
echo "Process complete, rock and roll!"
EOF
Posts: 1,646
Threads: 2
Joined: Aug 2015
Reputation:
42
[Solved]
Nov 05, 2015, 07:05 PM
Awesome work @tragidy, I love me some bash scripts ! Have you had time to rebuild the Plex chromecast app like @lukas did?
I completely agree with you @tragidy. I think we need to petition Plex to make it an advanced setting to toggle force transcoding on or off for arm devices. They can easily put a big warning sign saying 'enabling this option is not recommended and may produce undesirable results' but outright blocking it just seems overkill.
Posts: 22
Threads: 1
Joined: Oct 2015
[Solved]
Nov 05, 2015, 07:12 PM
(Nov 03, 2015, 07:39 AM)lukas Wrote: Hi Mike,
Yup, thanks, found it.
My plan is to:
1) Block the Google DNS servers (8.8.8.8, 8.8.4.4) in my router so that the Chromecast uses the router as DNS server.
2) Use dnsmasq on my router to redirect all requests to chromecast.plex.tv to my Raspberry Pi.
3) Install lighttpd on my Raspberry Pi and host a copy of the required files on it.
I have not tried this, but I will let you know the outcome.
(Nov 05, 2015, 07:05 PM)Mike Wrote: Awesome work @tragidy, I love me some bash scripts ! Have you had time to rebuild the Plex chromecast app like @lukas did?
I completely agree with you @tragidy. I think we need to petition Plex to make it an advanced setting to toggle force transcoding on or off for arm devices. They can easily put a big warning sign saying 'enabling this option is not recommended and may produce undesirable results' but outright blocking it just seems overkill.
Modding the app and re-signing the apk does not seem to work for me, i get chromecast errors, I am however able to use BubbleUPNP + Transcoding to avoid plex.tv to chromecast for the time being.
While I've not tested everything in the world, I used plex for android, set it to open files externally and select bubbleupnp as player, this may work with other apps like allcast and such but bubble allows for on-device transcoding or even remote pc transcoding at this time for me.
Posts: 1,646
Threads: 2
Joined: Aug 2015
Reputation:
42
[Solved]
Nov 05, 2015, 10:17 PM
Another great idea @tragidy, using BubbleUPNP you are just using the DLNA ability of Plex and bypassing the other plex.tv restrictions.
Are you saying the Chromecast is decoding the video on itself instead of having the Pi do the work? That is how I sort of expected the Chromecast to work with Plex but apparently it wants to transcode all the time for some strange reason.
Posts: 22
Threads: 1
Joined: Oct 2015
[Solved]
Nov 05, 2015, 10:34 PM
(This post was last modified: Nov 05, 2015, 11:00 PM by tragidy.)
(Nov 05, 2015, 10:17 PM)Mike Wrote: Another great idea @tragidy, using BubbleUPNP you are just using the DLNA ability of Plex and bypassing the other plex.tv restrictions.
Are you saying the Chromecast is decoding the video on itself instead of having the Pi do the work? That is how I sort of expected the Chromecast to work with Plex but apparently it wants to transcode all the time for some strange reason.
Hi,
Sadly this does not allow transcoding but will let us do what you said, the direct file, the app bubbleupnp will allow the device ( mobile/tablet ) to decode or can use the remote bubbleupnp pc app which the android app sends data to a pc on network, BubbleUPNP is perhaps the best casting app that I know of.
Code:
BubbleUPnP Server provides new services, many of them running on top of your existing UPnP/DLNA devices:
make various media formats not natively supported by Chromecast playable with transcoding.
In my situation im running the server on my desktop so it can transcode anything, but then again im using a rk3288 tablet and it also can do the transcoding for the most part http://www.bubblesoftapps.com/bubbleupnpserver/
This isn't the ideal solution but it works, and no the app is not free but you can get limited time demo free to at least try it before purchasing.
Posts: 1,646
Threads: 2
Joined: Aug 2015
Reputation:
42
[Solved]
Nov 06, 2015, 12:17 AM
(This post was last modified: Nov 06, 2015, 12:39 AM by Mike.)
That is pretty damn cool that BubbleUPNP will transcode using the phone or tablet's power. It is also kinda lame the Chromecast requires transcoding. I only ever used BubbleUPNP for DLNA.
I have a small addition to your plex script, run a test to be sure but this should modify the plex.js as necessary for Chromecast (until Plex change it again) if I've found the right section
Code:
sed -i s'/canPlay:function(e,t){/canPlay:function(e,t){return false;/' plex.js
This will modify the plex.js for the web player http://app.plex.tv/web/js/plex.js
Code:
sed -i s'/validateTranscoder:function(t,n){/validateTranscoder:function(t,n){return false;/' plex.js
Since some users use plex.tv for accessing their server instead of the local address (I use dynamic DNS so bypass plex.tv I think), the dummy web server should ideally have both js files I think.
Are you up for integrating this @tragidy? It would need the extra nginx vhost for the app.tv and entry in /etc/hosts, or have you found that app.tv is used for authentication as well?
I think you missed a comment in the script
Code:
#sudo chown -R www-data:www-data /var/www
Posts: 16
Threads: 1
Joined: Nov 2015
Reputation:
5
[Solved]
Nov 06, 2015, 04:27 AM
Sorry guys, I did not have time to test the modified Plex app yet. I managed to get it working so that PMS is transcoding and playing all videos when I use Chrome to start casting.
The only things required are a web server (e.g. as per tragidy's instructions) and access to the Google Cast SDK Developer Console ($5 for registration). No DNS server/rerouting or additional apps etc required.
I will test it using the App over the weekend and try to find some time to write detailed instructions.
Posts: 22
Threads: 1
Joined: Oct 2015
[Solved]
Nov 06, 2015, 01:14 PM
(This post was last modified: Nov 06, 2015, 04:26 PM by tragidy.
Edit Reason: fixed
)
Posts: 1,646
Threads: 2
Joined: Aug 2015
Reputation:
42
[Solved]
Nov 06, 2015, 05:19 PM
Thanks @tragidy, I don't know how frequently the plex.js is updated which will affect which method is optimal (including the modified script in your repo or modifying it on the fly with new versions). Each has its limitations and I'm sure you'll figure out which is easiest for you to maintain.
I got the Chromecast today so I can start helping you guys. We just need @lukas to elaborate what he used the Google Chromecast SDK for to get his workaround. I'd also like to understand why he must cast from Google Chrome and cannot do so from Android app.
Lukas if you just provide a general explanation of what you did then I'm sure we can reproduce it. I believe you changed the App ID and altered the plex.js the index.html in the Chromecast app points using the SDK but somehow this is different from rebuilding the Plex Chromecast app?
|
|
|