NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public NextPVR Support Windows v
« Previous 1 … 84 85 86 87 88 … 101 Next »
Post Processing v5.03/4

 
  • 0 Vote(s) - 0 Average
Post Processing v5.03/4
jordy1955
Offline

Junior Member

Posts: 46
Threads: 9
Joined: Jul 2016
#1
2020-05-01, 10:17 AM
Hey Guys,

I've been running PostProcessing.bat for years on V4 and never had an issue - at least after I got it doing what I wanted Smile
However, On 5.0.3 and 5.0.4 it seems to only work when it feels like it. I have the batch file rename the .ts file to get rid of the date/Time suffix. and when it works it's perfect, but at the moments it only happens about 30% of the time.

It's to do with the %REC_TITLE% output.

Can you take a look and see if you can work out why it doesn't work all the time. If it works more than once, that should mean that there is nothing wrong with the coding of the file shouldn't it?

Anyway, I await your responses.

Contents of my bat file: Note, the Bold line is where it fails all the time, except for when it doesn't. If it gets past that it finishes ok. The lines in italics append HD or SD to the file for subsequent processing for commercial removal. The extra HD/SD tacked on after the.ts is to prevent the batch file looping and adding numerous _HD or _SD one after the other - they are removed on induction into the commercial removal setup. It works 100% for that part.

@Echo on

GoTo :BEGIN

:BEGIN
SETLOCAL
Set SCRIPTNAME=%0
Set BASEDIR=c:\Users\Public\NPVR-data
Set LOGFILE=%BASEDIR%\Logs\RecordingSucceeded.log
Set ERRORLOG=%BASEDIR%\Logs\ERRORLOG.log
Set FILENAME=%1
Set CH_NUM=%2
Set OID=%3
Set DEV_OID=%4
Set REC_TITLE=%5
Set RecDir=C:\Users\Public\Videos\

Call :LOGMSG Recording complete - filename: %FILENAME%  ChannelNUM: %CH_NUM%  OID: %OID%  DeviceOID: %DEV_OID%  Title: %REC_TITLE%

cd /D %RecDir%
forfiles /S /M *.ts /C "cmd /c ren *.ts %REC_TITLE%.ts"
If ERRORLEVEL 1 call :Error Error Renamimg File: %FILENAME%  Title: %REC_TITLE%
timeout 300
If %CH_NUM%==5 GoTo :RENAMEHD
If %CH_NUM%==7 GoTo :RENAMEHD
If %CH_NUM%==13 GoTo :RENAMEHD
If %CH_NUM%==14 GoTo :RENAMEHD
If %CH_NUM%==27 GoTo :RENAMEHD
If %CH_NUM%==29 GoTo :RENAMEHD
If %CH_NUM%==35 GoTo :RENAMEHD
If %CH_NUM%==46 GoTo :RENAMEHD
GoTo :RENAMESD
--------------------------------------------------------------
:RENAMEHD
forfiles /S /M *.ts /C "cmd /c ren *.ts %REC_TITLE%_HD.ts.HD"

Call :LOGMSG HD Renamimg complete - filename: %FILENAME% - ChNum: %CH_NUM% - Title: %REC_TITLE%
GoTo :EXITJOB

--------------------------------------------------------------
:RENAMESD
forfiles /S /M *.ts /C "cmd /c ren *.ts %REC_TITLE%_SD.mpg.SD"

Call :LOGMSG SD Renamimg complete - filename: %FILENAME% - ChNum: %CH_NUM% - Title: %REC_TITLE%
GoTo :EXITJOB

--------------------------------------------------------------
:LOGMSG
    echo %*
    echo %date:~4% %time% [%SCRIPTNAME%] %* >> %LOGFILE%
    Goto :EOF


--------------------------------------------------------------
:EXITJOB
Exit /b
--------------------------------------------------------------
:Error
echo %*
    echo %date:~4% %time% [%SCRIPTNAME%] %* >> %ERRORLOG%
    Goto :EOF
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,659
Threads: 767
Joined: Nov 2003
#2
2020-05-01, 04:07 PM
NextPVR v5 does include output from these batch files in the nrecord.log, so you might need to post the logs, along with the name/time of a recording where the post processing failed, and we'll take a look what happened.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 52,833
Threads: 954
Joined: May 2006
#3
2020-05-01, 04:23 PM (This post was last modified: 2020-05-01, 04:24 PM by mvallevand.)
forfiles /S /M *.ts /C "cmd /c ren *.ts %REC_TITLE%.ts"

seems wrong to me isn't it renaming all file to the same file name?

Martin
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,659
Threads: 767
Joined: Nov 2003
#4
2020-05-01, 04:40 PM
Yeah, looks that way to me.
ElihuRozen
Offline

Senior Member

Massachusetts, USA
Posts: 514
Threads: 51
Joined: Apr 2006
#5
2020-05-01, 08:09 PM
REC_TITLE is assigned the value of %5.

I wonder if there are spaces in the names of the shows that fail and if %REC_TITLE% needs to be quoted. I'm a little rusty in batch and don't want to give bad advice as to how it can be fixed.
Tuners: SD HDHR Prime (HDHR3-CC). SD HDHR Connect Quatro Tuner (HDHR5-4US) - only QAM.  EXVIST H.265 Encoder - capturing cable box.
Client: Odroid-N2 running knewc on KODI - connected via MoCA.
EPG: SchedulesDirect
Provider: Verizon Fios
Server: Dell XPS 8700 with Windows 10
sub
Online

Administrator

NextPVR HQ, New Zealand
Posts: 106,659
Threads: 767
Joined: Nov 2003
#6
2020-05-01, 08:24 PM
Is there no other files in that recording directory though, because you’re renaming *.ts
jordy1955
Offline

Junior Member

Posts: 46
Threads: 9
Joined: Jul 2016
#7
2020-05-02, 03:01 AM
(2020-05-01, 08:09 PM)ElihuRozen Wrote: REC_TITLE is assigned the value of %5. 

I wonder if there are spaces in the names of the shows that fail and if %REC_TITLE% needs to be quoted. I'm a little rusty in batch and don't want to give bad advice as to how it can be fixed.


Hit the nail on the head... your suggestion and @sub statement that all the information pertaining to the batch files progress was included in the nrecord.log enabled me to fix it.

I tried to enclose REC_TITLE in quotes like this:  SET "REC_TITLE=%5" - but forfiles still didn't like the spaces and failed whenever they were present.
So I added this Set REC_TITLE=%REC_TITLE: =_% which replaces any spaces in the variable with "_" and BINGO

many thanks Elihu.

For the queries on using *.ts in the forfiles command, this is not a problem as the only *.ts file in the path is the one that the batch file is working on.After this batch file has finished the file is moved on for commercial editing.

cheers all

jordy
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  Post Record action advice? three6zerocool 36 3,945 2023-09-10, 10:14 PM
Last Post: three6zerocool
  Possible to Post Pad -1? GHop 0 378 2023-03-07, 03:39 AM
Last Post: GHop
  Post Recording Fix hootie318 3 731 2023-02-23, 11:38 PM
Last Post: mvallevand
  pre, post padding settings for each channel koijh65 1 560 2023-01-10, 01:38 AM
Last Post: mvallevand
  Ignoring Post-Padding Setting jguarrasi 8 1,285 2022-05-06, 10:09 PM
Last Post: jguarrasi
  Post Processing Issue flyingsubs 3 1,251 2020-10-25, 11:38 AM
Last Post: paulc
  Although 60 mins pre and post padding specified recording is done with 30 minutes aderlopas 3 1,628 2020-02-16, 10:02 PM
Last Post: sub

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

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

Linear Mode
Threaded Mode