Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ffmpeg=501
  2.  
  3. if(Event.SourceType=="MACRO" && Event.Action=="RUN" && Event.SourceId==ffmpeg)
  4.  {
  5.   slave_id=Event.GetParam("sender");
  6.   DebugLogString(slave_id)
  7.   var index=slave_id.split("-");
  8.   DebugLogString("Awaiting that macro start on WKS-VIDEO-"+index[2])
  9.   monitors(index[2],slave_id);
  10.  }
  11.  
  12.  
  13. function monitors(camid,slave_id)
  14. {
  15.         //mon=515
  16.     //switz(camid,mon,slave_id);
  17.         DebugLogString(Var_var("mon"))
  18.      if (Var_var("mon")!="515")
  19.         {
  20.          Var_var("mon")=515;
  21.          switz(camid,Var_var("mon"),slave_id);
  22.                  DebugLogString(mon)
  23.         }
  24.       else {         
  25.             Var_var("mon")=516;
  26.      switz(camid,Var_var("mon"),slave_id);
  27.         // DebugLogString(mon)
  28.             }
  29.      
  30.      
  31.  
  32. }
  33.  
  34. function rtsp(port,slave)
  35. {
  36. //slave=Event.GetParam("slave_id");
  37. var index=slave_id.split("-");
  38.  
  39. //cmd="c:\\1\\ffmpeg.exe -f gdigrab -video_size 1920x1080 -offset_x 0 -offset_y 0 -i desktop -f rtsp -muxdelay 1 rtsp://10.131.37.97:600"+port+"/capture"
  40. cmd="c:\\1\\ffmpeg.exe -f gdigrab -video_size 1920x1080 -offset_x 0 -offset_y 0 -i desktop -b:v 16M -minrate 16M -maxrate 16M -bufsize 16M -f rtsp -muxdelay 0.1 rtsp://10.131.241.200:600"+port+"/capture -async 1 -vsync 1"
  41. DebugLogString("Running cmd command: "+cmd)
  42. DoReactGlobalStr("SLAVE",slave,"CREATE_PROCESS","command_line<"+cmd+">");
  43.  
  44. }
  45.  
  46.  
  47. function switz(camid,mon,slave)
  48. {
  49. DebugLogString("Awiting switch on monitor with id "+mon)
  50.      
  51.           Var_var("cam")="111"+camid;
  52.       DebugLogString("Awaiting that choosed cam id will "+Var_var("cam"));
  53.       DoReactGlobalStr("MONITOR",mon,"REMOVE_ALL","__slave_id<WALL>");
  54.       DebugLogString("cam<"+Var_var("cam")+">")
  55.       DoReactGlobalStr("MONITOR",mon,"ADD_SHOW","cam<"+Var_var("cam")+">,__slave_id<WALL>");
  56.  
  57.       rtsp(camid,slave)
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement