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) GB-PVR Support (legacy) v
« Previous 1 … 710 711 712 713 714 … 1231 Next »
Batch file question

 
  • 0 Vote(s) - 0 Average
Batch file question
theredbaron
Offline

Member

Posts: 69
Threads: 16
Joined: Feb 2006
#1
2006-09-21, 10:18 PM
I've tried learning some DOS commands to make automation easier, but I'm having some trouble. In my postprocessing.bat, I have comskip run, then videoredo to cut out the commercials. Then I want to transcode, and I found this neat program (AutoXvid) that automates AutoGk. And after that I have RenameRecordings to make sure everything gets the right name. Problem seems to be that RenameRecordings launches right after AutoXvid is CALLED and renames the file while it is being transcoded. (And what AutoXvid does is call and input settings into AutoGK, which in turn calls vitualdubmod and other apps). Is there a pause feature I can use (not the pause command, obviously because that requires user input) to wait until every process of AutoXvid is done before renaming the recording?

Or, alternatively, is there a way to rename the recording first and tell AutoXvid to use the changed name (which can't be %1 anymore)?

Code:
"C:\Program Files\devnz\gbpvr\comskip.exe" %1
cscript //nologo "C:\Program Files\VideoReDoPlus\vp.vbs" "%~dpn1.VPrj" "%~dpn1_Cleaned.mpg" /t1 /q
Rem RENAME the old .mpg file and rename the new one to the old name
move "%~dpn1.mpg" "%~dpn1_original.mpg"
move "%~dpn1_cleaned.mpg" "%~dpn1.mpg"
REM The following lines cleanup the directory.
move "%~dpn1_original.mpg" "F:\originals\"
move "%~dpn1.txt" "F:\originals\"
move "%~dpn1.log" "F:\originals\"
move "%~dpn1.VPrj" "F:\originals\"
move "%~dpn1.logo.txt" "F:\originals\"
"C:\Program Files\AutoXvid\AutoXvid.exe" %1
RenameRecordings.exe > RenameRecording.log
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#2
2006-09-21, 10:49 PM
Not sure if it would work but you could try creating a separate batch file called (for example) DoAutoXvid.bat...

...put the "C:\Program Files\AutoXvid\AutoXvid.exe" %1 command into that file then replace that line in PostProcessing.bat with...

CALL DoAutoXvid.bat %1


I haven't done 'nested' batch files for a while but I think the PostProcessing.bat should wait for the DoAutoXvid.bat to return before proceeding.

Cheers,
Brian
theredbaron
Offline

Member

Posts: 69
Threads: 16
Joined: Feb 2006
#3
2006-09-21, 11:27 PM
Thanks man, i'll give it a shot.
madcat
Offline

Senior Member

Posts: 634
Threads: 104
Joined: Apr 2006
#4
2006-09-21, 11:57 PM
Only guessing, but I think it won't work. It will return from that batch immediatly, sthe same as it does now from the command.

What I would recommend is using AutoIt3 for creating more "advanced" batch file.
1) It's free
2) It's sort of a scripting language (that is so rich that you can actually write GUI with it. sort of like Tcl/TK if it means anything to you)
3) It is quite easy to use, and the docs are good
4) The "batch" that you write can be later converted to ".EXE" and then your "postprocessing.bat," will have a single line calling this new EXE.

5) Oh, and they have a command to run other Applications, and there's specifically a flag there "wait" (whether to wait for the external app to finish before moving to the next line in the batch).

Enjoy
* Rogers Analog Cable [Canada]
* Hauppauge WintTV PVR USB2
* IBM Thinkpad T42 / 1GB Mem / Centrino 1.6Ghz / 60GB HD / ATI Mobility Radeon 7500 + VGA/DVI out
* MCE Remote + Keyboard
* Win XP SP2 / GBPVR [Latest version. always]
* Pioneer HDTV via VGA (1360x768)
* MS Remote Keyboard
* Logitech Harmony 880 [via MS Remote Control Reciever]
bgowland
Offline

Posting Freak

West Yorkshire, UK
Posts: 4,583
Threads: 384
Joined: Dec 2004
#5
2006-09-22, 12:51 AM
madcat Wrote:Only guessing, but I think it won't work. It will return from that batch immediatly, sthe same as it does now from the command.
Yeah - you're right - the DoAutoXvid.bat would proceed in the same way and simply exit back to PostProcessing.bat immediately.

I'm having a bit of a 'no brain' day today. Smile

Using START /WAIT "C:\Program Files\AutoXvid\AutoXvid.exe" %1 might be worth a try.

Cheers,
Brian
theredbaron
Offline

Member

Posts: 69
Threads: 16
Joined: Feb 2006
#6
2006-09-22, 02:15 AM
I will investigate AutoIt, thanks.
bgowland, do you mean just have
Code:
START /WAIT "C:\Program Files\AutoXvid\AutoXvid.exe" %1
as a line in the batch?
23skidoo
Offline

Member

Posts: 120
Threads: 9
Joined: Sep 2006
#7
2006-09-22, 03:12 AM
Why not Windows Scripting? You can do nearly anything with Windows Scripting. Make short work of this little job. VB Script isn't tough to learn, and it's a lot more powerful than Windows' batch file syntax. And it's already on your computer.

  1. Open up notepad.
  2. Add this line: MsgBox "No way!"
  3. Add this line: MsgBox "YES way!"
  4. Save the file to your desktop with the name "test.vbs" . The extension is important.
  5. Double-click the file, and voila!
Now imagine what you could do with this! :-)
WinTV PVR-150 / ATI X1600 512 / 3GHz P4 / 2GB RAM
agidius
Offline

Senior Member

Posts: 469
Threads: 77
Joined: Apr 2006
#8
2006-09-22, 04:12 AM
theredbaron Wrote:Is there a pause feature I can use (not the pause command, obviously because that requires user input) to wait until every process of AutoXvid is done before renaming the recording?

I dont think it is what will be best to solve the problem, but I will answer it anyway.

I use sleep.exe
you can get it here
http://www.computerhope.com/dutil.htm

put it in the directory that is called by the .bat file
you can make the computer pause for a set number of seconds.
"sleep 10" will pause for 10 seconds
"sleep 120" will pause for 2 minutes.


ALSO--
whenever I am having trouble with batch files, I go here for help.
http://www.computerhope.com/batch.htm
Server--AthlonXP 2100+ \ PVR150MCE \ HVR1600 x2
Client 1--Athlon64 3200+
Client 2--Athlon64 3700+
Client 3--Turion64x2 1.9 laptop
theredbaron
Offline

Member

Posts: 69
Threads: 16
Joined: Feb 2006
#9
2006-09-22, 11:35 AM
Thanks for all the replies... How about if I was to have RenameRecording BEFORE I run autoxvid? Is there any way to reference the new file name (in the vain of '%1')?
23skidoo
Offline

Member

Posts: 120
Threads: 9
Joined: Sep 2006
#10
2006-09-22, 11:48 AM
Sounds like the problem is, AutoXVid.exe's isn't a "blocking" program. It's main thread may return control before the operation is complete.

Does AutoXVid.exe actually make use of stderror? It could be that every time the EXE executes it returns a code, indicating its current status. Which you could check, in a loop

Does AutoXVid.exe generate an output file? It seems that it does. Can you test for that? You know, if not exist whatever.txt goto keeptrying?
WinTV PVR-150 / ATI X1600 512 / 3GHz P4 / 2GB RAM
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)

Pages (3): 1 2 3 Next »


Possibly Related Threads…
Thread Author Replies Views Last Post
  file types of recorded TV paul1 3 3,676 2012-09-30, 05:20 PM
Last Post: sub
  GBPVR Database question - Recording Schedule David B 1 1,621 2010-11-08, 09:21 PM
Last Post: sub
  Descriptive Audio Service Question mikeh49 3 3,121 2010-10-21, 10:49 PM
Last Post: sub
  No Data In the Recorded File zb1 5 2,232 2010-08-24, 01:08 AM
Last Post: zb1
  Italian channels post and a question about compatibility with Seven 64 bit pinopallino 2 1,650 2010-08-18, 09:14 AM
Last Post: pinopallino
  Path to file being recorded. brianj 5 2,275 2010-08-08, 10:58 PM
Last Post: brianj
  error: failure playing back file yonu 4 2,022 2010-07-12, 12:52 AM
Last Post: yonu
  UK Freesat Scan.cache File jeffers 3 2,037 2010-05-25, 10:34 PM
Last Post: jeffers
  Newbie Question rthefish 4 2,084 2010-05-25, 08:06 PM
Last Post: pBS
  3 AC3Filter instances when playing back a still recording TS file? jksmurf 3 1,896 2010-05-17, 12:30 AM
Last Post: jksmurf

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

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

Linear Mode
Threaded Mode