reg: gst-launch stop command

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

reg: gst-launch stop command

8,678 Views
vishvapathi
Contributor V

Hi,

          When executing (in a command prompt) a gst-launch-ed pipeline that is capturing a live feed, what's the best way to stop it other than ctrl-C? I want to close it automatically,without the use of the keyboard...

Any suggestions??

shanmugamsundar

Raybiztech

DaianeAngolini

Labels (2)
0 Kudos
6 Replies

4,043 Views
Raybiztech
Contributor V

HI,

               Through coding you can use this instruction to make the pipeline to NULL state.

                 gst_element_set_state (pipeline, GST_STATE_NULL);

              

Thanks & Regards,

RayBiztech.

0 Kudos

4,043 Views
vishvapathi
Contributor V

Hi,

I tried to find the process id and kill the process, but i think thats not the correct way...

Can anyone suggest me an alternate/correct way of stopping livestreaming using gst-launch????

LeonardoSandovalGonzalez

jackmao

0 Kudos

4,043 Views
jack_mao
NXP Employee
NXP Employee

agree with Leo, the gstreamer pipeline can be put to play or stop status by code setting, otherwise it has to get the events to do related things

0 Kudos

4,043 Views
LeonardoSandova
Specialist I

The best way is to send the pipeline to NULL state in case you launching the pipeline inside a C program. From the shell, You can send a SIGINT signal with the command kill, check the man info.

Leo

0 Kudos

4,043 Views
vishvapathi
Contributor V

Hi,

The below grep and awk command does the work for me.

system("ps | grep gst | awk '{print $1}' | xargs kill -2 $1");

Is it fine or is there a better option??

Your opinion plz..

0 Kudos

4,043 Views
LeonardoSandova
Specialist I

if it works on the shell, then it should work using the system call 'system'. Just remember that looking at gst process with ps, it with also pick the grep command, so I dont think those pipes will work all the time.

Leo

0 Kudos