NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 2 3 4 5 … 93 Next »
Get recording length from stream

 
  • 0 Vote(s) - 0 Average
Get recording length from stream
skogl
Offline

Junior Member

Posts: 20
Threads: 2
Joined: Mar 2019
#21
2019-04-12, 05:29 PM
sub: You have a PM!
skogl
Offline

Junior Member

Posts: 20
Threads: 2
Joined: Mar 2019
#22
2019-04-12, 05:30 PM
Yes, but I'm not using ffprobe. If reading stream from beginning to end it's probably working. But the way I was thinking was to send a range request and directly start reading from end, but that does not seem to work.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#23
2019-04-12, 05:31 PM
skogl Wrote:sub: You have a PM!
Thanks - I'll take a look at it.

Just to confirm, was the player VLC? and what was the server you used in this case?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#24
2019-04-12, 05:46 PM
Ok, it looks like that was exoplayer. That's fine, we can focus on exoplayer for a bit.

I guess we can work on the assumption that it's a limitation VLC, that it can't do durations of .ts files played over http?

First thing I notice about your wireshark capture from exoplayer, is the mime type is 'video/mpeg' not 'video/MP2T'. Is it actually a .ts file you're playing?
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,175
Threads: 958
Joined: May 2006
#25
2019-04-12, 05:46 PM (This post was last modified: 2019-04-12, 05:50 PM by mvallevand.)
Ok the other way to play a file is with the f= and the filename

Playing your file (I renamed it to play as a recording) with ffplay (which doesn't read the whole file either) gives the correct time

Input #0, mpegts, from 'http://172.16.3.2:8866/stream?f=K:/NBA+Basketball/NBA+Basketball_20190409_22300100.ts':
Duration: 00:12:59.78, start: 75861.826589, bitrate: 3575 kb/s

Maybe check that.

Also in config.xml turn on extend logging to see more info on the range requests.

There is also a nuiance with /stream?f= mode you proably want to add &http=true to get really accurate responses to the range requests.

Martin
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,175
Threads: 958
Joined: May 2006
#26
2019-04-12, 06:05 PM
Testing in VLC, I see that non of those modes work in getting the location, here is the extended logging

Code:
2019-04-12 13:47:46.332    [DEBUG][20]    partial file: bytes=348222288-
2019-04-12 13:47:46.332    [DEBUG][20]    Reponse header:
HTTP/1.1 206 Partial Content
Server: N-PVR
Accept-Ranges: bytes
Content-Range: bytes 348222288-348472287/348472288
Content-Length: 250000
Content-Type: application/octet-stream
Connection: close


2019-04-12 13:47:46.332    [DEBUG][20]    RollingFile.Seek(348222288)
2019-04-12 13:47:46.332    [DEBUG][20]    bufsize: 200000
2019-04-12 13:47:46.332    [DEBUG][20]    about to read 200000 from location 348222288  (current length = 348472288)
2019-04-12 13:47:46.343    [DEBUG][20]    ++++200000
2019-04-12 13:47:46.343    [DEBUG][20]    Sent: 200000 bytes
2019-04-12 13:47:46.343    [DEBUG][20]    about to read 50001 from location 348422288  (current length = 348472288)
2019-04-12 13:47:46.343    [DEBUG][20]    Not all bytes read@2
2019-04-12 13:47:46.343    [DEBUG][20]    Read() didnt get all bytes. Got 50000 of 50001 bytes requested.
2019-04-12 13:47:46.343    [DEBUG][20]    ++++50000
2019-04-12 13:47:46.344    [DEBUG][20]    Sent: 250000 bytes
2019-04-12 13:47:46.344    [DEBUG][20]    RollingFile.Close()

This shows the extra 1 byte issue that I was talking about. User fred250 knows more about this issue, I think it is the range request are zero based, so position 348472287 is the last byte in the file and NextPVR is just logging something wrong.

Martin
skogl
Offline

Junior Member

Posts: 20
Threads: 2
Joined: Mar 2019
#27
2019-04-12, 06:06 PM
Sub: All your assumptions are correct. It's exoplayer, I also Believe that Vlc has these limitations and it is a .ts file I'm playing.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#28
2019-04-12, 06:12 PM
Can you try to get another wireshark capture of exoplayer to the file on apache? Confirm it reports the duration. I'll check the mime type and other headers.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,807
Threads: 769
Joined: Nov 2003
#29
2019-04-12, 06:20 PM
mvallevand Wrote:This shows the extra 1 byte issue that I was talking about. User fred250 knows more about this issue, I think it is the range request are zero based, so position 348472287 is the last byte in the file and NextPVR is just logging something wrong.
It's probably not worth adding this other /stream?f= call into the mix. (since it will just complicate the discussion, given the buggy byte range and needing http=true). This is not an issue on the original call he was looking at.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,175
Threads: 958
Joined: May 2006
#30
2019-04-12, 06:25 PM
Didn't that buggy byte range apply to the recording_id too which is why fred250 needed f= with his Samsung app.

Martin
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (5): « Previous 1 2 3 4 5 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  Custom recording tomx 2 738 2025-02-07, 09:14 AM
Last Post: tomx
  API call for Recording Complete linustorvalds 1 493 2025-01-19, 02:11 PM
Last Post: mvallevand
  Manual recording API mvallevand 2 1,158 2023-11-09, 02:14 PM
Last Post: mvallevand
  API channel.stream.start mvallevand 2 1,474 2023-05-07, 09:40 PM
Last Post: mvallevand
  IPTV like stream from Sound Card input - FM Radio Project NumberFive 3 1,569 2022-11-20, 04:28 PM
Last Post: mvallevand
  Recording direct to GPhotos API rgonzalez 0 1,537 2020-06-29, 04:45 AM
Last Post: rgonzalez
  Recurring Recording URL Parameters jcole998 2 3,094 2019-09-19, 01:08 PM
Last Post: jcole998
  Unexpected result when deleting a pending recording scJohn 5 3,923 2018-05-06, 10:09 PM
Last Post: sub
  How to best verify success when adding a recurring recording drmargarit 1 2,897 2017-03-02, 03:13 PM
Last Post: mvallevand
  Change recording filename programmatically immediately before recording starts? craigrs84 5 6,258 2015-07-13, 09:28 PM
Last Post: patco444

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode