почему бы вам просто не сделать, что предложил @micka?
import cv2
vidcap = cv2.VideoCapture('d:/video/keep/Le Sang Des Betes.mp4')
vidcap.set(cv2.CAP_PROP_POS_MSEC,20000) # just cue to 20 sec. position
success,image = vidcap.read()
if success:
cv2.imwrite("frame20sec.jpg", image) # save frame as JPEG file
cv2.imshow("20sec",image)
cv2.waitKey()
//Add click event for any child div of div = grid
$(document).ready(function(){
$('.grid').on('click', 'div', function(e){
GetGridElementsPosition($(this).index()); //Pass in the index of the clicked div
//Relevant to its siblings, in other words if this is the 5th div in the div = grid
});
});
function GetGridElementsPosition(index){
//Get the css attribute grid-template-columns from the css of class grid
//split on whitespace and get the length, this will give you how many columns
const colCount = $('.grid').css('grid-template-columns').split(' ').length;
const rowPosition = Math.floor(index / colCount);
const colPosition = index % colCount;
//Return an object with properties row and column
return { row: rowPosition, column: colPosition } ;
}