NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Legacy (v4.x and earlier) v
« Previous 1 … 63 64 65 66 67 … 433 Next »
Defective TS files with displayed zero length

Defective TS files with displayed zero length
johnsta
Offline

Member

Posts: 62
Threads: 7
Joined: May 2016
#1
2018-01-31, 02:07 PM
Thread: Tuner card died -- looking for recommendations
https://forums.nextpvr.com/showthread.ph...post520628

That thread described replacing the Ceton card with an HD HomeRun box.
It also described some problems that I was having with defective TS
files recorded with both the Ceton and HDHomeRun configurations.

During the last week I've been doing a lot of research on this
problem, and I've identified what appear to be issues in NRecord. The
purpose of this thread is to document the results.


***
*** Introduction
***

As I described in the last thread, NRecord has produced some defective
TS files, and it's getting worse, to the point where it's becoming a
nightmare. The defective files display zero recording length in VLC:

- Partially defective TS files can be played in VLC because the
progress bar works (even though the hotkeys don't)

- Totally defective TS files can't be played at all in VLC.

As I described in the last thread, NPVR has been occasionally
producing partially defective TS files for months, but I blamed them
on the Ceton card. However, when I switched to an HDHR box in early
December and the same thing happened, it appeared that the problem was
in NPVR itself. It's hard to believe that both the Ceton card and the
HDHR box are producing the same problem, since one is electrically
connected to the I/O bus, but while the other transmits data through
the router over a network connection. Still, they have a common
component (the Comcast Cablecard), so that possibility has to be
considered.

Starting on December 26, there was a new development. Every recording
of the "WBZ News at 11" (at 11pm) was totally defective. Although
initially this was a really depressing discovery, it was actually a
gift from heaven, because it provided a platform where repeatable
tests could be performed.

In the last two weeks, I've been playing around with different tests,
and all these tests point to a bug in NRecord that's creating bad
TS files during the first few seconds that recording starts.

***
*** Test #1: Duplicate Recording Test
***

In this test, which I've tried several times, I create a manual
recording that records exactly the same show, "WBZ News at 11," as
a manual recording. Result:

- The recurring recording is totally defective, as usual.

- The manual record is not defective at all.

Both of these recordings are made by NRecord from the same tuner on
the same HDHR box, so they should produce the same results, but they
don't, indicating that NRecord is handling them differently.

Here are the ffprobe listings for the two TS files:

Code:
--- ffprobe -hide_banner "d:\tv\shows\WBZ News at 11_20180125_23002335.ts"
[mpeg2video @ 000000000046f100] Invalid frame dimensions 0x0.
    Last message repeated 13 times
[mpegts @ 00000000004655a0] PES packet size mismatch
    Last message repeated 1 times
[mpegts @ 00000000004655a0] Could not find codec parameters
               for stream 3 (Unknown: none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'd:\tv\shows\WBZ News at 11_20180125_23002335.ts':
  Duration: 00:37:00.10, start: 21792.896522, bitrate: 3161 kb/s
  Program 4
  Program 3
    Stream #0:0[0x1823]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
               yuv420p(tv, top first), 720x480 [SAR 8:9 DAR 4:3],
               Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x1824](eng): Audio: ac3 (AC-3 / 0x332D4341),
               48000 Hz, 5.1(side), fltp, 384 kb/s
    Stream #0:2[0x1825](spa): Audio: ac3 (AC-3 / 0x332D4341),
               48000 Hz, stereo, fltp, 192 kb/s
  No Program
    Stream #0:3[0x17e9]: Unknown: none
Unsupported codec with id 0 for input stream 3

--- ffprobe -hide_banner "d:\tv\shows\WBZNews-11_20180125_23002340.ts"

[mpeg2video @ 00000000002ddfe0] Invalid frame dimensions 0x0.
    Last message repeated 13 times
[mpegts @ 00000000002d55a0] PES packet size mismatch
    Last message repeated 1 times
Input #0, mpegts, from 'd:\tv\shows\WBZNews-11_20180125_23002340.ts':
  Duration: 00:42:00.40, start: 21792.896522, bitrate: 3118 kb/s
  Program 3
    Stream #0:0[0x1823]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002),
               yuv420p(tv, top first), 720x480 [SAR 8:9 DAR 4:3],
               Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x1824](eng): Audio: ac3 (AC-3 / 0x332D4341),
               48000 Hz, 5.1(side), fltp, 384 kb/s
    Stream #0:2[0x1825](spa): Audio: ac3 (AC-3 / 0x332D4341),
               48000 Hz, stereo, fltp, 192 kb/s


These two dumps should be virtually identical, but they aren't.

The first of these two dumps illustrates something that I've seen in
all the defective TS files: There are almost always additional
"Program N" sections, in addition to "Program 3".

Here's another piece of information: I've tested these TS files
immediately after they've started recording, as little as 15 seconds
later. It's clear that whether or not they're defective is determined
immediately when the the TS file is initialized by NRecord.

In the past, I assumed that some error was occurring at the end of the
recording session, that perhaps NRecord wasn't closing the file
properly. But these observations make it clear that whatever error is
occurring is occurring at the beginning of the session, at file
creation time, before data recording even begins.


***
*** Test #2: NRecord restart test
***

In this test, which I've also tried several times, I kill NRecord and
restart the service about around 10:45 pm.

Restarting NRecord should not have any effect on a recording beginning
at 11 pm, but it does. Result: The recording of "WBZ News at 11" is
not defective at all under these cirdumstances.

What this indicates to me is that NRecord is in some error state
that gets cleared when NRecord is restarted at 10:45 pm.

***
*** An unrelated bug: NRecord stops recording anything
***

This is a completely separate bug which, as far as I know: NRecord
simply stops recording. Several months ago, I set up a script that
wakes up every 60 seconds and checks the recording directory to see if
the TS file time stamps are being updated. If not, then it pops up an
alert telling me that NRecord has stopped recording, and I just kill
NRecord and restart the service.

While I was working on the defective file bug, I was "fortunate"
enough to see this other bug occur as it happened, and was able to see
what was happening.

The Comcast network went down for a few minutes, both cable tv and
internet. When Comcast came back up, NRecord didn't recover properly,
and simply stopped recording.

I don't know if there are any other reasons why NRecord would stop
recording, but this certainly seems to be one of them.

If I could make a suggestion, start up a background thread in NRecord
that sleeps but wakes up every 30-60 seconds to see if NRecord has
stopped recording and, if so, do something to start it up again.

***
*** Summary
***

I have some other test variations that I want to try in the next few
days, and I'll post additional information as I have it.

I realize that you probably don't support Windows 7 much any more, and
this may be a Windows 7 problem, for all I know.

But producing defective TS files is an absolute nightmare, and
anything you can tell me as workarounds either to prevent the problem
or to repair the files would be greatly appreciated.

For example, if you look at the ffprobe dump of the defective TS
files, all of them have a "Program 3" that looks correct, including
the correct duration, but the defective ones have one or more of
"Program N" that I assume are confusing VLC.

Is there some simple way, either using direct binary editing, or using
ffprobe or ffmpeg, set some internal pointer so that VLC will only see
Program 3?

Any workarounds of this kind would be appreciated. Thanks.
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,909
Threads: 956
Joined: May 2006
#2
2018-01-31, 05:19 PM
As I asked before place a copy of the problem file on the cloud like Dropbox, Google drive or MS OneDrive and we can check it out.

Also in the other post I believe I referred you to ts4np. If the problem is just the extra program blocks with no data it would clean those out.

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,686
Threads: 767
Joined: Nov 2003
#3
2018-01-31, 06:23 PM
We'll definitely need a sample file.

Quote:As I described in the last thread, NRecord has produced some defective
TS files
Just to be clear - NextPVR is just recording a dump of whatever comes from the device. It's not manipulating it in any way, so whatever is wrong with the stream is coming from the device itself. If you can supply a sample file though, there may be something relatively easy that we can do to fix the stream (like throwing away some garbage packets etc).
johnsta
Offline

Member

Posts: 62
Threads: 7
Joined: May 2016
#4
2018-01-31, 06:55 PM
mvallevand Wrote:> As I asked before place a copy of the problem file on the cloud
> like Dropbox, Google drive or MS OneDrive and we can check it out.

> Also in the other post I believe I referred you to ts4np. If the
> problem is just the extra program blocks with no data it would
> clean those out.

> Martin

Hi Martin,

This morning I recorded a show that was in the "partially defective"
category (as described in my last message), meaning that VLC shows
zero length, but could still play it using the progress bar.

I uploaded the TS file to my web site and you can download it from
here:

http://jxenakis.com/gdgraphics/GMT_20180131_07000730.ts

Please download this file as quickly as possible, since it's taking up
a lot of space on my web site server and I'd like to delete it from
there.

As for ts4np, I tried to find that program when you first mentioned it
(January 20). It apparently no longer exists under that name, but was
renamed years ago to TsRemux.

So at that time I downloaded TsRemux v.0.0.21.2, and tried it out,
but it seemed to hang and do nothing.

So I tried to run it again today, and this time it reached completion
after six minutes. I tried it on the same file described above that I
uploaded to my web site.

The result: TsRemux did process the file, but the output was worse
than the original -- a "totally defective" output TS file, where the
input was a "partially defective" TS file.

Below is the entire session, including the ffprobe for the input file,
the TsRemux session, and the ffprobe for the output file:

Code:
--- ffprobe -hide_banner GMT_20180131_07000730.ts
[mpeg2video @ 000000000049d8c0] Invalid frame dimensions 0x0.
    Last message repeated 10 times
[mpegts @ 000000000049a8c0] PES packet size mismatch
[mpegts @ 000000000049a8c0] Could not find codec parameters for stream 2 (Unknown: none (ETV1 / 0x31565445)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 000000000049a8c0] Could not find codec parameters for stream 3 (Unknown: none (ETV1 / 0x31565445)): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 000000000049a8c0] Could not find codec parameters for stream 4 (Unknown: none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
[mpegts @ 000000000049a8c0] Could not find codec parameters for stream 5 (Unknown: none): unknown codec
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'GMT_20180131_07000730.ts':
  Duration: 00:32:00.21, start: 82747.437000, bitrate: 3295 kb/s
  Program 8
    Stream #0:0[0x11ad]: Video: mpeg2video (Main) ([2][0][0][0] / 0x0002), yuv420p(tv, top first), 720x480 [SAR 8:9 DAR 4:3], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc
    Stream #0:1[0x11ae](eng): Audio: ac3 ([129][0][0][0] / 0x0081), 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:2[0x11af]: Unknown: none (ETV1 / 0x31565445)
    Stream #0:3[0x11b0]: Unknown: none (ETV1 / 0x31565445)
  No Program
    Stream #0:4[0x128f]: Unknown: none
    Stream #0:5[0x128e]: Unknown: none
Unsupported codec with id 0 for input stream 2
Unsupported codec with id 0 for input stream 3
Unsupported codec with id 0 for input stream 4
Unsupported codec with id 0 for input stream 5



--- TsRemux0212-180120.exe GMT_20180131_07000730.ts    gmtx.ts
TsRemux v.0.0.21.2
2018-01-31.12:46:31.053 pre-processing input file: GMT_20180131_07000730.ts
2018-01-31.12:52:24.155 begin remuxing to: gmtx.ts
2018-01-31.12:52:39.302 done remuxing


--- ffprobe -hide_banner gmtx.ts
[mpeg2video @ 00000000002dfa40] Invalid frame dimensions 0x0.
    Last message repeated 10 times
[mpegts @ 00000000002da8c0] start time for stream 0 is not set in estimate_timings_from_pts
[mpegts @ 00000000002da8c0] Could not find codec parameters for stream 0 (Audio: ac3 ([129][0][0][0] / 0x0081), 0 channels, fltp): unspecified sample rate
Consider increasing the value for the 'analyzeduration' and 'probesize' options
Input #0, mpegts, from 'gmtx.ts':
  Duration: 00:32:00.21, start: 82747.437000, bitrate: 3146 kb/s
  Program 1
    Stream #0:0[0x1100]: Audio: ac3 ([129][0][0][0] / 0x0081), 0 channels, fltp
    Stream #0:1[0x1101]: Audio: ac3 (AC-3 / 0x332D4341), 48000 Hz, stereo, fltp, 192 kb/s
    Stream #0:2[0x1011]: Video: mpeg2video (Main) (HDMV / 0x564D4448), yuv420p(tv, top first), 720x480 [SAR 8:9 DAR 4:3], Closed Captions, 29.97 fps, 29.97 tbr, 90k tbn, 59.94 tbc


Thanks,
John
johnsta
Offline

Member

Posts: 62
Threads: 7
Joined: May 2016
#5
2018-01-31, 07:20 PM
sub Wrote:> We'll definitely need a sample file.

> (Quote)As I described in the last thread, NRecord has produced
> some defective TS files

> Just to be clear - NextPVR is just recording a dump of whatever
> comes from the device. It's not manipulating it in any way, so
> whatever is wrong with the stream is coming from the device
> itself. If you can supply a sample file though, there may be
> something relatively easy that we can do to fix the stream (like
> throwing away some garbage packets etc).


I ran several tests designed to either confirm or eliminate
that possibility. Please note the following:
  • I tried killing and restarting NRecord at 10:45 pm several times,
    and each time, the recorded file for "WBZ news at 11" was NOT
    defective. Restarting NRecord should have made no difference, but it
    did.

  • I tried "double recording" the "WBZ news at 11." The "recurring
    recording" version WAS defective, while the "manual recording" version
    was NOT defective at all. NRecord was recording from the same tuner
    in the same HDHR box, so the two recordings should have been
    identical, but they weren't.

  • I tried playing the "WBZ News at 11" recording within
    just a few seconds after it started recording, it was already
    defective. This suggests that the NRecord bug occurs as
    the file is being initialized.

I've been a Senior SW Engineer for a long time, and I've tested this
problem in every way I can, and every test I've tried points to a
problem when NRecord initializes a new recording. If you want to
suggest another test, let me know.

All of these tests are described in detail in my first message. As I
indicated in the last message, I've provided a sample file from this
morning:

http://jxenakis.com/gdgraphics/GMT_20180131_07000730.ts

Thanks,
John
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,909
Threads: 956
Joined: May 2006
#6
2018-01-31, 07:48 PM (This post was last modified: 2018-01-31, 08:05 PM by mvallevand.)
That file and timeline seems to play ok in NextPVR, Kodi and mpchc for me. Is there a specific area that is bad for you?

FWIW I don't consider VLC a great reference player. There are two streams PID 4750 and 4751 that cause problems for ts4np if your remux them out you might have more luck. PID 81 is also a bit
messed up I don't consider that NextPVR is causing these problems.

Note ffmpeg debug warnings occur in Kodi on pretty much every ts file I have seen not just from NextPVR.

Martin
johnsta
Offline

Member

Posts: 62
Threads: 7
Joined: May 2016
#7
2018-01-31, 08:38 PM
mvallevand Wrote:> That file and timeline seems to play ok in NextPVR, Kodi and mpchc
> for me. Is there a specific area that is bad for you?

> FWIW I don't consider VLC a great reference player. There are two
> streams PID 4750 and 4751 that cause problems for ts4np if your
> remux them out you might have more luck. PID 81 is also a bit
> messed up I don't consider that NextPVR is causing these problems.

> Note ffmpeg debug warnings occur in Kodi on pretty much every ts
> file I have seen not just from NextPVR.

> Martin




Hi Martin,

OK, well as I said that file does play on VLC, but it shows
a zero length and the hotkeys don't work.

Here's a recording of last night's WBZ News at 11:

http://jxenakis.com/gdgraphics/WBZNewsAt11-20180130.ts

This file doesn't play at all on either VLC or NextPVR.

By the way, I never get any sound when I play any file in NextPVR.
It's never bothered me because I ususally use VLC. I assume that I
have to install something or something. Could someone tell me how to
fix that so I can get sound in NextPVR?

Thanks,

John
mvallevand
Online

Posting Freak

Ontario Canada
Posts: 52,909
Threads: 956
Joined: May 2006
#8
2018-01-31, 09:26 PM
Ok that file will need sub's review, first because NextPVR because doesn't like the two program streams in the beginning of file (which ts4np does fix) but also after that fix the the time is still wrong so the timeline is off. An ffmpeg -acodec copy -vocdec copy remux fixes the file for NextPVR.

The original files plays fine in with working timeline in Kodi and in mpchd

For someone who posts so many details I am surprised you didn't read the sticky to find you need to configure an AC3 decoder.

Martin
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,686
Threads: 767
Joined: Nov 2003
#9
2018-01-31, 11:00 PM
johnsta, do you have the logs showing the recording of that last file you posted?
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,686
Threads: 767
Joined: Nov 2003
#10
2018-01-31, 11:14 PM
johnsta Wrote:Here's a recording of last night's WBZ News at 11:

http://jxenakis.com/gdgraphics/WBZNewsAt11-20180130.ts

This file doesn't play at all on either VLC or NextPVR.
I've attached an updated NPVRTSReader4.ax that should cope better with files like this. With this update, this file is playing for me.
« Next Oldest | Next Newest »

Users browsing this thread: 2 Guest(s)

Pages (8): 1 2 3 4 5 … 8 Next »
Jump to page 


Possibly Related Threads…
Thread Author Replies Views Last Post
  ts file shows length too long? SuttonWillow 2 1,887 2021-03-15, 01:56 PM
Last Post: mvallevand
  ts file shows length too long SamM 4 2,316 2020-10-06, 02:45 AM
Last Post: Ehrlichia
  Possible to record in different format than .ts files? gadgetgaz 29 12,576 2020-10-04, 03:05 PM
Last Post: Ehrlichia
  Log files Brucek2839 1 1,198 2020-03-23, 02:37 AM
Last Post: mvallevand
  Generate missing thumbnails for video files imported into NextPVR Jimixter 7 3,129 2019-12-17, 01:32 PM
Last Post: mvallevand
  Incorrect length of recording Ehjay 11 3,248 2019-11-28, 08:08 PM
Last Post: mvallevand
  Comskip edl files ignored dbguru 3 2,189 2019-10-24, 06:11 PM
Last Post: mvallevand
  log files for streaming outside network MaxOne72 9 2,534 2019-07-26, 05:32 AM
Last Post: persim
  nfo files not deleted on show deletion? jksmurf 30 8,630 2019-02-18, 12:13 AM
Last Post: jksmurf
  Local Files snaitaz 3 1,867 2019-01-02, 01:32 PM
Last Post: snaitaz

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

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

Linear Mode
Threaded Mode