This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#After setting up, dejavu locally on my machine | |
#Credits and Reference: https://github.com/worldveil/dejavu | |
import warnings | |
import json | |
import subprocess | |
import moviepy.editor as mp | |
warnings.filterwarnings("ignore") | |
from dejavu import Dejavu |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from skimage.measure import compare_ssim | |
vid_frame = cv2.VideoCapture('/path for/video file/') | |
cover = cv2.cvtColor(cv2.imread('/path for/cover image/'), cv2.COLOR_BGR2GRAY) | |
length = vid_frame.get(cv2.CAP_PROP_FRAME_COUNT) | |
fps = vid_frame.get(cv2.CAP_PROP_FPS) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import subprocess | |
import numpy as np | |
import scipy | |
import librosa | |
import matplotlib.pyplot as plt | |
file_input = "/path for/video file/" | |
file_output = "/path for/output audio file.wav/" | |
command = "ffmpeg -i " + file_input +" -t 300 -codec:a pcm_s16le -ac 1 "+ file_output #converts the first 5 minutes of video file to wav output |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cv2 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
vid_frame = cv2.VideoCapture('/path for/video file/') | |
length = vid_frame.get(cv2.CAP_PROP_FRAME_COUNT) | |
fps = vid_frame.get(cv2.CAP_PROP_FPS) | |
num_frames = int(fps*300) #number of frames in first 5 minutes |