LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Problem with recordmydesktop (https://www.linuxquestions.org/questions/programming-9/problem-with-recordmydesktop-705688/)

Accinson 02-18-2009 02:57 PM

Problem with recordmydesktop
 
Hi everybody,
i am pretty new to programming in linux,and i'm having a problem which is driving me crazy :)

I am writing an application which uses recordmydesktop to capture the screen.That program outputs a file encoded in ogg-theora format,and offers two alternative ways of encoding:
1)on the fly, i.e. it encodes while it's capturing
2)after the capture

Now,i need to use the 2nd way,but here my problem rises:when i stop the recording (and the encoding starts) the pc hangs,until the encoding is finished: i can't even move the mouse pointer....
What is weird is that if i start a shell,while my program is active,and run recordmydesktop with the same parameters i use in my program,that hang doesn't occur...

Looking at the processes with top,i found out that when i run recordmydesktop from my program,it "inherits" the priority from my program (it has a -2 priority).Otherwise,when running from another shell,it has a lower priority,which seems to explain why the hang happens.
So i tried to launch recordmydesktop using something like:
Code:

system("nice 19 recordmydesktop &");
but nothing seems to change...

So i ask you:
1) Do you have any advice?
2) Can i explicitly start a process with a given priority? I ask this cause by using nice i can set the niceness (the NI column of the "top" command output),but not the priority (which is the PR column).

Thanks in advance!

Accinson 02-19-2009 06:55 AM

Anyone?


All times are GMT -5. The time now is 11:24 PM.