Recording time limited to 2 hours?
Added by stefan fiala almost 7 years ago
osmc+kodi+tvheadend 4.2.4
I use the epg to record a 3 hour show.
The gui claims it starts and ends correctly [for 3 hours]
dvr/log has "duration": 1501 [is that 3 hours]
and "start":1518318000
"stop":1518328800
Is that 3 hours?.
When I play the show with Kodi It stops at 2hours.
If I play from a PC using VLC it stops around 2 hours.
I cant find any setting limiting the max from an epg to 2 hours
I did find a different maximum for unknown that was 2 hours
after bumping that to 3h30min I didnt see any difference.
Is there a bug someplace or a hidden setting?.
Replies (34)
RE: Recording time limited to 2 hours? - Added by Mark Clarkstone almost 7 years ago
I can't remember if eit/pf "use running state" is in 4.2, but try turning that off. It's in the DVR profiles.
RE: Recording time limited to 2 hours? - Added by stefan fiala almost 7 years ago
I found "EPG running state" was on so I flipped it off.
Waded through the help and it looks promising.
Never would have connected eit/pf with EPG "accuracy", thanks!.
RE: Recording time limited to 2 hours? - Added by stefan fiala over 6 years ago
EPG running state appeared to make no difference.
I tried creating a timer, channel as desired, start 18:00 end 21:15.
It also recorded 2 hours.
The size is about the same in bytes as the other recordings
that were supposed to be 3 hours but ended up at 2 hours.
I beleive its 2 hours because I cant jump to 020100.
If I jump to 015900 and fast forward it stops within a minute.
Can it be made to record more than 2 hours, is there a bug,
or is there a limit of time/bytes buried somewhere?.
RE: Recording time limited to 2 hours? - Added by Michael Freeman about 6 years ago
Hi.
I was wondering if you ever found a solution to your problem because I am having the same issue.
1st, I am very impressed with this project. I've installed it on a Raspberry Pi box, on my Synology NAS, and in 2 instances of Ubuntu Linux on my PC (VMware) and Mac (Parallels) VM's. For the most part, it runs very, very well, and I love the flexibility it provides.
But I cannot get it to record longer than 2 hours on the same channel. As far as Tvheadend is concerned, it continues recording the program to completion, but it "releases" the tuner signal after 2 hours - consistently. If I record different streams, it behaves as it should.
I also have NextPVR installed on my PC, and decided to test it to see if the problem is my tuner (HDHomerun Prime). NextPVR will record the same stream as long as necessary with no signal disruption.
Like you, I browsed the various forums and tried different suggestions - all to no avail. In my Unbuntu installations, I am running TVheadend version 4.2.6. On my NAS box, I'm using version 4.2.3. So I'm curious - did you ever get this problem solved? If so, what did you do and what do I have to do to make this work?
Thanks.
RE: Recording time limited to 2 hours? - Added by stefan fiala about 6 years ago
I never did figure this out.
I checked the filesystem could create >2gb and >4gb files, it can.
[2 hours seems to be around 2Gb].
I tried an HD recording, and again 2 hours but this time around 4gb. SO it doesn't look like
a filesystem limit.
I tried recording without using the guide, giving channel and times, etc. Still 2 hours.
I did watch the channel whilst recording and got the impression [didn't double check] that
recording continued past 2 hours and still found it had stopped after 2 hours.
I think (its been a while) I manually hit record whilst watching a show that lasted >2hours and
thought it was recording only to find it stopped at 2hours again.
I didn't notice:-
As far as Tvheadend is concerned, it continues recording the program to completion, but it "releases" the tuner signal after 2 hours
How did you do/observe that?, watch the gui->status/logs across the 2hour mark?.
That maybe the biggest clue!.
RE: Recording time limited to 2 hours? - Added by Michael Freeman about 6 years ago
Yeah, it's confusing and frustrating.
I'm not sure how the code works - I haven't written any code in years, so I probably wouldn't know what I was looking at anyway But I just kept my eye on the tuner lamp while the recording reached the 2-hour limit, and once there, the lamp went dark. Playing the recording verifies that the recording stopped prematurely.
The logs don't seem to show any error messages that are generated around the 2-hour mark. As far Tvheadend is concerned, the recording successfully completed at the scheduled time. So my assumption is that the program 1) accesses the tuner, 2) starts recording by reading the stream associated with the frequency of the selected channel, 3) "releases" it when done, and 4) updates the log and metadata. Unfortunately in this special case, it releases it prematurely.
I'm just hoping that someone will tell me what I have to do to get around this. I love the program - very powerful and flexible - but just refuses to record anything over 2 hours. And I refuse to believe that we are the only ones to experience this behavior - this program is too popular, with far too many users, for this to be the desired behavior.
It's really frustrating ...
RE: Recording time limited to 2 hours? - Added by Em Smith about 6 years ago
How big are the created files? Two hours sounds like they're 2gb and perhaps your particular system can't have files bigger than that. Just a guess.
RE: Recording time limited to 2 hours? - Added by Michael Freeman about 6 years ago
Thanks for the reply and suggestion. But the file system is ext4, which has a max filesize of 16TB. The largest file I've been able to record is 7.8GB of an NFL Football game recorded it HD.
RE: Recording time limited to 2 hours? - Added by Mark Clarkstone about 6 years ago
RE: Recording time limited to 2 hours? - Added by Michael Freeman about 6 years ago
Ok, will do. It will be at least 2 hours before I get back to you ...
RE: Recording time limited to 2 hours? - Added by Em Smith about 6 years ago
Ext4 should be fine. If possible try doing an "sync; ls -la filename" on the file during the recording. You should see file size and timestamp incrementing. In the Tvheadend UI, the recording tab has a filesize which should match.
After the recording (or even during) try running an ffprobe since the figures in the logs can sometimes lie.
For example, on a failed recording I have, it says it is 3600 seconds (an hour), but it's not, that was just how long it was scheduled. "start" and "stop" are seconds from 1970, so the difference in the first example was 10800 seconds or three hours.
ffprobe /path/to/my/file/from/dvr/log.ts ==> Duration: 00:08:02.50, start: 41286.860267, bitrate: 4411 kb/s
If it all seems ok, then try copying the file with ffmpeg, that will tell you if the file is intact or some internal problem with the file that is causing your players to fail. It's unlikely (given that you have the problem all the time), but is possible.
ffmpeg -i /path/to/file.ts -codec copy my_temp_file.mkv ffprobe my_temp_file.mkv
(Fix up paths appropriately).
RE: Recording time limited to 2 hours? - Added by Michael Freeman about 6 years ago
Here's that log. What's interesting is that this recording should have lasted at least 2.5 hrs, but only lasted 38 minutes. I haven't seen that before.
Let me know if you need anything else. Thx.
RE: Recording time limited to 2 hours? - Added by Michael Freeman about 6 years ago
Oops, I didn't put "all" in the boxes, so it won't be of much use to you. I will get back to you tomorrow.
RE: Recording time limited to 2 hours? - Added by Em Smith about 6 years ago
(There are no errors in the log. Stream is an IPTV.)
In Configuration->Stream->Stream Profiles, are "restart on error" and "switch to another service" ticked?
Have you tried on an unencrypted channel? You can add a manual record just to check.
RE: Recording time limited to 2 hours? - Added by Michael Freeman about 6 years ago
After the recording (or even during) try running an ffprobe since the figures in the logs can sometimes lie.
For example, on a failed recording I have, it says it is 3600 seconds (an hour), but it's not, that was just how long it was scheduled. "start" and "stop" are seconds from 1970, so the difference in the first example was 10800 seconds or three hours.
ffprobe /path/to/my/file/from/dvr/log.ts
==>
Duration: 00:08:02.50, start: 41286.860267, bitrate: 4411 kb/s
---------
I ranffbrobe and got the following:
--enable-thumb
libavutil 55. 58.100 / 55. 58.100
libavcodec 57. 89.100 / 57. 89.100
libavformat 57. 71.100 / 57. 71.100
libavdevice 57. 6.100 / 57. 6.100
libavfilter 6. 82.100 / 6. 82.100
libavresample 3. 5. 0 / 3. 5. 0
libswscale 4. 6.100 / 4. 6.100
libswresample 2. 7.100 / 2. 7.100
libpostproc 54. 5.100 / 54. 5.100
[mpeg2video 0x646c20] Invalid frame dimensions 0x0.
0x641fe0] PES packet size mismatch
Last message repeated 9 times
[mpegts
Last message repeated 1 times
Input #0, mpegts, from '/usr/local/tvheadend/var/recordings/Morning-Joe/Morning-Joe2018-10-0906-00-E644.ts':
Duration: 02:00:00.50, start: 50802.989467, bitrate: 10861 kb/s
Program 749
Stream #0:0[0x1d43]: Video: mpeg2video (Main) ([128][0][0][0] / 0x0080), yuv420p(tv, top first), 1920x1080 [SAR 1:1 DAR 16:9], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
Stream #0:1[0x1d44]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, 5.1(side), fltp, 384 kb/s
Stream #0:2[0x1d45]: Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
------
So it looks like the file recorded for exactly 2 hours. And I can play the video with Kodi through to the end of the 2 hour mark. BTW, the video should have recorded for another 40 minutes ...
RE: Recording time limited to 2 hours? - Added by Em Smith about 6 years ago
At least that's good, it rules out player issues (which we pretty much assumed).
Only other thing I can think of is the "restart on error" tickbox. However I'm surprised there are no error logged given that you say the light goes out on your box.
Can VLC play direct from your tuner box? (such as some unencrypted channel). Might be interesting to see if that cuts out after two hours too.
Other than that, I can't think of anything obvious to check. If no-one comes up with an idea, then probably best to raise a bug and link back to the forum post.
RE: Recording time limited to 2 hours? - Added by Michael Freeman about 6 years ago
Michael Freeman wrote:
Oops, I didn't put "all" in the boxes, so it won't be of much use to you. I will get back to you tomorrow.
Ok, I've got that log file, with all the traces. But it's a huge file ~ 1.3GB. so I compressed it into RAR format. I hope this forum will accept compressed files. I looked through the log and didn't have anything jump out at me, although I really don't know what I'm looking at.
FYI, the recording terminated prematurely at around the 8:22 AM ET mark, if that helps at all.
Thanx for helping me try to figure this out.
debug2.rar (64.1 MB) debug2.rar |
RE: Recording time limited to 2 hours? - Added by Michael Freeman about 6 years ago
Em Smith wrote:
(There are no errors in the log. Stream is an IPTV.)
In Configuration->Stream->Stream Profiles, are "restart on error" and "switch to another service" ticked?
Have you tried on an unencrypted channel? You can add a manual record just to check.
Hi,
I'm streaming via a cable tuner connected to a Verizon Fios cable card, so I assume all the channels are encrypted - I've seen some disagreement on this point ...
Also, none of the boxes you mention in your 1st question are ticked - I'm using the default settings. Manual/autorecs don't seem to affect this behavior.
I cannot fathom why you would put a 2-hour limit in the code, so it is certainly something in my setup. Such is the life of a technologist ...
RE: Recording time limited to 2 hours? - Added by Mark Clarkstone about 6 years ago
Looks like the client/connection is dropped
2018-10-09 08:22:01.405 [ TRACE]:httpc: 0001: end of stream 2018-10-09 08:22:01.405 [ TRACE]:httpc: 0001: no keep-alive, finishing 2018-10-09 08:22:01.405 [ TRACE]:httpc: 0001: finishing 2018-10-09 08:22:01.405 [ TRACE]:httpc: 0001: shutdown
RE: Recording time limited to 2 hours? - Added by Michael Freeman about 6 years ago
Mark Clarkstone wrote:
Looks like the client/connection is dropped
[...]
Ok, I can see that. What is making that happen, and what can I do to prevent that from happening?
RE: Recording time limited to 2 hours? - Added by stefan fiala about 6 years ago
I haven't had a chance to get back to this so thanks all.
Did find a (similar?) reference:-
https://tvheadend.org/issues/3843
v4.1-2328-gca5f094
I dont remember what version I'm running, maybe a red herring.
If thats nothing to do with it, where does the "client" keep-alive come from?.
[my hdhomerun?].
RE: Recording time limited to 2 hours? - Added by Michael Freeman about 6 years ago
stefan fiala wrote:
I haven't had a chance to get back to this so thanks all.
Did find a (similar?) reference:-
https://tvheadend.org/issues/3843
v4.1-2328-gca5f094I dont remember what version I'm running, maybe a red herring.
If thats nothing to do with it, where does the "client" keep-alive come from?.
[my hdhomerun?].
Thanx for the tip, but I'm using version 4.2.3 on this box, and according to the thread the patch was rolled into v4.1-2328. So I assume this version has it. Who can I check with about this?
RE: Recording time limited to 2 hours? - Added by James Beuzeval almost 6 years ago
I was having a problem when recording with the recording stopping when it reached a size of 2GB. I was recording to a network windows share (mounted by cifs or nfs) and i'd get a "message write failed - file too large" when it reached 2148mb which would be around 30 minutes for a HD recording. This didn't make sense as it was writing NTFS.
Anyway, I isolated the problem which was due to the SMB version. I had to explicitly set it to v1 in my cifs mounting script and in my OS (LibreELEC).
This was the thread which eventually helped me - https://forum.libreelec.tv/thread/12531-smb-copy-of-file-2gb-fails/
Not sure if my problem was specific to LibreELEC but thought I'd post here as it may help somebody.
RE: Recording time limited to 2 hours? - Added by James Beuzeval almost 6 years ago
I was having a problem when recording with the recording stopping when it reached a size of 2GB. I was recording to a network windows share (mounted by cifs or nfs) and i'd get a "message write failed - file too large" when it reached 2148mb which would be around 30 minutes for a HD recording. This didn't make sense as it was writing NTFS.
Anyway, I isolated the problem which was due to the SMB version. I had to explicitly set it to v1 in my cifs mounting script and in my OS (LibreELEC).
This was the thread which eventually helped me - https://forum.libreelec.tv/thread/12531-smb-copy-of-file-2gb-fails/
Not sure if my problem was specific to LibreELEC but thought I'd post here as it may help somebody.
RE: Recording time limited to 2 hours? - Added by Michael Freeman almost 6 years ago
James Beuzeval wrote:
I was having a problem when recording with the recording stopping when it reached a size of 2GB. I was recording to a network windows share (mounted by cifs or nfs) and i'd get a "message write failed - file too large" when it reached 2148mb which would be around 30 minutes for a HD recording. This didn't make sense as it was writing NTFS.
Anyway, I isolated the problem which was due to the SMB version. I had to explicitly set it to v1 in my cifs mounting script and in my OS (LibreELEC).
This was the thread which eventually helped me - https://forum.libreelec.tv/thread/12531-smb-copy-of-file-2gb-fails/
Not sure if my problem was specific to LibreELEC but thought I'd post here as it may help somebody.
This is not exactly my situation, but gives me something to test. I will check it out and get back to you. Thanks!