Hi!
I recently bought a Samsung smart TV that offers a Plex app. I installed the latest media server on ubuntu 14.04.
Streaming videos from my HD works great but I have troubles with http streaming.
Before I posted here I was spending hours on this forum trying to figure something out without success.
I intend to stream my ubuntu desktop on the TV. For example for streaming steam games on the TV (if performance allows that). Such a video stream can easily created using VLC. I use this code for testing:
cvlc screen:// \
--screen-fps 25 --screen-width 1920 --screen-height 1080 \
--nooverlay \
--sout '#transcode{vcodec=h264,acodec=mpga,channels=2,samplerate=44100,ab=128,width=1280,height=720}:standard{access=http,mux=ts,dst=:3030}'
With VLC I can view the stream at http://127.0.0.1:3030
I tried to create a very simple channel for playing the stream. The code is as follows:
NAME = 'Test'
url_vlc = "http://127.0.0.1:3030"
####################################################################################################
def Start():
HTTP.CacheTime = 300
####################################################################################################
@handler('/video/test', NAME, allow_sync=True)
def MainMenu():
oc = ObjectContainer(title1="VLC Player")
vco = CreateVideoClipObject(title="Play", include_container=False)
oc.add(vco)
return oc
####################################################################################################
@route('/video/vlc/stream')
def CreateVideoClipObject(title, include_container=False):
videoclip_obj = VideoClipObject(
key = Callback(CreateVideoClipObject, title=title, include_container=True),
rating_key = url_vlc,
title = title,
summary = 'foo bar baz',
items = [
MediaObject(
parts = [
PartObject(key=url_vlc)
]
#, video_codec = VideoCodec.H264
#, video_resolution = '720'
)
]
)
if include_container:
return ObjectContainer(objects=[videoclip_obj])
else:
return videoclip_obj
When trying to play the stream in Plex web client, the message “Dieser Kanal reagiert nicht.” (channel does not react).
Here is what is going on in the channel log:
2016-02-22 20:07:57,284 (7fbdadffb700) : DEBUG (runtime:717) - Handling request GET /video/test
2016-02-22 20:07:57,286 (7fbdadffb700) : DEBUG (runtime:814) - Found route matching /video/test
2016-02-22 20:07:57,287 (7fbdadffb700) : DEBUG (base:117) - Checking if com.plexapp.plugins.test is broken
2016-02-22 20:07:57,287 (7fbdadffb700) : DEBUG (networking:166) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X1N0b3JlU2VydmljZTpJc0NoYW5uZWxCcm9rZW4_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMQpzMjQKY29tLnBsZXhhcHAucGx1Z2lucy50ZXN0czEwCmlkZW50aWZpZXJyMAo_'
2016-02-22 20:07:57,300 (7fbdadffb700) : WARNING (objectkit:208) - Media part has no streams - attempting to synthesize
2016-02-22 20:07:57,304 (7fbdadffb700) : DEBUG (runtime:924) - Response: [200] MediaContainer, 876 bytes
And the media server log:
Feb 22, 2016 20:42:25 [0x7fe2db3ff700] DEBUG - Request: [127.0.0.1:47477] GET /system/messaging/clear_events/com.plexapp.plugins.vlc (9 live) GZIP
Feb 22, 2016 20:42:25 [0x7fe2db3ff700] DEBUG - [com.plexapp.system] Sending command over HTTP (GET): /system/messaging/clear_events/com.plexapp.plugins.vlc
Feb 22, 2016 20:42:25 [0x7fe2db3ff700] DEBUG - HTTP requesting GET http://127.0.0.1:55524/system/messaging/clear_events/com.plexapp.plugins.vlc
Feb 22, 2016 20:42:25 [0x7fe2db3ff700] DEBUG - [com.plexapp.system] HTTP reply status 200, with 0 bytes of content.
Feb 22, 2016 20:42:25 [0x7fe2e67ff700] DEBUG - Completed: [127.0.0.1:47477] GET /system/messaging/clear_events/com.plexapp.plugins.vlc (9 live) GZIP 5ms 180 bytes 200
Feb 22, 2016 20:42:25 [0x7fe2d8ffd700] DEBUG - Request: [127.0.0.1:47479] GET /:/plugins/com.plexapp.system/resourceHashes (10 live) GZIP
Feb 22, 2016 20:42:25 [0x7fe2d8ffd700] DEBUG - [com.plexapp.system] Sending command over HTTP (GET): /:/plugins/com.plexapp.system/resourceHashes
Feb 22, 2016 20:42:25 [0x7fe2d8ffd700] DEBUG - HTTP requesting GET http://127.0.0.1:55524/:/plugins/com.plexapp.system/resourceHashes
Feb 22, 2016 20:42:25 [0x7fe2d8ffd700] DEBUG - [com.plexapp.system] HTTP reply status 200, with 13276 bytes of content.
Feb 22, 2016 20:42:25 [0x7fe2e67ff700] DEBUG - Completed: [127.0.0.1:47479] GET /:/plugins/com.plexapp.system/resourceHashes (10 live) GZIP 7ms 3355 bytes 200
Feb 22, 2016 20:42:25 [0x7fe2d5fa7700] DEBUG - Request: [127.0.0.1:47481] GET /:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_ (11 live) GZIP
Feb 22, 2016 20:42:25 [0x7fe2d5fa7700] DEBUG - [com.plexapp.system] Sending command over HTTP (GET): /:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_
Feb 22, 2016 20:42:25 [0x7fe2d5fa7700] DEBUG - HTTP requesting GET http://127.0.0.1:55524/:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_
Feb 22, 2016 20:42:25 [0x7fe2d77ff700] DEBUG - Request: [127.0.0.1:47483] GET / (11 live) GZIP
Feb 22, 2016 20:42:25 [0x7fe2d77ff700] DEBUG - It took 0.0 sec to serialize a list with 20 elements.
Feb 22, 2016 20:42:25 [0x7fe2e67ff700] DEBUG - Completed: [127.0.0.1:47483] GET / (11 live) GZIP 2ms 1018 bytes 200
Feb 22, 2016 20:42:25 [0x7fe2d5fa7700] DEBUG - [com.plexapp.system] HTTP reply status 200, with 80500 bytes of content.
Feb 22, 2016 20:42:25 [0x7fe2e67ff700] DEBUG - Completed: [127.0.0.1:47481] GET /:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_ (11 live) GZIP 42ms 25805 bytes 200
Feb 22, 2016 20:42:25 [0x7fe2dcbff700] DEBUG - Reading 685 bytes in the body, code is 200
Feb 22, 2016 20:42:25 [0x7fe2dcbff700] DEBUG - [com.plexapp.plugins.vlc] Plug-in running on port 34183.
Feb 22, 2016 20:42:25 [0x7fe2dcbff700] DEBUG - * Plug-in handles prefix: /video/vlc
Feb 22, 2016 20:42:25 [0x7fe2dcbff700] DEBUG - * Plug-in handles prefix: /video/vlc
Feb 22, 2016 20:42:25 [0x7fe2dcbff700] DEBUG - Read configuration for [com.plexapp.plugins.vlc], had 1 prefixes
Feb 22, 2016 20:42:25 [0x7fe2dcbff700] DEBUG - [com.plexapp.plugins.vlc] Sending command over HTTP (GET): /video/vlc/stream?include_container=True&title=Play
Feb 22, 2016 20:42:25 [0x7fe2dcbff700] DEBUG - HTTP requesting GET http://127.0.0.1:34183/video/vlc/stream?include_container=True&title=Play
Feb 22, 2016 20:42:25 [0x7fe2dcbff700] DEBUG - [com.plexapp.plugins.vlc] HTTP reply status 404, with 0 bytes of content.
Feb 22, 2016 20:42:25 [0x7fe2e5ffe700] DEBUG - Completed: [127.0.0.1:47460] GET /video/vlc/stream?include_container=True&title=Play (11 live) GZIP 1369ms 140 bytes 404 (pipelined: 13)
So there is a 404, but I don’t understand why, VLC has no issues accessing this URL.
Any ideas?