video-capture

Playback loop option in OpenCV videos

馋奶兔 提交于 2021-02-18 22:47:00
问题 I am trying to build a playback loop option for an OpenCV video . My program uses Python multiprocessing, and has a button send loopswitch calls through queue4 to enable or disable the loop option. My specific problem is that my video freezes on the last frame, and I would like to know if the line vidFile.set(cv2.cv.CV_CAP_PROP_POS_FRAMES, 1) is a correct use of the cv2.VideoCapture.set() method , and should indeed take the video back to frame 1 and replay it (as I think it should). EDIT

Playback loop option in OpenCV videos

橙三吉。 提交于 2021-02-18 22:42:53
问题 I am trying to build a playback loop option for an OpenCV video . My program uses Python multiprocessing, and has a button send loopswitch calls through queue4 to enable or disable the loop option. My specific problem is that my video freezes on the last frame, and I would like to know if the line vidFile.set(cv2.cv.CV_CAP_PROP_POS_FRAMES, 1) is a correct use of the cv2.VideoCapture.set() method , and should indeed take the video back to frame 1 and replay it (as I think it should). EDIT

Local store video webRTC

南笙酒味 提交于 2021-02-10 20:31:59
问题 I used the the information from the link (here) and got the following code, which helps me to record a video with my webcam. The code allows me to record a video and makes it available to download. However, I want to save the recorded video automatically to a local folder. How can I do that? <script src="https://cdn.webrtc-experiment.com/RecordRTC.js"></script> <section class="experiment"> <div class="inner"> <button style="float: right;" id="fit-to-screen">Fit to Screen!</button> <label for=

Project and build structure for Microsoft DirectShow based virtual webcam application on Window 10

橙三吉。 提交于 2021-02-10 18:23:03
问题 I am trying to create simplest virtual webcam application which can display image file on my local filesystem. After initial research on stackoverflow links and seeing OBS Studio source code I got some idea how can I achieve this. I would need to use Microsoft DirectShow. I would need to develop one source filter that would work as capture filter using IBaseFilter I would need to develop another source filter that would work as output filter or virtual webcam filter. I would need to compile

OpenTok, How to switch publisher source from screen capturer to camera and vice versa?

坚强是说给别人听的谎言 提交于 2021-02-08 15:18:32
问题 I am trying to implement the feature that allows to switch between screen sharing capture and camera in the middle of the video session in an Android app. I use OpenTok SDK 2.5 for Android. I have researched OpenTok examples (OpenTok samples) and figured they show only one feature per program sample. Question: Should code supply two Publishers (one equipped with Camera and one with Screensharing capturer) and switch them, for example session.unpublish(); if (currentIsCamera) { session.publish

iOS — How to change video resolution in webRTC?

浪子不回头ぞ 提交于 2021-02-08 15:16:27
问题 I am trying to change local video resolution in webRTC. I used following method to create local video tracker: -(RTCVideoTrack *)createLocalVideoTrack { RTCVideoTrack *localVideoTrack = nil; RTCMediaConstraints *mediaConstraints = [[RTCMediaConstraints alloc] initWithMandatoryConstraints:nil optionalConstraints:nil]; RTCAVFoundationVideoSource *source = [self.factory avFoundationVideoSourceWithConstraints:mediaConstraints]; localVideoTrack = [self.factory videoTrackWithSource:source trackId:@

How to explicitly access mjpeg backend for videocapture in opencv

家住魔仙堡 提交于 2021-02-08 05:15:15
问题 When I execute following: availableBackends = [cv2.videoio_registry.getBackendName(b) for b in v2.videoio_registry.getBackends()] print(availableBackends) I get ['FFMPEG', 'GSTREAMER', 'INTEL_MFX', 'V4L2', 'CV_IMAGES', 'CV_MJPEG'] . If I now try: print(cv2.CAP_FFMPEG) print(cv2.CAP_GSTREAMER) print(cv2.CAP_INTEL_MFX) print(cv2.CAP_V4L2) print(cv2.CAP_IMAGES) print(cv2.CAP_MJPEG) all work except the last one AttributeError: module 'cv2.cv2' has no attribute 'CAP_MJPEG' . How can I explicitely

How to explicitly access mjpeg backend for videocapture in opencv

北慕城南 提交于 2021-02-08 05:10:55
问题 When I execute following: availableBackends = [cv2.videoio_registry.getBackendName(b) for b in v2.videoio_registry.getBackends()] print(availableBackends) I get ['FFMPEG', 'GSTREAMER', 'INTEL_MFX', 'V4L2', 'CV_IMAGES', 'CV_MJPEG'] . If I now try: print(cv2.CAP_FFMPEG) print(cv2.CAP_GSTREAMER) print(cv2.CAP_INTEL_MFX) print(cv2.CAP_V4L2) print(cv2.CAP_IMAGES) print(cv2.CAP_MJPEG) all work except the last one AttributeError: module 'cv2.cv2' has no attribute 'CAP_MJPEG' . How can I explicitely

video capture card (webcam like) with OpenCV

末鹿安然 提交于 2021-01-29 05:31:10
问题 I want to use video capture card to capture my screen display, and process the image by OpenCV/C++. I have heard that there's some video capture card which is webcam like.(i.e. I can get the screen display by VideoCapture in OpenCV.) Can someone tell me which video capture card should I buy? Thanks !!! 回答1: I do not know if there some way to achieve that directly using OpenCV. However, a simple workaround could be like this: Using this software you can create new webcam that stream your

Too High CPU Footprint of OpenCV Text Overlay on FHD Video Stream

北城以北 提交于 2021-01-29 02:33:35
问题 I want to display a FHD live-stream (25 fps) and overlay some (changing) text. For this I essentially use the code below. Basically it is Load frame ( cv::putText skipped here) Display frame if it's a multiple of delay but the code is super super slow compared to e.g. mpv and consumes way to much cpu-time ( cv::useOptimized() == true ). So far delay is my inconvenient fiddle-parameter to somehow make it feasible. delay == 1 results in 180 % CPU usage (full frame-rate) delay == 5 results in 80