View Single Post
Old 1st December 2022, 16:52   #10  |  Link
jlw_4049
Registered User
 
Join Date: Sep 2018
Posts: 391
Thanks for the reply. I did look these over, I'm not looking for a completed GUI to do this. I just am trying to understand the conversion/utilize it in a very basic window in python to complete some projects

Quote:
Originally Posted by _Al_ View Post
should be:
format_shuffles(0, clip.get_frame(0))

simplest basic opencv player, it will play without delay frame by frame:
Code:
import cv2
import numpy as np

clip = core.lsmas.LWLibavSource(r"C:\Users\jlw_4\Desktop\rugrats test\The Rugrats Movie (1998).mkv")
#assuming clip is loaded correctly from mkv
rgb = core.resize.Point(clip, format=vs.RGB24,    matrix_in_s = '709')
for f in rgb.frames():     
    img = np.dstack([np.asarray(f.get_read_array(p)) for p in [2,1,0]]) #or f[p] ...
    cv2.imshow('movie', img)
    cv2.waitKey(1)
This set me on the right track. I do have this working now at least. I appreciate the information so far!
jlw_4049 is offline   Reply With Quote