Shell a CMD Line exe but at low priority 
Author Message
 Shell a CMD Line exe but at low priority

hi,
I want to use ffmpeg in my app, and want to give users the option of running
it as normal priority or low priority.

is there any way I can do it ?

thanks,
abhi



Wed, 29 Jun 2011 21:39:46 GMT  
 Shell a CMD Line exe but at low priority


Quote:
> hi,
> I want to use ffmpeg in my app, and want to give users the option of
running
> it as normal priority or low priority.

> is there any way I can do it ?

Define "low and normal priority" for this situation. ie, what behavior are
you wanting.

You may need to provide a 'configuration' dialog so the user can makes some
adjustments - frame/bit rates, passes, tolerance, ...

If you mean NT Thread priorities - then IMHO don't even go there. The OS and
hardware will take care of it - except for very isolated situations, and
especially with a tool so heavily dependent on installed hardware and
drivers - you will most likely only make matters worse if you attempt to
willy-nilly fiddle on an unknown box.

-ralph



Wed, 29 Jun 2011 22:40:55 GMT  
 Shell a CMD Line exe but at low priority

Quote:
> hi,
> I want to use ffmpeg in my app, and want to give users the option of
> running
> it as normal priority or low priority.

> is there any way I can do it ?

I am not sure what ffmpeg is, or whether it's available in DLL or EXE. If
it's EXE, you can use CreateProcess and set the priority class. If it's your
own process using a DLL, then you could use SetPriorityClass.


Wed, 29 Jun 2011 23:22:42 GMT  
 Shell a CMD Line exe but at low priority
ffmpeg is a command line exe to convert audio and videos.
anyways thanks



| > hi,
| > I want to use ffmpeg in my app, and want to give users the option of
| > running
| > it as normal priority or low priority.
| >
| > is there any way I can do it ?
|
| I am not sure what ffmpeg is, or whether it's available in DLL or EXE. If
| it's EXE, you can use CreateProcess and set the priority class. If it's
your
| own process using a DLL, then you could use SetPriorityClass.



Wed, 29 Jun 2011 23:59:45 GMT  
 Shell a CMD Line exe but at low priority


Quote:
> ffmpeg is a command line exe to convert audio and videos.
> anyways thanks

CreateProcess will work just as well. Check out the MSDN Help for options.
(Assuming you realy want to do this. lol)

-ralph



Thu, 30 Jun 2011 07:09:37 GMT  
 Shell a CMD Line exe but at low priority
Hi abhi,


Quote:
> hi,
> I want to use ffmpeg in my app, and want to give users the option of
> running it as normal priority or low priority.

> is there any way I can do it ?

Not really.  Even if you get the thread's handle there is no guarantee it is
single threaded.  But if it is single threaded then, assuming you app has
permissions to do so, you could possibly use SetThreadAffinity.  I'm not
sure how you'd get the thread handle from the process though.


Fri, 01 Jul 2011 11:00:27 GMT  
 Shell a CMD Line exe but at low priority



Quote:



>> . . . and want to give users the option of
>> running it as normal priority or low priority.
>> is there any way I can do it ?

> [McCarthy said] But if it is single threaded then, assuming
> you app has permissions to do so, you could possibly use
> SetThreadAffinity.

The OP wants to set the PRIORITY of the thread, so he should use
SetThreadPriority. Your own suggestion of using SetThreadAffinity merely
restricts the thread to a specific core of a multi core machine! Wake up
man!

Mike



Fri, 01 Jul 2011 17:15:52 GMT  
 Shell a CMD Line exe but at low priority

Quote:

> I want to use ffmpeg in my app, and want to give users the option of running
> it as normal priority or low priority.

> is there any way I can do it ?

Shell Environ("comspec") & " /k start /low " & myFfmpegCmd
--
.NET: It's About Trust!
 http://vfred.mvps.org


Sat, 02 Jul 2011 04:16:09 GMT  
 
 [ 8 post ] 

 Relevant Pages 

1. Run EXE w/cmd line args

2. Building EXE's from the cmd line

3. pass cmd line parms to exe

4. Setting app to Low Priority

5. Setting app to Low Priority

6. Setting app to Low Priority

7. Is it possible to get filename of .CMD filename that is being executed by CMD.EXE _FROM_ inside the .CMD script?

8. On XP workstations, my access app get hung up using shell cmd to swap to Word

9. HELP: QBASIC SHELL CMD

10. XP and Shell (Cmd)???

11. CMD SHELLS & NTUSER.dat

12. URGENT: Help - Calling shell cmd and outputting to file

 

 
Powered by phpBB® Forum Software