-
Notifications
You must be signed in to change notification settings - Fork 0
/
running_example.py
36 lines (27 loc) · 932 Bytes
/
running_example.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#import pylibde265 as decode
import pylibde265.pyde265
print(dir(pylibde265.pyde265))
import time
import PIL.Image
import numpy as np
import cupy as cp
print(pylibde265.pyde265.get_version())
#vedio_path = './Kinkaku-ji.h265'
vedio_path = r"C:\Users\1138\Downloads\tos-4096x1720-tiles\tos-4096x1720-tiles.hevc"
dec = pylibde265.pyde265.decode_decoder(10)
with open(vedio_path,'rb') as data:
re = dec.load(data)
frame = 0
for re in dec.decode():
start_t = time.time()
frame += 1
#print(re['pts'])
#print(re['ttd'],re['ttd_max'])
#print(re)
image_data = re['image']
image_data = cp.asnumpy(image_data)
image = PIL.Image.fromarray(image_data,mode='YCbCr')
with open('./cache/py.txt','a') as file:
print(time.time()-start_t,file=file)
#image.save(f'./cache/{str(frame).zfill(9)}.jpg')
#image.show()