I have been working on gettng channel to stream live content over Flash on HTTP. I am unbale to find a good example to refer to.
Could anyone point to good example for streming channels ?
I have been working on gettng channel to stream live content over Flash on HTTP. I am unbale to find a good example to refer to.
Could anyone point to good example for streming channels ?
I have been working on gettng channel to stream live content over Flash on HTTP. I am unbale to find a good example to refer to.
Could anyone point to good example for streming channels ?
Hi!
Can you please elaborate? Do you mean FLV video files over HTTP? For which site are you building the plugin?
I have a live streaming URL http://bglive-a.bitgravity.com/ndtv/247lo/live/native for which I am trying to build a channel.
When I meant a FLV over HTTP, the video is a HTTP stream and played using a FLV based player. THe original page for the content is http://www.ndtv.com/video/live/channel/ndtv24x7
I followed all the steps / tips suggested in the http://forums.plexapp.com/index.php/topic/59274-newbie-http-flv-steaming-channel-development/ with little luck.
I have a live streaming URL http://bglive-a.bitgravity.com/ndtv/247lo/live/native for which I am trying to build a channel.
When I meant a FLV over HTTP, the video is a HTTP stream and played using a FLV based player. THe original page for the content is http://www.ndtv.com/video/live/channel/ndtv24x7
I followed all the steps / tips suggested in the http://forums.plexapp.com/index.php/topic/59274-newbie-http-flv-steaming-channel-development/ with little luck.
Ok, that's almost there, using the Redirect is how I would do it. I've mostly been using URL services when writing channels so I'll give you an example below which requires an URL service:
In __init.py__ where you should return an URL to the video:
def Videos(): dir = ObjectContainer(title1 = "TEST VIDEOS")dir.add( EpisodeObject( url = 'http://bglive-a.bitgravity.com/ndtv/247lo/live/native', title = "TEST VIDEO") ) return dir
In ServiceCode.pys in the URL service:
def MediaObjectsForURL(url):
return [ MediaObject(
container = 'flv',
audio_channels = 2,
optimized_for_streaming = True,
parts = [PartObject(key = Callback(PlayFile, url = url))])
]
def PlayFile(url):
return Redirect(url)
Thanks for the info. I tried to modify the code based on your recommendation with an URL service
I get the error
Error loading player: No playable sources found
2013-05-02 16:31:25,145 (1700) : INFO (logkit:16) - Playing for URL http://bglive-a.bitgravity.com/ndtv/247lo/live/native 2013-05-02 16:31:25,147 (1700) : WARNING (objectkit:193) - The 'platforms' attribute is deprecated and should not be assigned. 2013-05-02 16:31:25,147 (1700) : WARNING (objectkit:193) - The 'protocols' attribute is deprecated and should not be assigned. 2013-05-02 16:31:25,148 (1700) : DEBUG (services:30) - TAG: Object 2013-05-02 16:31:25,148 (1700) : WARNING (objectkit:193) - Media part has no streams - attempting to synthesize
Thanks for the info. I tried to modify the code based on your recommendation with an URL service
I get the error
Error loading player: No playable sources found2013-05-02 16:31:25,145 (1700) : INFO (logkit:16) - Playing for URL http://bglive-a.bitgravity.com/ndtv/247lo/live/native 2013-05-02 16:31:25,147 (1700) : WARNING (objectkit:193) - The 'platforms' attribute is deprecated and should not be assigned. 2013-05-02 16:31:25,147 (1700) : WARNING (objectkit:193) - The 'protocols' attribute is deprecated and should not be assigned. 2013-05-02 16:31:25,148 (1700) : DEBUG (services:30) - TAG: Object 2013-05-02 16:31:25,148 (1700) : WARNING (objectkit:193) - Media part has no streams - attempting to synthesize
What regular expression are you using in ServiceInfo.plist? It seems that the URL service function never is called ...
Can you provide a log for the plugin?(the com.plexapp.plugins..log)
Here is an extract from my channel code
def MainMenu():
dir = ObjectContainer(title1 = "TEST VIDEOS")
dir.add(
EpisodeObject(
url = 'http://apni.tv/news/ndtv',
title = "TEST VIDEO")
)
return dir
From my URL service code
def MediaObjectsForURL(url):
Log("Playing for URL " + url)
url = "http://bglive-a.bitgravity.com/ndtv/247lo/live/native"
return MediaObject(container = 'flv',
audio_channels = 2,
optimized_for_streaming = True,
parts = [PartObject(key = Callback(PlayFile, url = url))]
)
def PlayFile(url):
Log("Video URL --- " + url)
return Redirect(url)
And the ServiceInfo.plist, I see in the logs that URL service found for the URL in the plugin logs.
<?xml version="1.0" encoding="UTF-8"?> URL DESI URLPatterns ^http://apni.tv/news/
Quick note: MediaObjectsForUrl() should return a [list], even if it is only one MediaObject. I can’t say that will necessarily solve your problems but, it won’t hurt.
Thanks Mike, I had the array of MediaObjects first before I removed it.
Meanwhile I found TwitTv channel which is similar to what I am trying to achieve. I found the streaming URL for this site and able to play it on my Plex Media Manager. However on my Roku I get to hear the audio for a few seconds and then it stops. I think I am close to getting this to work.
The UStream based channel plays fine on Roku too. Is it a problem with the stream provider?
LIVE_URLS = {
'NDTV 24x7' : 'http://ndtv.live-s.cdn.bitgravity.com/cdn-live-b7/_definst_/ndtv/live/ndtv247live.smil/playlist.m3u8',
'Ustream': 'http://iphone-streaming.ustream.tv/ustreamVideo/1524/streams/live/playlist.m3u8'
}
def MainMenu():
oc = ObjectContainer(no_cache=True)
for name in LIVE_URLS.keys():
oc.add(LiveStream(name))
return oc
def LiveStream(hls_provider='Ustream', include_container=False):
vco = VideoClipObject(
key = Callback(LiveStream, hls_provider=hls_provider, include_container=True),
rating_key = LIVE_URLS[hls_provider],
title = hls_provider,
items = [
MediaObject(
container = 'flv',
audio_channels = 2,
optimized_for_streaming = True,
parts = [
PartObject(key=HTTPLiveStreamURL(LIVE_URLS[hls_provider]))
]
)
]
)
if include_container:
return ObjectContainer(objects=[vco])
else:
return vco
Besides the comment from Mikedm139 it looks fine.
It works for my when using PMC, but not in Plex/Web or iOS. I did some digging and found that the Plex/Web client performs a HEAD on the redirected URL(probably to get the MIME type). The strange thing is that the NDTV server responds with '404' not found! In PMC the hint of 'flv' is good enough and satisfies the underlaying FFMPEG which do not perform a HEAD, but instead a GET, and it all works.
It's hard to say where to go from here since the NDTV server is not behaving like it should! (Not found when doing HEAD, return ok when doing GET).
Thanks Meo, I digged further and found a playlist for the live stream. But again the result was identical in that it works on Plex Media Manager (Web) and not on Roku.
Thanks for guiding me on this, this post will help people in furture trying to do something similar.
Thanks Meo, I digged further and found a playlist for the live stream. But again the result was identical in that it works on PMC and not on Roku.
Thanks for guiding me on this, this post will help people in furture trying to do something similar.
When I looked at plugins for examples of HLS some time ago, I think I recall that Roku had problems with m3u8 playlists that had the Windows style end of line, i.e . It will only accept (or maybe the other way around?)
Can't remember which Plex channel it was I saw this in though but it had i fix for it ....
Excellent point.
I think you are referrinf the this code section in the National Geographic URL Service
I will try this approach to cleanup the m3u8 playlist
I checked the playlist.m3u8 in Notepad++ and EOL character shows up as UNIX format which essentially is .
Hi!
HTTPLiveStreamURL != 'flv'. This could the the source of the problem. If you're using the HTTPLiveStreamURL 'helper' function, you don't have to set container, audio_codec and video_codec (they will be set automatically).
As per meo's suggestion I replaced all \r from the playlist with and was able to get the video work on Roku.
Sander is there a place that has documentation for helper methods HTTPLiveStreamURL nad WebVideoURL etc.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.