View Full Version : "Shutdown the computer when finished" feature in x264.exe?
Nephilis
17th May 2010, 10:42
As known sometimes the encoding time can be very long, when you use x264.exe with very slow settings and slow avisynth filters. Also my question is; can be added a "Shutdown the computer when finished" feature to x264.exe ?
e.g.
--shutdown 1 (shutdown when finished)
--shutdown 0 ( Do nothing when finished)
Please don't advice GUI's for this, so I dont like the GUI's because i cant reach all x264 features through it.
Since you are using x264 via command line, you should have a way to put a shutdown command onto the end of your script -- conditionally if needed.
Thus this feature really isn't needed for the x264 IMHO
*Windows (http://tinyurl.com/2bmb3xn)
*Linux (http://tinyurl.com/28p5vs5) (and other *nixes I would guess)
creamyhorror
17th May 2010, 11:06
*Windows (http://tinyurl.com/2bmb3xn)
*Linux (http://tinyurl.com/28p5vs5) (and other *nixes I would guess)
you are so tricky................
you are so tricky................
The information is there, that's the main thing :V
Nephilis
17th May 2010, 16:26
Since you are using x264 via command line, you should have a way to put a shutdown command onto the end of your script -- conditionally if needed.
Thus this feature really isn't needed for the x264 IMHO
*Windows (http://tinyurl.com/2bmb3xn)
*Linux (http://tinyurl.com/28p5vs5) (and other *nixes I would guess)
What do you mean with end of your script ? You mean avs script ? if your answer is yes, how ?
nurbs
17th May 2010, 16:37
The .bat file or whatever equivalent you use for encoding.
dwrbudr
17th May 2010, 18:45
Windows have shutdown command, just open command-prompt and type "shutdown /?" (without quotes) for help.
Rumbah
17th May 2010, 19:00
An example for batch file use:
Rename your x264.exe to x264enc.exe
Create a new (text) file in the same directory with x264.bat as it's name
Open the file in a text editor and fill it with:
@ECHO OFF
SET VAR1=x264enc.exe
:beginning
IF "%1"=="" GOTO end
IF "%1"=="--shutdown" SET VAR2=shutdown
IF NOT "%1"=="--shutdown" SET VAR1=%VAR1% %1
SHIFT
GOTO beginning
:end
%VAR1%
IF "%VAR2%"=="shutdown" shutdown -s -f -t 30
Now you can just start your encode from command line with x264 and use the parameters you like. If you want to shutdown the system after your encode then simply add --shutdown to your x264 parameters (without any numbers, if you don't want to shut down simply omit the parameter). Then your PC should shut down 30 seconds after your encode has finished (works for WinXP Prof and Win7 Business 64 here).
nakTT
17th May 2010, 19:21
Since you are using x264 via command line, you should have a way to put a shutdown command onto the end of your script -- conditionally if needed.
Thus this feature really isn't needed for the x264 IMHO
*Windows (http://tinyurl.com/2bmb3xn)
*Linux (http://tinyurl.com/28p5vs5) (and other *nixes I would guess)
I just love your "let me google that for you" trick. Thanks, now I can stick it to some of my friends.:D
:thanks:
Nephilis
18th May 2010, 14:00
An example for batch file use:
Rename your x264.exe to x264enc.exe
Create a new (text) file in the same directory with x264.bat as it's name
Open the file in a text editor and fill it with:
@ECHO OFF
SET VAR1=x264enc.exe
:beginning
IF "%1"=="" GOTO end
IF "%1"=="--shutdown" SET VAR2=shutdown
IF NOT "%1"=="--shutdown" SET VAR1=%VAR1% %1
SHIFT
GOTO beginning
:end
%VAR1%
IF "%VAR2%"=="shutdown" shutdown -s -f -t 30
Now you can just start your encode from command line with x264 and use the parameters you like. If you want to shutdown the system after your encode then simply add --shutdown to your x264 parameters (without any numbers, if you don't want to shut down simply omit the parameter). Then your PC should shut down 30 seconds after your encode has finished (works for WinXP Prof and Win7 Business 64 here).
Yeah, that's what I call an illuminative answer.. :)
@Rumbah
What if i want to encode 2 pass and after that shutdown the PC
for example;
make first pass first
D:\x264.exe bla bla --pass 1 -- birate 1000 <= first pass process
after that make second pass
D:\x264.exe bla bla --pass 2 -- bitrate 1000 <= second pass process
and then shutdown PC
how its possible with a windows script like above?
burfadel
18th May 2010, 14:28
Can't access all of x264's features? Just so you know, you can access all of x264's features using Staxrip, and have been able to for a long time! You can update each individual component too (such as ffmpeg, x264 etc), when it prompts its newer just click through it and it won't ask again. You can adjust most features through the gui, and for anything else you can add in the 'command line' section. You can even easily set it so you have to add all the options in the 'command line' section.
You can batch encode, shutdown after all jobs, shutdown after current job, pause (suspend) etc also.
What if i want to encode 2 pass and after that shutdown the PC
for example;
make first pass first
D:\x264.exe bla bla --pass 1 -- birate 1000 <= first pass process
after that make second pass
D:\x264.exe bla bla --pass 2 -- bitrate 1000 <= second pass process
and then shutdown PC
how its possible with a windows script like above?
With Rumbah's hack:
x264.bat bla bla --pass 1 --birate 1000
x264.bat bla bla --pass 2 --bitrate 1000 --shutdown
But I'd modify the script slightly for two-pass encoding:
@ECHO OFF
SET VAR1=x264enc.exe
:beginning
IF "%1"=="" GOTO end
IF "%1"=="--shutdown" SET VAR2=shutdown
IF NOT "%1"=="--shutdown" SET VAR1=%VAR1% %1
SHIFT
GOTO beginning
:end
%VAR1% --pass 1
%VAR1% --pass 2
IF "%VAR2%"=="shutdown" shutdown -s -f -t 30
Nephilis
18th May 2010, 15:11
Can't access all of x264's features? Just so you know, you can access all of x264's features using Staxrip, and have been able to for a long time! You can update each individual component too (such as ffmpeg, x264 etc), when it prompts its newer just click through it and it won't ask again. You can adjust most features through the gui, and for anything else you can add in the 'command line' section. You can even easily set it so you have to add all the options in the 'command line' section.
You can batch encode, shutdown after all jobs, shutdown after current job, pause (suspend) etc also.
Yes may be, but i think, using x264.exe from command prompt is faster than any GUI. And i am a minimalist so i wanna only use x264.exe :) (without .net framework 3.5 sp1 bla bla and many M$ bullshit (staxrip needs it) )
@nm
Thanks, i'll give it a try..
Groucho2004
18th May 2010, 18:13
without .net framework 3.5 sp1 bla bla and many M$ bullshit
Amen to that.
Nephilis
20th May 2010, 12:25
@ECHO OFF
SET VAR1=x264enc.exe
:beginning
IF "%1"=="" GOTO end
IF "%1"=="--shutdown" SET VAR2=shutdown
IF NOT "%1"=="--shutdown" SET VAR1=%VAR1% %1
SHIFT
GOTO beginning
:end
%VAR1% --pass 1
%VAR1% --pass 2
IF "%VAR2%"=="shutdown" shutdown -s -f -t 30
The script above works like a charm.. Thanx again @Rumbah and @nm ..
Birdy1
20th May 2010, 18:44
I would just keep it simple in my batch file:
x264.exe <options>
shutdown <options>
vBulletin® v3.8.11, Copyright ©2000-2026, vBulletin Solutions Inc.