comment out gnome screencast for wayland
This commit is contained in:
parent
d0603a8a92
commit
2bb8739b38
@ -7,7 +7,7 @@ import pyscreenshot
|
||||
from PIL import Image, ImageDraw, ImageFont
|
||||
import cv2
|
||||
import numpy as np
|
||||
from skimage import io
|
||||
#from skimage import io
|
||||
from threading import Thread
|
||||
import time
|
||||
import io
|
||||
@ -59,12 +59,7 @@ def get_base_color(color):
|
||||
_r,_g,_b = 0,0,0
|
||||
|
||||
def vibrant(r,g,b):
|
||||
intensity = 30 # usabel range 1-100 max:1000
|
||||
|
||||
_r,_g,_b = 0,0,0
|
||||
|
||||
def vibrant(r,g,b):
|
||||
intensity = 30 # usabel range 1-100 max:1000
|
||||
intensity = 1 # usabel range 1-100 max:1000
|
||||
|
||||
intensity = 1+intensity/1000
|
||||
rgb = [r,g,b]
|
||||
@ -111,30 +106,38 @@ def ambient_light():
|
||||
|
||||
global _r,_g,_b
|
||||
|
||||
bus = SessionBus()
|
||||
#bus = SessionBus()
|
||||
#RecorderPipeline = "vp8enc min_quantizer=10 max_quantizer=50 cq_level=13 cpu-used=1 deadline=1000000 threads=%T ! queue ! webmmux"
|
||||
GNOMEScreencast = bus.get('org.gnome.Shell.Screencast', '/org/gnome/Shell/Screencast')
|
||||
GNOMEScreencast.Screencast('/tmp/a', {})
|
||||
#GNOMEScreencast = bus.get('org.gnome.Shell.Screencast', '/org/gnome/Shell/Screencast')
|
||||
#GNOMEScreencast.Screencast('/tmp/a', {})
|
||||
#GNOMEScreencast.StopScreencast()
|
||||
time.sleep(1)
|
||||
#time.sleep(1)
|
||||
|
||||
amp = [1,1,0.8]
|
||||
counter = 0
|
||||
start_time = time.time()
|
||||
while True:
|
||||
counter += 1
|
||||
time_d = time.time()-start_time
|
||||
ups = counter/time_d
|
||||
#print(ups)
|
||||
|
||||
# screenshot
|
||||
|
||||
# Xorg
|
||||
#img = pyscreenshot.grab(backend="mss", childprocess=False, bbox=(1920,0,4480,1440))
|
||||
img = pyscreenshot.grab(backend="mss", childprocess=False, bbox=(1920,0,4480,1440))
|
||||
|
||||
#Wayland
|
||||
time.sleep(0.1)
|
||||
cap = cv2.VideoCapture('/tmp/a')
|
||||
count = cap.get(cv2.CAP_PROP_FRAME_COUNT)
|
||||
cap.set(cv2.CAP_PROP_POS_FRAMES, count-1)
|
||||
#time.sleep(0.1)
|
||||
#cap = cv2.VideoCapture('/tmp/a')
|
||||
#count = cap.get(cv2.CAP_PROP_FRAME_COUNT)
|
||||
#cap.set(cv2.CAP_PROP_POS_FRAMES, count-1)
|
||||
|
||||
ret, frame = cap.read()
|
||||
#ret, frame = cap.read()
|
||||
|
||||
frame = cv2.cvtColor(frame,cv2.COLOR_BGR2RGB)
|
||||
img = Image.fromarray(frame)
|
||||
cap.release()
|
||||
#frame = cv2.cvtColor(frame,cv2.COLOR_BGR2RGB)
|
||||
#img = Image.fromarray(frame)
|
||||
#cap.release()
|
||||
|
||||
|
||||
'''
|
||||
@ -155,6 +158,9 @@ def ambient_light():
|
||||
r,g,b = img.getpixel((0, 0))
|
||||
_r,_g,_b = vibrant(r,g,b)
|
||||
|
||||
time.sleep(0.05)
|
||||
|
||||
|
||||
def rgb_to_hex(r,g,b):
|
||||
return "%02x%02x%02x" % (r,g,b)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user