reg: gst-launch stop command

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

reg: gst-launch stop command

8,676件の閲覧回数
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,041件の閲覧回数
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,041件の閲覧回数
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,041件の閲覧回数
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,041件の閲覧回数
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,041件の閲覧回数
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,041件の閲覧回数
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 件の賞賛