Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Obtain video duration for Universe/UPnP streaming

  1. #1
    Join Date
    Aug 2011
    Location
    Virginia, USA
    Posts
    484

    Obtain video duration for Universe/UPnP streaming

    It would be nice if when streaming UPnP video with the Universe plugin the duration of the video could be obtained such that one could pause the video and skip forward and back (it currently shows 0:00 and I am not able to skip forward). In particular I am interested in this for Playon where I can pause playback for a while and let a portion of the video be transcoded after which I can skip ahead over parts I am not interested in watching. I don't know if this is possible in NPVR but I was able to do this when I used the SageTV UPnP client.

  2. #2
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    76,327
    To be honest, I'm not really sure what would be required to implement this.

    Martin, how does Universe plugin work? Are you downloading a file and playing it, or using play video api to directly play an network stream url? Also, does mvpmcx2 do something different that would need to be taken into account too?

  3. #3
    Join Date
    May 2006
    Location
    Canada
    Posts
    21,272
    No it doesn't store or cache the file, it plays the native http stream which is mpeg-ps.

    While NextPVR is playing it constantly logs

    Code:
    2012-04-25 19:25:13.263	[DEBUG][1]	GetDuration returning 0
    2012-04-25 19:25:13.363	[DEBUG][1]	GetDuration returning 0
    2012-04-25 19:25:13.474	[DEBUG][1]	GetDuration returning 0
    2012-04-25 19:25:13.584	[DEBUG][1]	GetDuration returning 0
    2012-04-25 19:25:13.702	[DEBUG][1]	GetDuration returning 0
    2012-04-25 19:25:13.799	[DEBUG][1]	GetDuration returning 0
    2012-04-25 19:25:13.915	[DEBUG][1]	GetDuration returning 0
    2012-04-25 19:25:14.017	[DEBUG][1]	GetDuration returning 0
    2012-04-25 19:25:14.137	[DEBUG][1]	GetDuration returning 0
    2012-04-25 19:25:14.156	[DEBUG][1]	GetDuration returning 0
    However NextPVR does get the current position and correct if I try to skip,

    Code:
    2012-04-25 19:35:48.856	[DEBUG][1]	Current position is: 61.3339729309082
    However after skipping it cannot go forward.

    I do know the length and I have tried setting args["@duration"] = various things hoping for a trace error for the format before calling

    PluginHelperFactory.GetPluginHelper().SetPlayerMet aData(args);

    but that didn't change anything. That would only give the total time but it is possible that if PlayOn won't fail if you try to skip to far, it might take you near the end of transcoding. It still might help going backwards because the current timeline looks like this in both timeline styles, with the first number being the actual time.

    It might work on the NMT since the NMT does record the correct PTS and it is playing directly from the UPnP http server too.

    Martin
    Attached Images Attached Images  

  4. #4
    Join Date
    Aug 2011
    Location
    Virginia, USA
    Posts
    484
    So, would it even be possible to add this? Thanks.

  5. #5
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    76,327
    From Martin's description (and log snippets) above, it sounds like directshow is reporting a duration of zero for streams, so I dont have anyway to know the duration of the stream.

    It sounds like it does correctly report the current playback position, so I could return that as the duration instead of zero, which might be a slight improvement. I that would not be enough to allow skipping, even just backwards.

    To allow skipping around, I'm pretty sure the plugin would need to save the stream to disk and play it as a file.

  6. #6
    Join Date
    May 2006
    Location
    Canada
    Posts
    21,272
    Quote Originally Posted by sub View Post
    From Martin's description (and log snippets) above, it sounds like directshow is reporting a duration of zero for streams, so I dont have anyway to know the duration of the stream.
    As I wrote above I do try report the true 'full" duration in the meta data. You could use that when zero is reported if you'd like, just let me know what data type you'd like to be.

    Martin

  7. #7
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    76,327
    I've made a change for the next release so you can force the duration by setting "STREAM_DURATION" in the call to SetPlayerMetaData(). It needs to be 'double' data type, giving the number of seconds.

    I suspect directshow will refuse to skip when playing the stream though. This change will at least give you a correct timeline.

  8. #8
    Join Date
    May 2006
    Location
    Canada
    Posts
    21,272
    @cncb, there are some changes in 2.5.5 that make this work better, and I updated the wiki with a new version that sub accepts. There are PlayOn issues on how they cache the file, and with DirectShow if you get too close to the end.

    Martin

  9. #9
    Join Date
    Aug 2011
    Location
    Virginia, USA
    Posts
    484
    Thanks, Martin. Unfortunately I get an exception thrown when I try to start NPVR after installing the Universe update (see below). I tried uninstalling and reinstalling the new version and get the same result.

    Attachment 33986

  10. #10
    Join Date
    May 2006
    Location
    Canada
    Posts
    21,272
    Sorry about that, try again, I have removed the dependancy. I was using a common dll that I share with MB4 for the PS3 Grooveshark UPnP integration that I never released and forgot about it.

    Martin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •