import time
from multiprocessing import Queue
from os import getpid

import cv2
import psutil
import requests
from moviepy.editor import VideoFileClip
from pymediainfo import MediaInfo

# aa = time.time()
# try:
#     clip = VideoFileClip("rtmp://192.168.10.101:19350/rlive/stream_107?sign=NQe66OXS")
#     print("分辨率:", clip.size)
#     print("帧率:", clip.fps)
#     print("持续时间:", clip.duration)
# except:
#     pass
# print(time.time() - aa)
# aa = time.time()
# cap = cv2.VideoCapture("rtmp://192.168.10.101:19350/rlive/stream_123?sign=w6RNKsFF")
# width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
# height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
# total_frames = int(cap.get(7))
# fps = cap.get(cv2.CAP_PROP_FPS)
# duration = cap.get(cv2.CAP_PROP_POS_MSEC) / 1000
# cap.release()
# print("分辨率:", (width, height))
# print("帧率:", fps)
# print("持续时间:", duration)
# print("总帧数:", total_frames)
# print(time.time() - aa)
# aa = Queue()
# for i in range(1000):
#     aa.put("1111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
#        "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111"
#        "11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111")
# aa.cancel_join_thread()
# aa.cancel_join_thread()
# aa.close()
# aa.cancel_join_thread()
# aa.cancel_join_thread()
# aa.close()
# aa.cancel_join_thread()
# aa.cancel_join_thread()
# aa.get()
# aa = time.time()
# psutil.Process(getpid()).ppid()
# print(time.time()-aa)


