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
#1
2019-03-31, 05:28 PM
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!
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#2
2019-04-05, 03:32 PM
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.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,768
Threads: 954
Joined: May 2006
#3
2019-04-05, 03:45 PM
There are issues with in progress recordings.

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#4
2019-04-05, 03:48 PM
mvallevand Wrote: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.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#5
2019-04-05, 03:57 PM
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.
skogl
Offline

Junior Member

Posts: 20
Threads: 2
Joined: Mar 2019
#6
2019-04-09, 10:18 AM (This post was last modified: 2019-04-09, 05:50 PM by skogl.)
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ältarna\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\NPVRSlip5c50796a616d6173686ae46c7461726e615f32303139303332385f31373030313731302e7473
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.
jcole998
Offline

Posting Freak

New York, USA
Posts: 856
Threads: 186
Joined: Jun 2015
#7
2019-04-10, 01:21 PM
(I wonder if this post will be #6 or #7. Header shows 6 posts but only 5 items.)
Later...JohnC

System Status: Humming nicely!  Smile
Desktop: Intel DX38BT MB - Intel Q9650 3GHz Quad - NVIDIA GeForce GTX 1050 Ti Graphics
Software: Win 10 Pro(Build 1909) - NextPVR - WinTV8
Video: Verizon FiOS - Hauppauge DCR-3250 - Hauppauge 1512 HDPVR2
RaspberryPi 4 Raspbian and FLIRC
skogl
Offline

Junior Member

Posts: 20
Threads: 2
Joined: Mar 2019
#8
2019-04-10, 01:46 PM
I'm just a junior member, my posts need to be moderated first… Smile
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,626
Threads: 767
Joined: Nov 2003
#9
2019-04-10, 05:23 PM
skogl Wrote:I'm just a junior member, my posts need to be moderated first… Smile
Only the ones with urls in them.
skogl
Offline

Junior Member

Posts: 20
Threads: 2
Joined: Mar 2019
#10
2019-04-11, 02:18 PM
No comment on the logs? Why is only 56400 bytes returned when trying to read bytes at file end?
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Custom recording tomx 2 401 2025-02-07, 09:14 AM
Last Post: tomx
  API call for Recording Complete linustorvalds 1 273 2025-01-19, 02:11 PM
Last Post: mvallevand
  Manual recording API mvallevand 2 909 2023-11-09, 02:14 PM
Last Post: mvallevand
  API channel.stream.start mvallevand 2 1,239 2023-05-07, 09:40 PM
Last Post: mvallevand
  IPTV like stream from Sound Card input - FM Radio Project NumberFive 3 1,313 2022-11-20, 04:28 PM
Last Post: mvallevand
  Recording direct to GPhotos API rgonzalez 0 1,394 2020-06-29, 04:45 AM
Last Post: rgonzalez
  Recurring Recording URL Parameters jcole998 2 2,882 2019-09-19, 01:08 PM
Last Post: jcole998
  Unexpected result when deleting a pending recording scJohn 5 3,632 2018-05-06, 10:09 PM
Last Post: sub
  How to best verify success when adding a recurring recording drmargarit 1 2,724 2017-03-02, 03:13 PM
Last Post: mvallevand
  Change recording filename programmatically immediately before recording starts? craigrs84 5 5,973 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