NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Add-ons (3rd party plugins, utilities and skins) Old Stuff (Legacy) v
« Previous 1 … 22 23 24 25 26 … 125 Next »
PostProcessing.bat with comskip & RenameRecording

 
  • 0 Vote(s) - 0 Average
PostProcessing.bat with comskip & RenameRecording
Hinde01
Offline

Junior Member

Posts: 8
Threads: 2
Joined: Jun 2007
#1
2007-06-23, 07:10 PM
I have been trying to get gbpvr to do the following things for a while now. Previously I didn't care about commercials or filenames, but now I want them working.

1. Transcode all mpegs recorded to mp4 format (gbpvr is fantastic at this by the way).
2. Rename the files outputted so that instead of Showname_date_time.mpeg it would read the showname - episode title.mp4.
3. Cut out commercials.

The problem is that post processing doesn't seem to want to do all 3 of these for every file. Some mpegs are cleaned and renamed, but aren't transcoded. Others are transcoded but not cleaned or renamed. Others are lucky enough to have all three applied to them. Here is my post processing batch file (unfortunately, I don't have a log file for comclean or renamerecording because I accidentally forgot to do >> as opposed to >, but when I actually get some data this way I will post it):

[HTML]
@echo off
Rem PostProcessing.bat
Rem This script will be run automatically by GBPVR when found after a recording is finished
Rem To enable it put this file inside your GBPVR default program directory (C:\Program Files\devnz\gbpvr\)
Rem together with Comskip.exe, Comskip.ini and Comskip.dictionary
Rem The script is called with two parameters
Rem %1 is the fully qualified name of the recorded mpeg file.
Rem %2 is the channel number of the recording
echo Postprocessing.bat invoked on %1 recorded from channel %2 >>postprocessing.log

Rem The part below can be used to not run Comskip on certain channels, please modify for your conveniance.
Rem The channel numbers that should be skipped are the numbers between the double quotes ("").
Rem You can add "if" lines as much as you want
Rem To disable this behaviour use channel numbers outside the normal range, put a "rem" before the "if" or

delete the "if" lines

Rem list of channels to not run comskip on
if "%2" == "27" goto eof
if "%2" == "36" goto eof

Rem this trick also makes it possible to have dedicated comskip.ini file for certain channels.
if "%2" == "79" goto channel79
if "%2" == "72" goto channel72
if "%2" == "65" goto channel65
Rem use the default comskip.ini for all other channels
goto generic

:channel79
comskip --ini=channel79.ini %1
goto continue
:channel72
comskip --ini=channel72.ini %1
goto continue
:channel65
rem This is an example of how to reuse a previously learned logo to prevent Comskip from learning the wrong

logo
comskip --ini=channel65.ini --logo=channel65.logo.txt %1
goto continue

:generic
Rem The actual run of Comskip. Only one parameter, the name of the mpeg file to process.
Rem Comskip will read its settings from the Comskip.ini found in the same directory as Comskip.exe
Rem Both are supposed to be in the GBPVR default program directory. (C:\Program Files\devnz\gbpvr\)
comskip %1
:continue

Rem Once the commercials have been identified you can run comclean to delete the commercials from the

recording.
Rem Do this only when you are not using the Skip function in the GBPVR viewer.
Rem To enable comclean remove the word "Rem" from the following line.
rem call comclean %1

call comclean %1 >> comclean.log
del "%~dpn1.log"
del "%~dpn1.txt"
del "%~dpn1.logo.txt"
del "%~dpn1_original.mpg"
RenameRecording -t %1 >> rename.log
:eof
[/HTML]
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#2
2007-06-23, 07:13 PM
Sorry, I'm useless when it comes to batch files, so cant help you with this one.
Hinde01
Offline

Junior Member

Posts: 8
Threads: 2
Joined: Jun 2007
#3
2007-06-23, 07:17 PM
I would also appreciate it if someone could point out the dead weight in my batch file (ie stuff I don't need). The numbered items in my first post are all I really need to have done to my recordings, and I want it done to all of them. I should also mention that performance on this rig is no issue. I do no work or gaming on it anymore. I just use it for storage and to record tv.

Thanks in advance by the way.
Hinde01
Offline

Junior Member

Posts: 8
Threads: 2
Joined: Jun 2007
#4
2007-06-24, 10:46 PM
bump.
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#5
2007-06-24, 10:49 PM
I'll move this to the plugin forum and rename. It should get a few more of the appropriate eyes on it.
Hinde01
Offline

Junior Member

Posts: 8
Threads: 2
Joined: Jun 2007
#6
2007-06-29, 10:53 PM
So I think I figured out part of the problem. As far as I can tell the Processing options that I set in gbpvr's config program run independently of the postprocessing.bat script, so if the gbpvr program proper is transcoding recordings to mp4, renamerecording and comclean won't be able to run because another program (gbpvr's mpr transcoding program, whatever it happens to be) is using said recording. So I basically decided to forgo the gbpvr config processing options and run ffmpeg on the recording in a line in the postprocessing batch file. Below is my postprocessing.bat file. I also have attached a rar of the log files. I need help with the call to ffmpeg and getting comclean comskip and renamerecording to run.

[HTML]@echo off
Rem PostProcessing.bat
Rem This script will be run automatically by GBPVR when found after a recording is finished
Rem To enable it put this file inside your GBPVR default program directory (C:\Program Files\devnz\gbpvr\)
Rem together with Comskip.exe, Comskip.ini and Comskip.dictionary
Rem The script is called with two parameters
Rem %1 is the fully qualified name of the recorded mpeg file.
Rem %2 is the channel number of the recording
echo Postprocessing.bat invoked on %1 recorded from channel %2 >>postprocessing.log

Rem The part below can be used to not run Comskip on certain channels, please modify for your conveniance.
Rem The channel numbers that should be skipped are the numbers between the double quotes ("").
Rem You can add "if" lines as much as you want
Rem To disable this behaviour use channel numbers outside the normal range, put a "rem" before the "if" or
Rem The actual run of Comskip. Only one parameter, the name of the mpeg file to process.
Rem Comskip will read its settings from the Comskip.ini found in the same directory as Comskip.exe
Rem Both are supposed to be in the GBPVR default program directory. (C:\Program Files\devnz\gbpvr\)

call comclean %1 >> comclean.log 2>> comclean.err
RenameRecording.exe -t %1 >> rename.log
start /low /wait /min D:\Progra~1\devnz\ffmpeg.exe -y -i %1 -f mp4 -vcodec xvid -b 768 -qscale 4 -croptop 4 -s

320x240 -r 29.97 -acodec aac -ac 2 -ar 48000 -ab 64 "%~dpn1.mp4" >> ffmpeg.log 2>> ffmpeg.err
:eof
[/HTML]
reboot
Offline

Posting Freak

Posts: 1,426
Threads: 89
Joined: Mar 2005
#7
2007-07-01, 09:38 PM
Try running this as ParallelProcessing.bat
Comskip will run during the recording, and finish almost the same time the recording does, then comclean will run, then your transcode.
This will speed up the whole process considerably, and you don't need any post processing at all.
You can never have enough tuners!
Pentium Quad / 4Gb Dual Channel RAM / XPSP3 / 2 x PVR-500, PVR-250 / GB-PVR
Hinde01
Offline

Junior Member

Posts: 8
Threads: 2
Joined: Jun 2007
#8
2007-07-02, 12:36 AM
Thanks for your time taking a look at my problem, but I actually managed to figure out a postprocessing batch file order that took care of everything I wanted to do. I also realized that my comskip.ini file had a bad value which was resulting in poor comcleanings. Anyway here is my postprocessing.bat file for anyone else that wants to do what I am talking about above. Its a slightly modified version of the zrenamepostprocessing.bat file you can get from the wiki section of this site (much thanks to whomever wrote that script and set me on the right track). Anyway I forgo the post processing options in the config application for gb-pvr completely, and I add everything I want post processing to do into the batch file. Here is my batch script.
[HTML]
@echo off

echo "%~dpn1.mpg"

comskip "%~dpn1.mpg" >> comskip.log

call comclean "%~dpn1.mpg" >> comclean.log

".\Third Party\FFmpeg\ffmpeg.exe" -y -i "%~dpn1.mpg" -f mp4 -vcodec mpeg4 -s 320x240 -r 15 "%~dpn1.mp4" >>

ffmpeg.log

del "%~dpn1.log"
del "%~dpn1.logo.txt"
del "%~dpn1.txt"
del "%~dpn1_original.mpg"

rem ZRename "%~dpn1.mp4"

RenameRecording.exe -t %1 > rename.log
[/HTML]
Hinde01
Offline

Junior Member

Posts: 8
Threads: 2
Joined: Jun 2007
#9
2007-08-05, 10:05 PM
I have a little update for this. I was getting a little annoyed, as I could not leave my pc along for any significant amount of time without gbpvr filling up my 400gb hard drive with mpeg files that I don't want (I only want mp4 files so that I can have a large library of stuff for my ipod). So I experimented a bit yesterday trying to delete the .mpg file. RenameRecording seemed to have a bit of an issue with this (wants the mpg in order to get its information I guess), so I rewrote the cs file a bit, so that any files that have the same name as the original mpg file are renamed, and the mpg file itself is deleted. I attached the code. I copied and pasted the guys that have written it to give them their due. My modification amounted to about 5 lines of code.

Original Author: KingArgyle, enhancements by ZaDDaZ

Current Developer: Ton

Thanks to Pioneer4x4 and others for initial testing.
stustunz
Offline

Posting Freak

Posts: 5,111
Threads: 112
Joined: Oct 2006
#10
2007-08-06, 12:38 AM
ok im interested in this im making a computer to run in my motor home record satellite but as im using laptop as the computer limited on hard drive space and dont want to use external 3.5" hard drives so i only have about 100GB of storage

can you just give me a quick guide on how to use this
where i need to put the files etc
treat me as a dummy
i understand i think just want clarification
(whats the cs file i thought you would just run the batch file)
thanks in advance
« 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
  Transcode w/ Comskip? pduncan67 1 2,143 2009-11-25, 03:59 AM
Last Post: johnsonx42
  Comskip & Digital? nightwalker 8 3,540 2009-08-29, 06:34 PM
Last Post: nightwalker
  comskip wont run anymore HELP :) DoPeFiSh 1 1,959 2009-07-21, 07:34 PM
Last Post: DoPeFiSh
  Comskip build 0.80.011 Released erik 13 6,241 2009-03-01, 11:36 AM
Last Post: erik
  comskip problem j210277 11 6,191 2009-01-28, 05:25 AM
Last Post: stustunz
  Comskip: Interpreting the aspects file zehd 0 1,586 2008-11-29, 07:41 AM
Last Post: zehd
  Comskip.exe Question spector9 17 9,467 2008-10-28, 03:02 AM
Last Post: reboot
  Comskip quit working DoPeFiSh 5 2,781 2008-10-06, 04:09 PM
Last Post: DoPeFiSh
  problem with comskip GUI wannabepvr 3 2,909 2008-06-08, 06:53 AM
Last Post: erik
  A few Comskip questions. gh_speedyg 1 1,939 2008-05-20, 05:49 AM
Last Post: erik

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

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

Linear Mode
Threaded Mode