Log in

View Full Version : Possible to "pause" x264 encode


me7
6th November 2008, 12:22
Hi everyone,
I'm about to encode the Godfather DVD collection with x264 and realized that each of the movies would take 6-7 hours to encode on my system (Penryn laptop) at high settings. I need to take to take my laptop to univerity every day and sometimes need free processing power for other tasks, so it's very difficult to plan ahead when I'm not going to need it for the next 7 hours.

Now I'm wondering if there is some way to "pause" an encoding process, save all temporal data to the harddrive and resume it later?

smok3
6th November 2008, 13:03
what i do is lower the process priorities (which may not be such a cool idea thought).

Zarxrax
6th November 2008, 14:03
Perhaps the hibernate feature of your laptop would allow you to turn it off while encoding? I've never tried something like that so it might end up breaking the encode horribly or something though. You can use some task manager replacement (i forget the name, process explorer?) to pause certain threads, so perhaps you could use that to pause your encode, then hibernate/suspend while you carry your laptop to school and use it, then resume when you return home.

You also might just do all your encodes when you go to sleep each night, as that should be a solid 7 hours when you wont need your laptop, right?

laserfan
6th November 2008, 14:29
Now I'm wondering if there is some way to "pause" an encoding process, save all temporal data to the harddrive and resume it later?Not what you asked for, but you can, in the cmd window, hit CTRL-S to stop the process from continuing. A subsequent CTRL-S will restart it.

On my (now ancient) P4 system it does take quite a few seconds for the process to actually S-top, but it does. Restarting is instantaneous I think.

Then you have to take great care not to accidently Close the cmd window!!!! :eek:

Sagekilla
6th November 2008, 14:45
me7, you have the same problem I do ;) Except I usually do networked encoding so I have to wait til I get back home to restart the encode.

As the others said, a combination of Ctrl + S (suspend task) and hibernate work wonders. If you're really, really paranoid about losing some work, you can go the route of using a Virtual Machine and saving the machine state + closing before you have to go somewhere.

me7
6th November 2008, 16:22
You also might just do all your encodes when you go to sleep each night, as that should be a solid 7 hours when you wont need your laptop, right?

I don't like the fan noise at night (rather lound when x264 pushed the processor to the limit).

The command window option seems to work, thanks.
This is the first time i run x264 via cmd instaed of a GUI. The window warned me that compression will suffer because I use a non-mod16 resolution. Isn't mod16 irrelevant with x264?

Sagekilla
6th November 2008, 16:25
mod16 is irrelevant in that x264 will automatically pad the video so it has mod16 input (407x305 --> 416x320). This inherently causes a small loss in compression because you're dealing with a larger image, but it's extremely small that you shouldn't have to worry. It's preferred by the encoder, but not required.

me7
6th November 2008, 16:34
And leaving black borders on the sides to get mod16 would hurt the compressability more than the padding, right?

Sagekilla
6th November 2008, 16:37
Well, adding black borders is one way to pad. But the way x264 pads right now (I believe, correct me if I'm wrong here) is that it duplicates the border line outwards. So in my example, it takes line 305 and repeats it to produce 320 lines of output. The reason is because if you have something like a white line with black borders right after, you have a very sharp transition that's difficult to deal with, whereas repeating the line is a more optimal solution

tl;dr of my last two posts: Don't worry if your input isn't mod16. x264 pads it automatically and you lose a few kbps to this, but not much.

saint-francis
6th November 2008, 17:11
Process explorer lets you nicely suspend any process. I do this with x264 all the time and I have noticed absolutely 0 issues.

laserfan
7th November 2008, 14:14
Process explorer lets you nicely suspend any process. I do this with x264 all the time and I have noticed absolutely 0 issues.I tried this for the 1st time and it's great--you can even Suspend an explorer "copy" and resume NP.

I think I've heard this before but thanks for reminding us about it! :)

saint-francis
7th November 2008, 16:42
I think I've heard this before but thanks for reminding us about it! :)
Cheers

lithiumus
27th July 2011, 15:31
I know I'm reviving a super old thread, but I thought I would chime in...

Now that my "work" laptop is twice as fast as my "home" PC, I'm encoding x264 on my laptop but need to pause, sleep or suspend when commuting. Before I found this thread I simply tried the sleep feature and when the laptop woke up, it resumed encoding without problem at least with the last few encodes. However, using Process Explorer is definitely a cleaner and more controlled way of doing it and I'm starting to use Process Explorer rather than roll the dice with the Laptop Sleep function.

roozhou
27th July 2011, 15:37
@lithiumus
There is a more simple way to pause x264 if you are using x264.exe in Windows. Just click any where in x264's cmdline window. The cmdline output will be blocked so x264 will pause. Once you want to continue, press any key.

EDIT: this is technically same as the CTRL+S method in Sagekilla's post.