RTMP plugin without using URL service

I've got a version of my plugin working with a URL service, but I'd like to get it to work without. I'm struggling with how to get an EpisodeObject/VideoClipObject to have a MediaObject that will play.

 

I have a callback that does the MediaObject stuff, and I call that for item in the VideoClipObject:

            LIVE_STREAMS_HD_MENU.add(
                VideoClipObject(
                    title       = CHANNEL[0] + " HD",
                    summary     = CHANNEL[1],
                    thumb       = R(CHANNEL_THUMB),
                    key         = CHANNEL[0],
                    items       = CHANNEL_MEDIA,
                    rating_key  = CHANNEL[0] + " HD"
                )
            )

def ChannelMediaObject(CHANNEL_NUMBER,CHANNEL_QUALITY):
# Remove “-” from CHANNEL_NUMBER
CHANNEL_NUMBER = CHANNEL_NUMBER.replace("-","")

# Check the CHANNEL_QUALITY and adjust CHANNEL_NUMBER, CHANNEL_HEIGHT
# and CHANNEL_WIDTH accordingly
if "SD" in CHANNEL_QUALITY:
    CHANNEL_NUMBER          = CHANNEL_NUMBER + "-sd"
    CHANNEL_HEIGHT          = 360
    CHANNEL_WIDTH           = 640
else:
    CHANNEL_HEIGHT          = 720
    CHANNEL_WIDTH           = 1280        

return [
    MediaObject(
        video_codec             = VideoCodec.H264,
        audio_codec             = AudioCodec.AAC,
        audio_channels          = 2,
        protocol                = 'rtmp',
        optimized_for_streaming = True,
        height                  = CHANNEL_HEIGHT,
        width                   = CHANNEL_WIDTH,
        parts                   = [
            PartObject(
                key             = RTMPVideoURL(
                    url         = URL_RTMP,
                    clip        = CHANNEL_NUMBER + "?s=6hfu0",
                )
            )
        ]
    )
] 

I get this error in Console with Plex Home Theater on Mac, which shows the menu of streams, but wont go through to the media detail page:

2014-06-05 03:30:55,985 (110d0a000) :  WARNING (objectkit:199) - Media part has no streams - attempting to synthesize
2014-06-05 03:30:55,997 (110d0a000) :  DEBUG (runtime:918) - Response: [200] MediaContainer, 12550 bytes

And just the last line if I try with web, which goes through to the media screen, but obviously wont play (as it's RTMP)

 

I've read this thread: https://forums.plex.tv/topic/78852-can-i-directly-play-an-url-without-having-a-service-file/?hl=%2Bepisodeobject+%2Bwith+%2Bmediaobject which talks about a double call back, so I tried doing that in the key like in the examples, using the same ChannelMediaObject callback, but that doesn't work either.

 

Also, plex web shows all channel details, sound, and width height etc in info screen.

I don't have an example of an RTMP channel without an URL Service but if you look at the code for how the IMDB Trailers channel works without an URL Service, it should help clear things up.

A question then – do I need a playvideo function if it's an RTMP video? I'm thinking not, right?

A question then – do I need a playvideo function if it's an RTMP video? I'm thinking not, right?

That generally depends more on whether you need to make any http requests to determine the final values to pass back. If you know them already when creating the MediaObject, then you shouldn't need the PlayVideo() function.

Thanks for the replies Mikedm139.

Following that IMDB example I've managed to get a plugin that handles and plays live RTMP streams, without a URL service. Just need to finish some other bits, like icons and the like, now

:D

nice work, any updates on release?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.