Page 1 of 5 123 ... LastLast
Results 1 to 10 of 47

Thread: Get recording length from stream

  1. #1
    Join Date
    Mar 2019
    Location
    Sweden
    Posts
    20

    Get recording length from stream

    Hi,

    I have figured out that the following api command works for streaming recordings:

    http://<ip>:8866/live?recording=<id>&client=myclient

    But if I open the stream in vlc the length of the stream is undefined and thus seeking is not possible.

    Is there anything I can do to fix this? Maybe another api method?


    Thank you!

  2. #2
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,181
    I'm not sure why that would be. The server does return the length of the recording in the standard HTTP headers.

    For example:

    HTTP/1.1 200 OK
    Server: NextPVR
    Connection: Close
    Content-Range: bytes 0-138181504/138181504
    Content-Length: 138181504
    Content-Type: video/MP2T


    From knowing the file size, a player would then typically read a bit from the beginning, then a bit from the end, and look at the timestamps from both those spots to determine the duration. It may be something that VLC chose to just not do while using a network stream.

  3. #3
    Join Date
    May 2006
    Location
    Canada
    Posts
    29,167
    There are issues with in progress recordings.

    Martin

  4. #4
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,181
    Quote Originally Posted by mvallevand View Post
    There are issues with in progress recordings.

    Martin
    Yeah, in progress is a bit different - but I think he's mainly interested in existing recordings.

  5. #5
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,181
    It seems to be limitation of VLC with network streams (at least with transport streams). I can reproduce the problem by putting a .ts recording on my nextpvr.com website (so file served up by apache), and VLC will show an undefined duration. I can see it just starts reading from beginning to end - it never tries to look for the duration.

    If you're only interested in playing in VLC, and really want to get the seeking working over http, you could probably hookup some PostProcessing.bat job to convert to mp4 or mkv files. I'm guessing skipping will work with this type of container.

  6. #6
    Join Date
    Mar 2019
    Location
    Sweden
    Posts
    20
    Yes, I am only interested in recordings.

    I am seeing the same as you when using vlc and putting the .ts on an apache server. But if I use exoplayer demo the stream is getting correct length when reading from apache server but not directly from npvr.
    Also, if I put the recording into another pvr (like dvblink) the length is detectable from vlc as well.

    Not sure how to debug vlc, but debugging exoplayer I can see that we try to open the recording and read from the end. Exoplayer expects position to be in the end of file but it seems as if only 56400 bytes are returned. This makes exoplayer throw EOFException. This is from web.log:

    2019-04-09 12:47:35.779 [DEBUG][31] Got Web Request (::ffff:192.168.5.2): /live recording=854&client=MyClient
    2019-04-09 12:47:35.779 [DEBUG][31] StreamNative@1..
    2019-04-09 12:47:35.779 [DEBUG][31] StreamNative@2
    2019-04-09 12:47:35.779 [DEBUG][31] StreamNative@3
    2019-04-09 12:47:35.779 [DEBUG][31] StreamNative@4
    2019-04-09 12:47:35.779 [DEBUG][31] RollingFile(C:\Users\Public\Videos\Pyjamashjältarn a\Pyjamashjältarna_20190328_17001710.ts)..
    2019-04-09 12:47:35.779 [DEBUG][31] SharedMemoryHelper::Open(): C:\Users\Public\Videos\Pyjamashjältarna\Pyjamashjä ltarna_20190328_17001710.ts
    2019-04-09 12:47:35.779 [DEBUG][31] OpenFileMapping: Global\NPVRSlip5c50796a616d6173686ae46c7461726e615 f32303139303332385f31373030313731302e7473
    2019-04-09 12:47:35.779 [DEBUG][31] Unable to find in 'Global', about to check 'Local'
    2019-04-09 12:47:35.779 [DEBUG][31] Unable to find in either 'Global' or 'Local'
    2019-04-09 12:47:35.779 [DEBUG][31] About to stream recording: C:\Users\Public\Videos\Pyjamashjältarna\Pyjamashjä ltarna_20190328_17001710.ts
    2019-04-09 12:47:35.779 [DEBUG][31] Request had range request
    2019-04-09 12:47:35.779 [DEBUG][31] Requested Range: bytes=347908288- (564000 bytes)
    2019-04-09 12:47:35.779 [DEBUG][31] Sent 56400 bytes
    2019-04-09 12:47:35.779 [DEBUG][31] Sent 56400 bytes
    2019-04-09 12:47:35.779 [DEBUG][31] Sent 56400 bytes
    2019-04-09 12:47:35.795 [DEBUG][31] Sent 56400 bytes
    2019-04-09 12:47:35.811 [DEBUG][31] Sent 56400 bytes
    2019-04-09 12:47:35.826 [DEBUG][31] Sent 56400 bytes
    2019-04-09 12:47:35.842 [DEBUG][31] Sent 56400 bytes
    2019-04-09 12:47:35.842 [DEBUG][31] Sent 56400 bytes
    2019-04-09 12:47:35.842 [DEBUG][31] Sent 56400 bytes
    2019-04-09 12:47:35.842 [DEBUG][31] Sent 56400 bytes
    2019-04-09 12:47:35.842 [DEBUG][31] Sent total of 564000 bytes
    2019-04-09 12:47:35.842 [DEBUG][31] RollingFile.Close()
    2019-04-09 12:47:37.153 [DEBUG][37] ********** Checking VLC Heartbeat Dictionary
    2019-04-09 12:47:37.153 [DEBUG][37] +++++No entries in VLC Heartbeat Dictionary.
    Last edited by skogl; 2019-04-09 at 05:50 PM.

  7. #7
    Join Date
    Jun 2015
    Location
    Dutchess County, NY USA
    Posts
    432
    (I wonder if this post will be #6 or #7. Header shows 6 posts but only 5 items.)
    Later...JohnC

    System Status: Humming
    Desktop: Intel DX38BT MB - Intel Q9650 3GHz Quad - NVIDIA GeForce GTX 1050 Ti Graphics
    Software: Win 10 Pro(Build 1803) - NextPVR - WinTV8
    Video: Verizon FiOS - Hauppauge DCR-3250 - Hauppauge 1512 HDPVR2

  8. #8
    Join Date
    Mar 2019
    Location
    Sweden
    Posts
    20
    I'm just a junior member, my posts need to be moderated first…

  9. #9
    Join Date
    Nov 2003
    Location
    NextPVR HQ, Wellington, New Zealand
    Posts
    91,181
    Quote Originally Posted by skogl View Post
    I'm just a junior member, my posts need to be moderated first…
    Only the ones with urls in them.

  10. #10
    Join Date
    Mar 2019
    Location
    Sweden
    Posts
    20
    No comment on the logs? Why is only 56400 bytes returned when trying to read bytes at file end?

Posting Permissions

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