0

I'm trying to work on glade Gui and I have used some Gui buttons like button1 and button2. Actually, my basic task is to capture the live video. For this, I used this command when i press gui button1 this command should work-> system("avconv -f video4linux2 -r 10 -s 1280x768 -i /dev/video0 -y record.avi"); and this is in looping (continuously running) in command line. In the running task one option is there to stop the recording. For example, to stop recording press q. if I press q from the keyboard it is working fine, through program if I press gui button2 with system("q"); it is not working its showing like

sh:1 q: not found

I am not able to stop the running task(video recording) through the program. pls, do help me how can I do this task. I am struggling from past 2to3 days. I am using the thread concept.

your help will be highly appreciated! thank u Ramesh

this is how running in command line continuosly:

Stream mapping: Stream #0:0 -> #0:0 (rawvideo (native) -> mpeg4 (native))
Press [q] to stop, [?] for help frame= 63 fps= 10 q=3.3 Lsize=
237kB time=00:00:06.30 bitrate= 308.8kbits/s speed=1.01x

  • system("q") is creating an independent execution environment ("shell"), and not sending anything to the previous command. Hence the "q: not found", as there are no program called q... – B. Go May 25 '19 at 13:21
  • tq u for your valuable resp, is there any way to stop recording through the program – Rathod Ramesh May 29 '19 at 05:21
  • find and kill the process? Or see these links that say to not use system() https://stackoverflow.com/questions/478898/how-do-i-execute-a-command-and-get-output-of-command-within-c-using-posix and https://www.quora.com/Can-a-C-C++-program-fork-a-bash-shell-and-pass-commands-to-execute-If-yes-which-library-functions-do-you-use – B. Go May 29 '19 at 11:22

0 Answers0