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 … 68 69 70 71 72 … 433 Next »
Changing channels in a batch file - how to add a delay

Changing channels in a batch file - how to add a delay
wtg
Offline

Posting Freak

Posts: 1,402
Threads: 120
Joined: Mar 2005
#1
2011-01-18, 07:16 PM
I have occasional trouble with my HD-PVR, and it seems to be resolved by occasionally turning it off and on again. Since I have the occasional recording fail I want a way to reset the box at the beginning of every recording and I almost have it, but not quite.

Using some X10 software I can turn the power to the device off and back on programmatically, and adding the calls to the batch file I use for changing channels seems like a good means to do it. The problem is npvr tries to create the graph for the recording before the box is finished resetting, so now it fails consistently and reliably. Smile

I thought I'd be clever and add a delay to the channel change script, giving the box about 10 seconds to finish resetting before continuing. Using the TIMEOUT command, I can indeed add a 10 second delay to the batch file and I've verified that it's taking that long since I cycle the HDPVR, wait 10 seconds and then issue my firewire command to change the channel. I can observe the delay. However, something a little peculiar happens when I do this.

Looking at npvr's logs, without any delay npvr goes from calling the channel change script to trying to setup the filter in about a second:

Code:
2011-01-18 13:33:43.879    [INFO][7]    Running blaster: C:\vid\STB\channel.bat 951
2011-01-18 13:33:44.598    [INFO][7]    Creating graph

However, when adding a delay to the batch file npvr just waits a little while before continuing. It's not as fast as usual, but it's not waiting for the batch file to finish either - it seems to wait an extra 4-6 seconds but then goes ahead and resumes. Isn't that odd?

Code:
2011-01-18 13:32:27.320    [INFO][7]    Running blaster: C:\vid\STB\channel.bat 951
2011-01-18 13:32:31.830    [INFO][7]    Creating graph
2011-01-18 13:32:31.866    [DEBUG][7]    FindFilterByName failed to locate filter: Hauppauge HD PVR Crossbar

So, any suggestions? While I think it would be great if npvr actually waited for the channel change to finish, I know mine is a bit of an odd request so I'm not exactly expecting a change to npvr. I know I can use the Windows Task Scheduler to cycle the power on the HDPVR periodically, but that runs the risk happening during a recording to screwing it up. So, any other ideas?

Thanks,
Tim
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,677
Threads: 767
Joined: Nov 2003
#2
2011-01-18, 07:27 PM
It waits a maximum of 5 seconds for the blaster to complete. If it hasnt completed by then, it continues on.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,677
Threads: 767
Joined: Nov 2003
#3
2011-01-18, 07:31 PM
I can bump up this timeout for you, but I suspect your scheme will have problems anyway, since the graph is already built and you're effective breaking that graph by removing the power from the device.
wtg
Offline

Posting Freak

Posts: 1,402
Threads: 120
Joined: Mar 2005
#4
2011-01-18, 07:52 PM
sub Wrote:I can bump up this timeout for you, but I suspect your scheme will have problems anyway, since the graph is already built and you're effective breaking that graph by removing the power from the device.

If you're willing to make the change, I'm certainly willing to test it, or if you can think of a way that I can test the box reset/broken graph theory now I'd be happy to.

Thanks,
Tim
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,677
Threads: 767
Joined: Nov 2003
#5
2011-01-18, 07:55 PM
This patch bumps it up to a 12 seconds maximum, but as I said, I suspect you'll have these other problems.
wtg
Offline

Posting Freak

Posts: 1,402
Threads: 120
Joined: Mar 2005
#6
2011-01-18, 08:38 PM
sub Wrote:This patch bumps it up to a 12 seconds maximum, but as I said, I suspect you'll have these other problems.

Thanks sub... I really didn't expect you to make a change for this since it's an usual issue. As usual, the support you provide is brilliant. Interesting results too.

The 1st time I tried it, my machine locked up hard... Ctrl-Alt-Del didn't do anything and I had to hit the reset button.

The 2nd time, after reboot, it looks like 12 seconds wasn't quite enough. Same error as before and the recording failed to start.

However, the 3rd time was a charm, or almost anyway. The recording started up but if you look closely you'll see that the device failed to report it's resolution and thus npvr setup a SD resolution recording. My guess is with just a little more time the box would have finished resetting, reported the correct resolution and npvr set it's bitrate correctly.

Code:
2011-01-18 15:12:40.946    [DEBUG][7]    [color=red]About to start recording (1069)[/color]: F:\video\recordings\The Other Man\The Other Man_20110118_14301600.ts
2011-01-18 15:12:40.947    [INFO][7]    HDPVRRecorder.StartStream(F:\video\recordings\The Other Man\The Other Man_20110118_14301600.ts)
2011-01-18 15:12:40.947    [INFO][7]    HDPVR stream count now 1
2011-01-18 15:12:40.947    [INFO][7]    Running blaster: C:\vid\STB\channel.bat 954
2011-01-18 15:12:52.494    [INFO][7]    Creating graph
[COLOR="red"]2011-01-18 15:12:52.535    [DEBUG][7]    FindFilterByName failed to locate filter: Hauppauge HD PVR Crossbar
[/COLOR]2011-01-18 15:12:52.587    [DEBUG][7]    Temp at 1/18/2011 3:13:02 PM
2011-01-18 15:12:52.587    [DEBUG][7]    Failed to start recording (1069:F:\video\recordings\The Other Man\The Other Man_20110118_14301600.ts): 'Unable to locate crossbar filter (Hauppauge HD PVR Crossbar: #1)'
<...snip...>
2011-01-18 15:16:54.942    [DEBUG][7]    [color=red]About to start recording (1070)[/color]: F:\video\recordings\The Other Man\The Other Man_20110118_14301600.ts
2011-01-18 15:16:54.942    [INFO][7]    HDPVRRecorder.StartStream(F:\video\recordings\The Other Man\The Other Man_20110118_14301600.ts)
2011-01-18 15:16:54.942    [INFO][7]    HDPVR stream count now 2
2011-01-18 15:16:54.942    [INFO][7]    Running blaster: C:\vid\STB\channel.bat 954
2011-01-18 15:17:06.458    [INFO][7]    Creating graph
2011-01-18 15:17:06.707    [DEBUG][7]    Graph filter list:
2011-01-18 15:17:06.707    [DEBUG][7]     - NPVR Writer2
2011-01-18 15:17:06.707    [DEBUG][7]     - NPVR Writer
2011-01-18 15:17:06.707    [DEBUG][7]     - Infinite Pin Tee Filter
2011-01-18 15:17:06.707    [DEBUG][7]     - Hauppauge HD PVR Encoder
2011-01-18 15:17:06.707    [DEBUG][7]     - Hauppauge HD PVR Capture Device
2011-01-18 15:17:06.707    [DEBUG][7]     - Hauppauge HD PVR Crossbar
[COLOR="red"]2011-01-18 15:17:06.708    [INFO][7]    About to start graph
2011-01-18 15:17:06.712    [DEBUG][7]    Device reports resolution: [B]0x0 (fps:0)[/B]
[/COLOR]2011-01-18 15:17:06.713    [DEBUG][7]    device minimum bitrate: 200000
2011-01-18 15:17:06.713    [DEBUG][7]    device maximum bitrate: 13500000
2011-01-18 15:17:06.713    [DEBUG][7]    device bitrate step size: 100000
2011-01-18 15:17:06.716    [DEBUG][7]    device reports current bitrate as: 0
2011-01-18 15:17:06.720    [DEBUG][7]    device reports current peak bitrate as: 0
2011-01-18 15:17:06.720    [DEBUG][7]    About to set BITRATE MODE
2011-01-18 15:17:06.724    [DEBUG][7]    requesting variable encoding
2011-01-18 15:17:06.736    [DEBUG][7]    trying to request bitrate: 3000000
2011-01-18 15:17:06.756    [DEBUG][7]    device confirms bitrate as: 0
2011-01-18 15:17:06.756    [DEBUG][7]    About to set PEAK BITRATE
2011-01-18 15:17:06.756    [DEBUG][7]    device minimum peak bitrate: 200000
2011-01-18 15:17:06.756    [DEBUG][7]    device maximum peak bitrate: 20200000
2011-01-18 15:17:06.756    [DEBUG][7]    device peak bitrate step size: 100000
2011-01-18 15:17:06.756    [DEBUG][7]    [color=red]trying to request peak bitrate: [B]5000000[/B][/color]
2011-01-18 15:17:06.768    [DEBUG][7]    device confirms bitrate as: 0
2011-01-18 15:17:10.833    [DEBUG][7]    About to switch HDPVR to target:
F:\video\recordings\The Other Man\The Other Man_20110118_14301600.ts
2011-01-18 15:17:10.847    [DEBUG][7]    Temp at 1/18/2011 3:17:20 PM
[color=blue]2011-01-18 15:17:10.847    [DEBUG][7]    Started recording (1070:F:\video\recordings\The Other Man\The Other Man_20110118_14301600.ts)[/color]
2011-01-18 15:17:10.962    [DEBUG][7]    Starting: C:\Users\Public\NPVR\Scripts\ParallelProcessing.bat "F:\video\recordings\The Other Man\The Other Man_20110118_14301600.ts" 954 1070
wtg
Offline

Posting Freak

Posts: 1,402
Threads: 120
Joined: Mar 2005
#7
2011-01-18, 08:40 PM
So if you're willing, I'd love to try with perhaps a 15 second delay. Conceivably, if people needed to turn out equipment, etc I could see how this could be useful outside of my situation, especially if it were configurable.
wtg
Offline

Posting Freak

Posts: 1,402
Threads: 120
Joined: Mar 2005
#8
2011-01-20, 08:20 PM
Any thoughts on this sub? The 12 second delay was almost enough... it works sometimes but as you can see above it appears it was not quite enough at least once. A 15 second delay should cover this scenario and probably other fancy stuff people might try to do to turn on basic equipment.

Of course a configurable delay might be useful for people that wanted to turn on a cable box or something.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,677
Threads: 767
Joined: Nov 2003
#9
2011-01-20, 08:28 PM
This bumps it up to 20 seconds.

At the end of the day, it will still complete in a second or so for most people. This is just a maximum it'll wait.
PRBUK
Offline

Junior Member

Posts: 38
Threads: 7
Joined: Jan 2018
#10
2018-01-01, 11:59 AM
I know this is an old thread! Is this 'delay' capability available as a parameter somewhere (sorry if I missed it)?

Scenario: I use NextPVR to perform recordings from an STB via Colossus HDMI and SPDIF for audio. I trigger IR blasting (IR Server Suite) from the ParallelProcessing.bat file. The STB has often gone into standby, so the script sends a 'power on' blast, waits 15 seconds for the box to come online and then blasts the required channel. If the STB was already online this all works fine, but if it was in standby the recordings seem to start before the script ends and some players do not detect the recorded audio correctly.

The current workaround is to record the previous program as well. Is there a way I can trigger IR activity 15-30 seconds before a recording starts (power on command), or to delay the start of recording/build of the graph? This is effectively what the thread above was achieving - hopefully the patch is now available as a parameter?!!

Thank You for your advice!
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (2): 1 2 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  decoder issue? some channels don't play Donsch 10 5,065 2023-12-04, 10:19 PM
Last Post: turkeypets
  incorrect frequency in adelaide .ini file spin35 5 2,966 2023-02-01, 05:40 PM
Last Post: sub
  double channels MaxOne72 2 1,297 2021-08-15, 05:22 AM
Last Post: MaxOne72
  Can't watch certain channels on live tv (but can record) tvwatcher 4 2,082 2021-05-05, 06:23 AM
Last Post: tvwatcher
  ts file shows length too long? SuttonWillow 2 1,881 2021-03-15, 01:56 PM
Last Post: mvallevand
  Unhandled Exception: file name too long (idiots at pbs made it super long) jobby99 1 1,383 2020-10-29, 09:40 PM
Last Post: mvallevand
  ts file shows length too long SamM 4 2,307 2020-10-06, 02:45 AM
Last Post: Ehrlichia
  EPG displaying small subset of xmltv file. Esteban 9 2,972 2020-07-18, 10:07 PM
Last Post: Esteban
  Max File Size jrockow 2 1,510 2020-04-21, 02:38 PM
Last Post: jrockow
  Channels/PIP popups not working 4.2.5 (191014) eastavin 7 2,757 2020-04-20, 03:20 AM
Last Post: eastavin

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

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

Linear Mode
Threaded Mode