Skip to content

Instantly share code, notes, and snippets.

View JasonSKK's full-sized avatar

Iason Svoronos Kanavas JasonSKK

View GitHub Profile
@JasonSKK
JasonSKK / extract_frames_no_duplicates.py
Created October 10, 2023 13:39
Extract frames from a video at specified intervals using FFmpeg. Evaluation of the differences between consecutive frames and saving only those frames that exhibit significant changes. The difference is determined by calculating the mean absolute pixel difference. Frames with a difference exceeding a given threshold are stored as PNG images
import cv2
import os
def extract_different_frames(video_path, output_dir, threshold=30):
cap = cv2.VideoCapture(video_path)
prev_frame = None
frame_count = 0
while True:
ret, frame = cap.read()
@JasonSKK
JasonSKK / 034_create-next-meeting-notes-file.el
Created July 7, 2023 15:05
Research student, quick Emacs ORG-MODE supervising meeting file creation
;;; create-next-meeting-notes-file --- 2023-07-07 04:03:12 pm
;; create-next-meeting-notes-file.el
;;
;; This Emacs Lisp function creates a new supervising meeting notes file with the next number in the directory
;; "~/Desktop/research-mres/meeting-notes/" and inserts the preamble text for easy org-latex to PDF export.
;;
;; The function retrieves the list of existing meeting notes files in the specified directory, extracts
;; the numerical part of each file name, finds the maximum number, and increments it by 1 to determine
;; the next file number. The current date is added to the file name in the format YYMMDD.
;;