video

Why does this code detects images as video and how can I fix it?

Why does this code detects images as video and how can I fix it? Question: This method is detecting .jpg pictures as video. Why is that? How can I fix it? def is_video(self) -> bool: try: res = self.video_metadata[‘codec_type’] == ‘video’ logger.info(f"Video.is_video() -> {res}") return res except: return False I’m getting the metadata with ffmpeg.probe(self.path, …

Total answers: 1

Programmatically accessing PTS times in MP4 container

Programmatically accessing PTS times in MP4 container Question: Background For a research project, we are recording video data from two cameras and feed a synchronization pulse directly into the microphone ADC every second. Problem We want to derive a frame time stamp in the clock of the pulse source for each camera frame to relate …

Total answers: 1

Gtk4 Gtk.Video() doesn't play

Gtk4 Gtk.Video() doesn't play Question: It’s been a while now that Gtk4 shipped out, with a new Gtk.Video() component that allows to display a video in a Gtk window without resorting to using Gstreamer. It’s a very simple class with only a handful of subclasses (4) methods (10) & attributes (2). But no matter how …

Total answers: 1

How to save a matplotlib.pause animation to video?

How to save a matplotlib.pause animation to video? Question: I have an animation created with plt.pause as below… import matplotlib.pyplot as plt for i in range(10): plt.scatter(0, i) plt.pause(0.01) plt.show() How can I save this as a video file, e.g. a .mp4 file? Asked By: SamTheProgrammer || Source Answers: First, I have to redefine the …

Total answers: 1

Set other video on video end (cv2)

Set other video on video end (cv2) Question: I am trying to set other video on video end in cv2. I expected it to set other video (that i provided), and the actual results was none. The window just closes and displays an error in the command line. The error is: cv2.error: OpenCV(4.6.0) D:aopencv-pythonopencv-pythonopencvmoduleshighguisrcwindow.cpp:967: error: …

Total answers: 1

How to capture images every n seconds from always running video?

How to capture images every n seconds from always running video? Question: I want to capture image and store it on my local system after every n seconds, I can not set frame(5) as I want video and detection to run completely. Currently my code is capturing image whenever a condition is failed. def create_alert(self): …

Total answers: 1

Get any objects (Rect, Surfaces…) at position / coordinates X, Y

Get any objects (Rect, Surfaces…) at position / coordinates X, Y Question: So the question is simple: Given a Surface, let’s call it screen and x,y coordinates, can I get anything that lays at that coordinates on that Surface? For example, let’s say we have typical, Player attack, and if the attack reach the Enemy …

Total answers: 1

Python OpenCv: How to Write text on video? output .mp4 empty

Python OpenCv: How to Write text on video? output .mp4 empty Question: I would like to insert a text in a video dynamically. When I run the code below it displays a window with the text inside the video, but the .mp4 output generated file is empty (0kb) EDIT: problem persists after right indentation path …

Total answers: 1

Concatenate a video, image and audio using ffmpeg

Concatenate a video, image and audio using ffmpeg Question: I am trying to concatenate a group of images with associated audio with a video clip at the start and front of the video. Whenever I concatenate the image with the associated audio it dosen’t playback correctly in VLC media player and only displays the image …

Total answers: 1