congress.py 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import pyttsx3
  2. import rpyc
  3. import random
  4. import time
  5. #conn = rpyc.classic.connect("192.168.1.110",18812)
  6. conn = rpyc.classic.connect("192.168.192.134",18812)
  7. ros = conn.modules.os
  8. rsys = conn.modules.sys
  9. fr=open('c:/video/congress.mp3','rb')
  10. fw=conn.builtins.open('/tmp/ok2.mp3','wb')
  11. while True:
  12. b=fr.read(1024)
  13. if b:
  14. fw.write(b)
  15. else:
  16. break
  17. fr.close()
  18. fw.close()
  19. val=random.randint(1000000,9999999)
  20. ros.chdir('/home/jared/Wav2Lip-master')
  21. #ros.system('./proc.sh '+str(val)+' &')
  22. ros.system('./p2.sh '+str(val)+' &')
  23. while True:
  24. print('waiting...')
  25. if ros.path.exists('/tmp/results/'+str(val)):
  26. break
  27. time.sleep(5)
  28. print('waiting...')
  29. ros.system('cp /home/jared/Wav2Lip-master/results/result_voice.mp4 /tmp')
  30. #ros.chdir('/home/jared/tests/libopenshot')
  31. #ros.system('python3 jaredtest.py')
  32. #ros.system('cp /tmp/out.mp4 /var/www/html/out.mp4')
  33. #
  34. #ros.system('telegram-send "video is ready, http://139.162.121.30:54321/out.mp4"')
  35. fr=conn.builtins.open('/home/jared/Wav2Lip-master/results/result_voice.mp4','rb')
  36. #fr=conn.builtins.open('/tmp/out.mp4','rb')
  37. fw=open('c:/video/result.mp4','wb')
  38. while True:
  39. b=fr.read(1024)
  40. if b:
  41. fw.write(b)
  42. else:
  43. break
  44. fr.close()
  45. fw.close()
  46. #fr=conn.builtins.open('/home/jared/Wav2Lip-master/results/result_voice.mp4','rb')
  47. #fr=conn.builtins.open('/tmp/out.mp4','rb')
  48. #fw=open('result.mp4','wb')
  49. #while True:
  50. # b=fr.read(1024)
  51. # if b:
  52. # fw.write(b)
  53. # else:
  54. # break
  55. #fr.close()
  56. #fw.close()