main.py 1.0 KB

12345678910111213141516171819202122
  1. import subprocess
  2. import os
  3. import keyboard
  4. command2 = 'ffmpeg'
  5. command = 'ffmpeg -f gdigrab -framerate 60 -offset_x 640 -offset_y 340 -video_size 640x360 -i desktop -c:v libx264 -pix_fmt bgra -preset ultrafast -crf 0 16562015027263.avi && ffmpeg2.exe -i 16562015027263.avi -vf "scale=iw*6:-1:flags=neighbor" -crf 0 -c:v h264_nvenc -pix_fmt bgra -b:v 50000k 16562015027263upscale.avi'
  6. command3 = 'ffmpeg -y -f gdigrab -framerate 60 -offset_x 640 -offset_y 340 -video_size 640x360 -i desktop -c:v libx264 -pix_fmt bgra -preset ultrafast -crf 0 1.avi'
  7. command4 = 'ffmpeg -i 1.avi -vf "scale=iw*6:-1:flags=neighbor" -crf 0 -c:v h264_nvenc -pix_fmt bgra -b:v 50000k 2.avi'
  8. #p1 = subprocess.run(command3, shell=True, capture_output=True)
  9. #print(p1)
  10. p = subprocess.Popen(command3, shell=True)
  11. while True:
  12. if keyboard.is_pressed("f9"):
  13. print("You pressed 'f9'.")
  14. #p.communicate(input='q')[0]
  15. os.system("taskkill /f /im ffmpeg.exe")
  16. p = subprocess.Popen(command4, shell=True)
  17. break
  18. a