HLS Stream probs

I’m banging my head against a wall with this HLS stream stream. It seems like the transcoder is starting with the wrong parameters, could be a bug?



Relevant code:


<br />
@route(VIDEO_PREFIX + "/play/{type}/{id}")<br />
def PlayVideo(type, id):    <br />
    oc = ObjectContainer()<br />
    <br />
    if type == "Archive":<br />
        media = JSON.ObjectFromURL(BASE_URL + "clips/clip?sessionId=" + GetSessionId() + "&id=" + id)<br />
    elif type == "Event":<br />
        media = JSON.ObjectFromURL(BASE_URL + "events/event?sessionId=" + GetSessionId() + "&id=" + id)<br />
        <br />
    <br />
    key = media["type"] + media["id"]<br />
    <br />
    vco = VideoClipObject(<br />
                title = media["title"],<br />
                key = Callback(PlayVideo, type = type, id = id),<br />
                thumb = media["poster"],<br />
                rating_key = key )<br />
            <br />
    if "MobileH264" in media["formats"]:<br />
        vco.add(<br />
            MediaObject(<br />
                parts = [<br />
                    PartObject(<br />
                        key = HTTPLiveStreamURL(media["formats"]["MobileH264"]) ) # = http://www.mywowzaserver.com:1935/vod/mp4:15fee433-8adb-4617-bda5-3445a42b081d.mp4/playlist.m3u8<br />
                        #key = media["formats"]["MobileH264"] )<br />
                    ]<br />
                )<br />
            )<br />
            <br />
    oc.add(vco)<br />
    <br />
    return oc<br />




Relevant Log:

<br />
Nov 27, 2012 09:12:11:960 [8108] DEBUG - Request: GET /video/:/transcode/segmented/start.m3u8?url=http%3A%2F%2F127.0.0.1%3A32400%2Fvideo%2Fsyracuse%2Fplay%2FArchive%2F6553&quality=6&identifier=com.sidearmsports.plexapp.plugins.syracuse&ratingKey=Archive6553&session=1aeb38ff-3657-4b97-ab54-d44ccec372f8&X-Plex-Access-Code=in1FgLHqaTPvog3egcd%2FKQz48g9wyFJBmf1NEFx%2FfFk%3D&X-Plex-Access-Time=1354025542&X-Plex-Access-Key=ZPBS5OLGFLDCE45PI30F&X-Plex-Token=2NvZJZyGZJhR9EhmZNjz&X-Plex-Client-Capabilities=protocols%3Dhttp-mp4-streaming%2Chttp-mp4-video%2Chttp-streaming-video-720p%2Chttp-mp4-video-720p%2Chttp-live-streaming%2Chttp-streaming-video [67.246.125.166:48430] (2 live)<br />
Nov 27, 2012 09:12:11:960 [8108] DEBUG -  * url => http://127.0.0.1:32400/video/syracuse/play/Archive/6553<br />
Nov 27, 2012 09:12:11:960 [8108] DEBUG -  * quality => 6<br />
Nov 27, 2012 09:12:11:960 [8108] DEBUG -  * identifier => com.sidearmsports.plexapp.plugins.syracuse<br />
Nov 27, 2012 09:12:11:960 [8108] DEBUG -  * ratingKey => Archive6553<br />
Nov 27, 2012 09:12:11:960 [8108] DEBUG -  * session => 1aeb38ff-3657-4b97-ab54-d44ccec372f8<br />
Nov 27, 2012 09:12:11:960 [8108] DEBUG -  * X-Plex-Access-Code => in1FgLHqaTPvog3egcd/KQz48g9wyFJBmf1NEFx/fFk=<br />
Nov 27, 2012 09:12:11:960 [8108] DEBUG -  * X-Plex-Access-Time => 1354025542<br />
Nov 27, 2012 09:12:11:960 [8108] DEBUG -  * X-Plex-Access-Key => ZPBS5OLGFLDCE45PI30F<br />
Nov 27, 2012 09:12:11:961 [8108] DEBUG -  * X-Plex-Token => 2NvZJZyGZJhR9EhmZNjz<br />
Nov 27, 2012 09:12:11:961 [8108] DEBUG -  * X-Plex-Client-Capabilities => protocols=http-mp4-streaming,http-mp4-video,http-streaming-video-720p,http-mp4-video-720p,http-live-streaming,http-streaming-video<br />
Nov 27, 2012 09:12:11:961 [8108] DEBUG - We found auth token (2NvZJZyGZJhR9EhmZNjz), enabling token-based authentication.<br />
Nov 27, 2012 09:12:11:961 [8108] DEBUG - Came in with a super-token, authorization succeeded.<br />
Nov 27, 2012 09:12:11:961 [8108] DEBUG - Cookie header in secure request: SESSION-GUID=1aeb38ff-3657-4b97-ab54-d44ccec372f8<br />
Nov 27, 2012 09:12:11:961 [8108] DEBUG - Checking cookie 'SESSION-GUID=1aeb38ff-3657-4b97-ab54-d44ccec372f8'<br />
Nov 27, 2012 09:12:11:962 [8108] DEBUG - Found session GUID of 1aeb38ff-3657-4b97-ab54-d44ccec372f8 in session start.<br />
Nov 27, 2012 09:12:11:962 [8108] DEBUG - Using session GUID 1aeb38ff-3657-4b97-ab54-d44ccec372f8 for new transcode session.<br />
Nov 27, 2012 09:12:11:962 [8108] DEBUG - Cleaning directory for session 1aeb38ff-3657-4b97-ab54-d44ccec372f8 (C:\Users\joef\AppData\Local\Temp\plex-transcode-1aeb38ff-3657-4b97-ab54-d44ccec372f8-55d19d82-01b9-4289-813d-4dacfed24e3d)<br />
Nov 27, 2012 09:12:11:962 [8108] DEBUG - Saving session: 1aeb38ff-3657-4b97-ab54-d44ccec372f8<br />
Nov 27, 2012 09:12:11:962 [8108] DEBUG - Adding cookie for security headers: 'SESSION-GUID=1aeb38ff-3657-4b97-ab54-d44ccec372f8'<br />
Nov 27, 2012 09:12:12:056 [14816] DEBUG - Request: GET /video/:/transcode/segmented/session/1aeb38ff-3657-4b97-ab54-d44ccec372f8/6/index.m3u8 [67.246.125.166:48431] (2 live)<br />
Nov 27, 2012 09:12:12:056 [14816] DEBUG - Starting a transcode session 1aeb38ff-3657-4b97-ab54-d44ccec372f8 at offset -1.0 (stopped=1)<br />
Nov 27, 2012 09:12:12:057 [14816] DEBUG - Setting up segmented session, quality=6<br />
Nov 27, 2012 09:12:12:057 [14816] DEBUG - Computed display width of 7.8"<br />
Nov 27, 2012 09:12:12:057 [14816] DEBUG - Audio Stream copy => ac:<br />
Nov 27, 2012 09:12:12:057 [14816] DEBUG - Job running: C:\Program Files (x86)\Plex\Plex Media Server\PlexTranscoder.exe transcode "http://127.0.0.1:32400/video/syracuse/play/Archive/6553" "C:\Users\joef\AppData\Local\Temp\plex-transcode-1aeb38ff-3657-4b97-ab54-d44ccec372f8-55d19d82-01b9-4289-813d-4dacfed24e3d\media" 6 6 0 any nil 0 yes UTF-8 default "" "" 0.75 nil none "" "" "" 3355443 yes "" no "http://127.0.0.1:32400/video/:/transcode/session/1aeb38ff-3657-4b97-ab54-d44ccec372f8/progress" <br />
Nov 27, 2012 09:12:12:648 [13408] DEBUG - [Transcoder] Starting transcoder v306 (t=6s, q=6)<br />
Nov 27, 2012 09:12:12:649 [13672] DEBUG - [Transcoder] Registered components, about to parse arguments.<br />
Nov 27, 2012 09:12:12:651 [9884] DEBUG - [Transcoder] Video caps: ca=0, cv=0, ac=libmp3lame, mp3=-1, aac=-1,0, ac3=-1, dts=-1, pcm=-1, vp=4d, vr=0, vl=0, mss=3355443, anam=1<br />
Nov 27, 2012 09:12:12:652 [13424] DEBUG - [Transcoder] About to apply initial settings.<br />
Nov 27, 2012 09:12:12:663 [2764] DEBUG - [Transcoder] Opening the input file.<br />
Nov 27, 2012 09:12:12:665 [13280] DEBUG - Request: GET /video/syracuse/play/Archive/6553 [127.0.0.1:55337] (3 live)<br />
Nov 27, 2012 09:12:12:665 [13280] DEBUG - Plug-in com.sidearmsports.plexapp.plugins.syracuse has been used 517 times.<br />
Nov 27, 2012 09:12:12:665 [13280] DEBUG - [com.sidearmsports.plexapp.plugins.syracuse] Sending command over HTTP (GET): /video/syracuse/play/Archive/6553<br />
Nov 27, 2012 09:12:12:666 [13280] DEBUG - HTTP requesting to: http://127.0.0.1:55045/video/syracuse/play/Archive/6553<br />
Nov 27, 2012 09:12:12:694 [13280] DEBUG - [com.sidearmsports.plexapp.plugins.syracuse] HTTP reply status 200, with 823 bytes of content.<br />
Nov 27, 2012 09:12:12:695 [13324] ERROR - [Transcoder] Exiting after failure.<br />
Nov 27, 2012 09:12:13:513 [1468] DEBUG - Request: GET /video/:/transcode/segmented/stop [67.246.125.166:41298] (2 live)<br />
Nov 27, 2012 09:12:13:514 [1468] DEBUG - We found auth token (2NvZJZyGZJhR9EhmZNjz), enabling token-based authentication.<br />
Nov 27, 2012 09:12:13:514 [1468] DEBUG - Came in with a super-token, authorization succeeded.<br />
Nov 27, 2012 09:12:13:515 [5220] DEBUG -  * Cookie: SESSION-GUID=1aeb38ff-3657-4b97-ab54-d44ccec372f8<br />
Nov 27, 2012 09:12:13:515 [5220] DEBUG - Stopping transcode session 1aeb38ff-3657-4b97-ab54-d44ccec372f8<br />
Nov 27, 2012 09:12:13:515 [5220] DEBUG - Killing job.<br />
Nov 27, 2012 09:12:13:515 [5220] DEBUG - Cleaning directory for session 1aeb38ff-3657-4b97-ab54-d44ccec372f8 (C:\Users\joef\AppData\Local\Temp\plex-transcode-1aeb38ff-3657-4b97-ab54-d44ccec372f8-55d19d82-01b9-4289-813d-4dacfed24e3d)<br />
Nov 27, 2012 09:12:13:516 [5220] DEBUG - Whacked session, 0 remaining.<br />
Nov 27, 2012 09:12:13:516 [5220] DEBUG - It took 0.000000 sec to serialize a list with 0 elements.<br />





Any help is much appreciated!

I presume I’m creating the PartObject incorrectly, but I’m not sure what the correct way would be

One quick suggestion before digging deeper. Try specifying the “url=” in declaration of the key for the part:



<br />
key = HTTPLiveStreamURL(url=media["formats"]["MobileH264"])<br />




Sometimes the framework seems a little touchy about it, if that's left out. It's tripped me up a few times. If that doesn't work, can you include a segment of code to show how you build the objects that call PlayVideo() ?

Same problem when I specify 'url = ’



Here’s the code that calls PlayVideo:


<br />
@route(VIDEO_PREFIX + "/type/{type}")<br />
def TypeMenu(type):<br />
    dir = ObjectContainer(title2 = type, view_group="List")<br />
    <br />
    medias = JSON.ObjectFromURL(BASE_URL + "media/get?sessionId=" + GetSessionId() + "&Type=" + type)<br />
        <br />
    for media in medias:<br />
        if media["authorized"]:<br />
            key = media["type"] + media["id"]<br />
            vco = VideoClipObject(<br />
                        title = media["title"],<br />
                        key = Callback(PlayVideo, type = media["type"], id = media["id"]),<br />
                        thumb = media["poster"],<br />
                        rating_key = key )<br />
            dir.add(vco)<br />
            <br />
    return dir<br />


####################################################################################################
# This builds a list with items from your feed. The items are VideoClipObjects. Usually a URL Service is
# used to get all the metadata and media objects for an URL, but in this example everything is done within
# the plugin code. The Lookup callback is used when you ask for (more) metadata on an item (when you click
# the  little "i" icon in Plex for iOS for example).

@route(VIDEO_PREFIX + "/type/{type}")
def TypeMenu(type):

    oc = ObjectContainer(title2=type, view_group="List")
    medias = JSON.ObjectFromURL(BASE_URL + "media/get?sessionId=" + GetSessionId() + "&Type=" + type)

    for media in medias:
        if media["authorized"]:
            title = media["title"]
            thumb = media["poster"]
            type = media["type"]
            id = media["id"]
            rating_key = '%s%s' % (type, id)

            oc.add(
                VideoClipObject(
                    key = Callback(Lookup, title=title, thumb=thumb, type=type, id=id, rating_key=rating_key),
                    title = title,
                    thumb = thumb,
                    rating_key = rating_key,
                    items = [
                        MediaObject(
                            parts = [PartObject(key=HTTPLiveStreamURL(Callback(PlayVideo, type=type, id=id)))]
                        )
                    ]
                )
            )

    return oc

####################################################################################################
@route(VIDEO_PREFIX + "/lookup")
def Lookup(title=title, thumb=thumb, type=type, id=id, rating_key=rating_key):

    oc = ObjectContainer()

    oc.add(
        VideoClipObject(
            key = Callback(Lookup, title=title, thumb=thumb, type=type, id=id, rating_key=rating_key),
            title = title,
            thumb = thumb,
            rating_key = rating_key,
            items = [
                MediaObject(
                    parts = [PartObject(key=HTTPLiveStreamURL(Callback(PlayVideo, type=type, id=id)))]
                )
            ]
        )
    )

    return oc

####################################################################################################
@route(VIDEO_PREFIX + "/play/{type}/{id}")
de PlayVideo(type, id):

    if type == "Archive":
        media = JSON.ObjectFromURL(BASE_URL + "clips/clip?sessionId=" + GetSessionId() + "&id=" + id)
    elif type == "Event":
        media = JSON.ObjectFromURL(BASE_URL + "events/event?sessionId=" + GetSessionId() + "&id=" + id)

    if "MobileH264" in media["formats"]:
        return Redirect(media["formats"]["MobileH264"])
    else:
        raise Ex.MediaNotAvailable


 

Hey! It works! After a small modification of the Lookup method signature. Thank you!


Coool! :) Just out of curiosity, what did you have to change in the Lookup function?

<br />
def Lookup(title=title, thumb=thumb, type=type, id=id, rating_key=rating_key):<br />




to


<br />
def Lookup(title, thumb, type, id, rating_key):<br />




I'm new to Python, not sure if that "should" work or not, but it didn't on my PC

Whoops, that was a mistake on my part, sorry!

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