cvlc atsc://frequency=605029000 --sout '#rtp{dst=10.0.1.8,port=5004,mux=ts,ttl=1}' --sout-keep -d
cvlc -I dummy --ffmpeg-hw atsc://frequency=605000000 :live-cache=5000 --sout='#transcode{vcodec=h264,vb=200,fps=30,scale=.5,venc=x264{aud,level=50,keyint=15,bframes=0,ref=1},acodec=aac,ab=40,channels=2,samplerate=22050}:duplicate{dst=std{mux=ts,dst=-,access=livehttp{seglen=30,delsegs=true,numsegs=20,index=/var/www/stream/live.m3u8,index-url=content/live-######.ts},mux=ts{use-key-frames},dst=/var/www/stream/content/live-######.ts,ratecontrol=true}}'
This generates a .m3u8 file which is dynamically updated as new clips are processed. It is accessible in safari on the iphone.
What I'm trying to do is create a plugin that will grab that live feed (preferably an rtp stream) and transcode it on the fly for my clients.
# Autor: Roland Fritz # Date: 7/31/2012 # About: This plugin is designed to enable live TV viewing on Plex clients. Required for this to # to work is a usb DTV tuner and vlc. # # NOTE: I do not make any guarantees that this will work for you. I do not endorse using this for # anything beyond personal use. This has been tested to work on Ubuntu server 12.04 running PMS. # # Version: 0.1 ##import mechanize
VIDEO_PREFIX = “/video/fritztv”
NAME = L(‘Title’)
ART = ‘art-default.jpg’
ICON = ‘icon-default.jpg’
NAMESPACES = {‘a’:‘http://xspf.org/ns/0/’}####################################################################################################
def Start():Plugin.AddPrefixHandler(VIDEO_PREFIX, MainMenu, NAME, ICON, ART) Plugin.AddViewGroup("InfoList", viewMode="InfoList", mediaType="items") Plugin.AddViewGroup("List", viewMode="List", mediaType="items") MediaContainer.title1 = NAME MediaContainer.viewGroup = "List" MediaContainer.art = R(ART) DirectoryItem.thumb = R(ICON) VideoItem.thumb = R(ICON)
HTTP.CacheTime = CACHE_1HOUR
def MainMenu():
oc = ObjectContainer(title1=“VLC Player”)mo = MediaObject(parts=[PartObject(key=HTTPLiveStreamURL("10.0.1.8:5004"))]) vco = VideoClipObject(title="Play local VLC stream", url='10.0.1.8:5004') vco.add(mo) oc.add(vco) return oc
#############################
And Here's the Log
#############################
2013-04-17 13:44:50,161 (-48d91700) : INFO (core:336) - Starting framework core - Version: 2.3.4, Build: 7570849 (Tue Apr 9 16:23:58 UTC 2013) 2013-04-17 13:44:50,161 (-48d91700) : DEBUG (core:348) - Using the standard policy 2013-04-17 13:44:50,162 (-48d91700) : DEBUG (core:437) - Starting runtime component. 2013-04-17 13:44:50,164 (-48d91700) : DEBUG (core:437) - Starting caching component. 2013-04-17 13:44:50,165 (-48d91700) : DEBUG (core:437) - Starting data component. 2013-04-17 13:44:50,166 (-48d91700) : DEBUG (core:437) - Starting networking component. 2013-04-17 13:44:50,177 (-48d91700) : DEBUG (networking:318) - Loaded HTTP cookies 2013-04-17 13:44:50,237 (-48d91700) : DEBUG (networking:504) - Setting the default network timeout to 20.0 2013-04-17 13:44:50,238 (-48d91700) : DEBUG (core:437) - Starting localization component. 2013-04-17 13:44:50,249 (-48d91700) : INFO (localization:408) - Setting the default locale to en-us 2013-04-17 13:44:50,250 (-48d91700) : DEBUG (localization:426) - Loaded en strings 2013-04-17 13:44:50,250 (-48d91700) : DEBUG (core:437) - Starting messaging component. 2013-04-17 13:44:50,251 (-48d91700) : DEBUG (core:437) - Starting debugging component. 2013-04-17 13:44:50,251 (-48d91700) : DEBUG (core:437) - Starting services component. 2013-04-17 13:44:50,252 (-48d91700) : DEBUG (core:437) - Starting myplex component. 2013-04-17 13:44:50,252 (-48d91700) : DEBUG (core:437) - Starting notifications component. 2013-04-17 13:44:50,275 (-4dd054c0) : DEBUG (networking:172) - Requesting 'http://127.0.0.1:32400/system/messaging/clear_events/com.plexapp.plugins.fritztv' 2013-04-17 13:44:50,563 (-48d91700) : DEBUG (accessor:68) - Creating a new model access point for provider com.plexapp.plugins.fritztv in namespace 'metadata' 2013-04-17 13:44:50,646 (-48d91700) : DEBUG (networking:172) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/resourceHashes' 2013-04-17 13:44:50,967 (-48d91700) : DEBUG (runtime:1090) - Created a thread named 'load_all_services' 2013-04-17 13:44:50,968 (-4dd054c0) : DEBUG (services:265) - Plug-in is not daemonized - loading services from system 2013-04-17 13:44:50,972 (-48d91700) : DEBUG (runtime:1090) - Created a thread named 'get_server_info' 2013-04-17 13:44:50,975 (-48d91700) : DEBUG (core:149) - Finished starting framework core 2013-04-17 13:44:50,975 (-48d91700) : DEBUG (core:547) - Loading plug-in code 2013-04-17 13:44:50,973 (-4ed074c0) : DEBUG (networking:172) - Requesting 'http://127.0.0.1:32400' 2013-04-17 13:44:50,991 (-48d91700) : DEBUG (core:553) - Finished loading plug-in code 2013-04-17 13:44:51,034 (-4dd054c0) : DEBUG (networking:172) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X0J1bmRsZVNlcnZpY2U6QWxsU2VydmljZXM_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMApyMAo_' 2013-04-17 13:44:51,042 (-48d91700) : DEBUG (runtime:623) - Adding a prefix handler for 'FRITZTV' ('/video/fritztv') 2013-04-17 13:44:51,068 (-48d91700) : INFO (core:598) - Started plug-in 2013-04-17 13:44:51,068 (-48d91700) : DEBUG (socketinterface:144) - Starting socket server 2013-04-17 13:44:51,076 (-4ed074c0) : DEBUG (core:525) - Machine identifier is b51c1396cf6dfd857daa78c4ee9ddd57f97f76d1 2013-04-17 13:44:51,077 (-4ed074c0) : DEBUG (core:526) - Server version is 0.9.7.22.510-8faeab3 2013-04-17 13:44:51,080 (-48d91700) : DEBUG (runtime:1090) - Created a thread named 'start' 2013-04-17 13:44:51,080 (-48d91700) : INFO (socketinterface:168) - Socket server started on port 60346 2013-04-17 13:44:51,081 (-48d91700) : INFO (pipeinterface:25) - Entering run loop 2013-04-17 13:44:51,081 (-48d91700) : DEBUG (runtime:700) - Handling request GET /:/prefixes 2013-04-17 13:44:51,084 (-48d91700) : DEBUG (runtime:797) - Found route matching /:/prefixes 2013-04-17 13:44:51,102 (-48d91700) : DEBUG (runtime:897) - Response: [200] MediaContainer, 442 bytes 2013-04-17 13:44:51,429 (-4dd054c0) : DEBUG (services:362) - Loaded services 2013-04-17 13:44:51,437 (-4e5064c0) : DEBUG (services:438) - No shared code to load 2013-04-17 13:45:08,839 (-4dd054c0) : DEBUG (runtime:700) - Handling request GET /:/plugins/com.plexapp.plugins.fritztv/resources/icon-default.jpg?t=1366169333 2013-04-17 13:45:08,912 (-4e5064c0) : DEBUG (runtime:700) - Handling request GET /:/plugins/com.plexapp.plugins.fritztv/resources/icon-default.jpg?t=1366169333 2013-04-17 13:45:08,920 (-4dd054c0) : DEBUG (runtime:797) - Found route matching /:/plugins/com.plexapp.plugins.fritztv/resources/icon-default.jpg 2013-04-17 13:45:08,920 (-4e5064c0) : DEBUG (runtime:797) - Found route matching /:/plugins/com.plexapp.plugins.fritztv/resources/icon-default.jpg 2013-04-17 13:45:08,943 (-4e5064c0) : DEBUG (runtime:897) - Response: [200] DataObject, 23789 bytes 2013-04-17 13:45:08,973 (-4dd054c0) : DEBUG (runtime:897) - Response: [200] DataObject, 23789 bytes 2013-04-17 13:45:10,923 (-4dd054c0) : DEBUG (runtime:700) - Handling request GET /video/fritztv 2013-04-17 13:45:10,925 (-4dd054c0) : DEBUG (runtime:49) - Received packed state data (80 bytes) 2013-04-17 13:45:10,927 (-4dd054c0) : DEBUG (runtime:797) - Found route matching /video/fritztv 2013-04-17 13:45:10,927 (-4dd054c0) : WARNING (objectkit:193) - The 'platforms' attribute is deprecated and should not be assigned. 2013-04-17 13:45:10,928 (-4dd054c0) : WARNING (objectkit:193) - The 'protocols' attribute is deprecated and should not be assigned. 2013-04-17 13:45:10,929 (-4dd054c0) : DEBUG (base:123) - Checking if com.plexapp.plugins.fritztv is broken 2013-04-17 13:45:10,930 (-4dd054c0) : DEBUG (networking:172) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X1N0b3JlU2VydmljZTpJc0NoYW5uZWxCcm9rZW4_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMQpzMjcKY29tLnBsZXhhcHAucGx1Z2lucy5mcml0enR2czEwCmlkZW50aWZpZXJyMAo_' 2013-04-17 13:45:10,943 (-4dd054c0) : WARNING (objectkit:193) - Media part has no streams - attempting to synthesize 2013-04-17 13:45:10,949 (-4dd054c0) : DEBUG (services:602) - No service found for URL '10.0.1.8:5004' 2013-04-17 13:45:10,949 (-4dd054c0) : DEBUG (services:617) - No matching services found for '10.0.1.8:5004' 2013-04-17 13:45:10,956 (-4dd054c0) : DEBUG (services:41) - Loading service code for Fallback (URLServiceRecord) 2013-04-17 13:45:11,178 (-4dd054c0) : DEBUG (runtime:49) - Received packed state data (80 bytes) 2013-04-17 13:45:11,181 (-4dd054c0) : DEBUG (runtime:106) - Sending packed state data (108 bytes) 2013-04-17 13:45:11,182 (-4dd054c0) : DEBUG (runtime:897) - Response: [200] MediaContainer, 774 bytes 2013-04-17 14:14:36,146 (-4dd054c0) : DEBUG (runtime:700) - Handling request GET /video/fritztv 2013-04-17 14:14:36,149 (-4dd054c0) : DEBUG (runtime:797) - Found route matching /video/fritztv 2013-04-17 14:14:36,151 (-4dd054c0) : DEBUG (base:123) - Checking if com.plexapp.plugins.fritztv is broken 2013-04-17 14:14:36,172 (-4dd054c0) : DEBUG (networking:172) - Requesting 'http://127.0.0.1:32400/:/plugins/com.plexapp.system/messaging/function/X1N0b3JlU2VydmljZTpJc0NoYW5uZWxCcm9rZW4_/Y2VyZWFsMQoxCmxpc3QKMApyMAo_/Y2VyZWFsMQoxCmRpY3QKMQpzMjcKY29tLnBsZXhhcHAucGx1Z2lucy5mcml0enR2czEwCmlkZW50aWZpZXJyMAo_' 2013-04-17 14:14:36,183 (-4dd054c0) : DEBUG (services:602) - No service found for URL '10.0.1.8:5004' 2013-04-17 14:14:36,183 (-4dd054c0) : DEBUG (services:617) - No matching services found for '10.0.1.8:5004' 2013-04-17 14:14:36,187 (-4dd054c0) : DEBUG (runtime:106) - Sending packed state data (108 bytes) 2013-04-17 14:14:36,188 (-4dd054c0) : DEBUG (runtime:897) - Response: [200] MediaContainer, 774 bytes
Thanks,
FRITZ|FRITZ