linux - Vlc Check Stream Status -


i using vlc rebroadcast stream , side of things working well. after few hours however, need re authenticate , re-request stream. have script needs run , handle re-authentication , starting vlc. problem having how figure out if stream no longer working.

when using say:

pidof vlc 

i pid of process vlc. when checking top, can see vlc running , consuming cpu. however, when try play stream nothing happens. if run script again, stream restarts , can watch again. if stream has stopped, vlc continues run giving me no indication of whether stream running or vlc.

the thing have spotted far when stream not running cpu usage seems spike according top.

when stream running, cpu usage around 1% mark, when not running seems spike past 40%. have observed couple of times, can assume potentially way ensure stream running, not 100% confident in approach.

does have knowledge on how confirm if actual stream running or if vlc process?

should give credits @mundu

here script created checking if vlc streaming.

// vlc_verify1.sh #!/bin/bash  vlc_conf="$1" vlc_command="$2" vlc_pass="videolan"  echo "" > nohup.out  nohup vlc --intf telnet --vlm-conf $vlc_conf --telnet-password $vlc_pass & vlc_pid=$! echo "vlc has pid of $vlc_pid"  sleep 5  echo  "nc start" nc localhost 4212 < $vlc_command  kill $vlc_pid exit 0  // vlm-conf, have replace $url actual url new channel1 broadcast enabled setup channel1 input $url control channel1 play show  // command.txt videolan show 

the vlc_verify1.sh output status of current playing mentioned @mundu. did grep output , see if it's state 'playing'.

notice, didn't specify output setup channel1 output #std{access=udp,mux=ts,dst=239.192.174.105:1234}.

a reason sometime vlc use 100% cpu time. have no clue why so. if rid of that, didn't experience similar issues. downside there pop-up window playing streamings. don't think it's big deal.


Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -