Linux‎ > ‎

Plex Media Server

Vizio DLNA Client

Some Vizio TV have support for streaming from a DLNA server.  It doesn't work out of the box with Plex Media Server built in DLNA server and most video content but can be made to by defining a custom profile to transcode your video in real time to a supported format.  Vizio's DNLA client only supports video in DVD-ish mpeg format instead of my preferred Apple-ish storage format of H.264.

Since Vizio's report themselves using a way to generic user agent string then this HW specific profile can't really be shipped with Plex.

If you installed Plex Media Server using RPM then create the file /usr/lib/plexmediaserver/Resources/Profiles/Vizio.xml with this content:

<?xml version="1.0" encoding="utf-8"?>

<Client name="Vizio">
    <Identification>
        <Header name="User-Agent" substring="IPI/1.0 UPnP/1.0" />
        <Header name="USER-AGENT" substring="IPI/1.0 UPnP/1.0" />
    </Identification>
    <Settings>
        <Setting name="IgnoreTranscodeByteRangeRequests" value="true" />
        <Setting name="TimelineBufferOffset" value="5" />
    </Settings>
    <TranscodeTargets>
        <VideoProfile container="mpeg" codec="mpeg2video" audioCodec="ac3" />
        <MusicProfile container="mp3" codec="mp3" />
        <PhotoProfile container="jpeg" />
    </TranscodeTargets>
    <DirectPlayProfiles>
        <VideoProfile container="mpeg" codec="mpeg2video" audioCodec="ac3" />
        <MusicProfile container="mp3" codec="mp3" />
        <PhotoProfile container="jpeg" />
    </DirectPlayProfiles>
    <CodecProfiles>
        <VideoCodec name="*">
            <Limitations>
                <UpperBound name="video.width" value="1920" />
                <UpperBound name="video.height" value="1080" />
            </Limitations>
        </VideoCodec>
    </CodecProfiles>
</Client>

Plex has announce an app for newer Vizio Smart TV's.  Looks like my TV must be to old because no Plex app shows up in its app store.

Plex Connect

Plex Connect is a python app that lets you hijack the Trailers app without jailbreaking on an Apple TV and use it to connect to your Plex Media Server.  It does this by installing a mini-DNS, mini-HTTP, and mini-HTTPS server on your computer that responds to requests from Apple TV to trailers.apple.com.  If your videos are already in the Apple friendly H.264 format then the Apple TV can play them with no transcoding and use very little of your system resources.

The Plex Connect install instructions on its wiki work fine on Linux but is lacking instructions on having systemd start this server.

To get Plex Connect started as a systemd service, create a file named /usr/lib/systemd/system/plexconnect.service with this content:

[Unit]
Description=Plex Connect
After=network.target

[Service]
Environment=LC_ALL=en_US.UTF-8
Environment=LANG=en_US.UTF-8
ExecStart=/bin/sh -c '/usr/local/PlexConnect/PlexConnect.py'
Type=simple
Restart=on-failure
RestartSec=5
StartLimitInterval=60s
StartLimitBurst=3

[Install]
WantedBy=multi-user.target
plexconnect.service (END)

After that, enable service with 'systemctl enable plexconnect' and 'systemctl start plexconnect'

Plex Connect runs a HTTP server on port 80 and only on the IP address reported by 'hostname -i' (connecting to 127.0.0.1 will not work).  This is because Apple TV will talk to http://trailers.apple.com:80.  If you already have Apache running then Plex Connect will fail to run because of the port conflict.

You can edit its Settings.cfg and change it to use a different port.  For example, set port_webserver = 8080 to run on  port 8080.  Then make use of Apache's Virtual Host and Proxy features to redirect http://trailers.apple.com:80 requests to port the port 8080 of Plex Connect.

To configure Apache, create a file /etc/httpd/conf.d/vhosts.conf with this content:

<VirtualHost *:80>
    ServerName localhost
    DocumentRoot /var/www/html
</VirtualHost>

<VirtualHost *:80>
    ServerName trailers.apple.com
    ProxyRequests Off
    ProxyPreserveHost On

    <Proxy *>
        Order allow,deny
        Allow from all
    </Proxy>

    ProxyPass / http://192.168.1.123:8080/
    ProxyPassReverse / http://192.168.1.123:8080/
</VirtualHost>

Be sure and replace 192.168.1.123 with IP address of your 'hostname -i'.

Comments