reg: gst-launch stop command

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

reg: gst-launch stop command

8,639 次查看
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

标签 (2)
0 项奖励
6 回复数

4,004 次查看
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 项奖励

4,004 次查看
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 项奖励

4,004 次查看
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 项奖励

4,004 次查看
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 项奖励

4,004 次查看
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 项奖励

4,004 次查看
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 项奖励