This repository was archived by the owner on Dec 16, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
ad-insertion/video-analytics-service/feeder Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 2222video_analytic_url = "http://localhost:8080/pipelines/"
2323timeout = 30
2424sleep_for_status = 0.1
25+ machine_prefix = "va"
2526
2627analytic_rest_msg_template = {
2728 "source" : {
3637}
3738
3839def send_video_analytics_fps (fps ):
39- if fps <= 0 :
40+ if fps < 0 :
4041 return
4142 global p
4243 if not p :
4344 p = Producer ()
4445 if p :
4546 p .send (video_analytics_fps_topic , json .dumps ({
4647 "fps" : fps ,
47- "machine" :socket .gethostname ()[0 :3 ],
48+ "machine" :machine_prefix + socket .gethostname ()[0 :3 ],
4849 "time" : datetime .datetime .utcnow ().isoformat (),
4950 }));
5051
@@ -129,12 +130,11 @@ def process_stream(streamstring):
129130 time .sleep (sleep_for_status )
130131 status , fps = get_analytic_status (instanceid .strip (), pipeline )
131132 print ("VA feeder: segment status : " + status , flush = True )
133+ send_video_analytics_fps (fps )
132134 if status == 'COMPLETED' :
133- send_video_analytics_fps (fps )
134135 zk .process_end ()
135136 break
136137 elif status == 'RUNNING' :
137- send_video_analytics_fps (fps )
138138 continue
139139 elif status == 'QUEUED' :
140140 continue
You can’t perform that action at this time.
0 commit comments