video-processing

How to create a clip from an mp4-file quickly?

How to create a clip from an mp4-file quickly? Question: I have a web app that lets users download a clip from a mp4-file specified before. Currently I use ffmpeg via python like this: os.system(‘ffmpeg -i original_video -ss {start} -t {duration} result_video’) Processing 10 minutes of 720p video with this method also takes a few …

Total answers: 2

how to get a image from large video using opencv

how to get a image from large video using opencv Question: My code run very well. But this process is tiring my processor. I have 1000+ videos to make it Is there anyone to have more useful code? import cv2 video = cv2.VideoCapture("E:/videos/example1.mp4") length = int(video.get(cv2.CAP_PROP_FRAME_COUNT)) video.get(cv2.CAP_INTELPERC_IMAGE_GENERATOR) print( length ) i=0 while True: ret, frame …

Total answers: 1

Creating video from images using PyAV

Creating video from images using PyAV Question: I am trying to write a function that creates a new MP4 video from a set of frames taken from another video. The frames will be given in PIL.Image format and is often cropped to include only a part of the input video, but all images will have …

Total answers: 1

Changing FPS in OpenCV

Changing FPS in OpenCV Question: I have a technical application that needs to capture a few frames per second. Setting the videowriter in the below code to 3 frames per second results in the webcam’s normal framerate of approximately 30 fps being saved. What are the options to save the recorded 3 frames per second, …

Total answers: 2

crop frames of a video using opencv

crop frames of a video using opencv Question: i want to crop each of the frames of this video and save all the cropped images to use them as input for a focus stacking software but my approach: cap = cv2.VideoCapture(r"C:UsersHPDownloadsVID_20221128_112556.mp4") ret, frames = cap.read() count=0 for img in frames: stops.append(img) cv2.imwrite("../stack/croppedframe%d.jpg" % count,img[500:1300,100:1000]) print(count) …

Total answers: 1

How to write codes from three .py files into one

How to write codes from three .py files into one Question: I have 3 .py files that splits a video into frames, apply saliency to those frames and then combine those frames into a video. I would like to have a single .py file that does all the above, instead of running three separate files. …

Total answers: 1

Variable fps (frame per second) in cv2

Variable fps (frame per second) in cv2 Question: I use cv2 for creating videos from different frames that I have. When I create the video, I cannot change the fps (frame per second). I want the video be slow at the beginning but fast towards the end, meaning small fps at the beginning but large …

Total answers: 2

cv2.VideoWriter issues

cv2.VideoWriter issues Question: I’m looking to record a Twitch Livestream by feeding it the direct livestream url using streamlink.streams(url) (which returns a .m3u8 url). With this, I have no problem reading the stream and even writing a few images from it, but when it comes to writing it as a video, I get errors. P.S.: …

Total answers: 1

List to numpy array to write with imageio as video

List to numpy array to write with imageio as video Question: I have a list as all_frames. I want to write this as a video with imageio but I got the error that you can find in below. How can I change all_frame from list to np.array? You can find imageio code in below: all_frames …

Total answers: 1