video-processing

iOS - Creating multiple time-delayed live camera preview views

匆匆过客 提交于 2019-12-12 19:30:01
问题 I have done a ton of research, and haven't yet been able to find a viable solution, for many reasons, which I will outline below. Problem In my iOS app, I want three views that indefinitely show a delayed-live preview of the device's camera. For example, view 1 will show a camera view, delayed for 5s, view 2 will show the same camera view, delayed for 20s, and view 3 will show the same camera view, delayed 30s. This would be used to record yourself performing some kind of activity, such as a

Python function to read video and convert to frames

五迷三道 提交于 2019-12-12 17:34:45
问题 I want to convert my input video to a set of frames. I have read the post on Python - Extracting and Saving Video Frames. But I would like to have a function where I can insert the video as the parameter, not the location of the video file. In the VideoCapture function below, it takes in the location of the video file. import cv2 def vidtoframes(videoFile): vidcap = cv2.VideoCapture(videoFile) success,image = vidcap.read() count = 0 while success: cv2.imwrite("frame%d.jpg" % count, image) #

What is the best way to serve videos on a website?

核能气质少年 提交于 2019-12-12 10:58:19
问题 I want so serve some videos on my site. They are available as .MP4 files gotten from a FlipShare camera. Now I tried converting them to WMV (which succeeded, but when embedded in html in a <object id='mediaPlayer' width='320' height='285' classid='CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95' etc' tag, users have to install an addon and the user experience of 10 Windows Media Players on the site isn't just so good.) So then I looked at youtube and wondered how they do it, but I can't figure out

FFMPEG Can't Display The Duration Of a Video

一笑奈何 提交于 2019-12-12 08:13:13
问题 I'm trying to use ffmpeg to capture frames from a video file, but I can't even get the duration of a video. everytime when I try to access it with pFormatCtx->duration I'm getting 0. I know the pointer initialized and contains the correct duration because if I use av_dump_format(pFormatCtx, 0, videoName, 0); then I actually get the duration data along with other information about the video. This is what I get when I use av_dump_format(pFormatCtx, 0, videoName, 0); : Input #0, avi, from

Video resizing with the Video Processor MFT

核能气质少年 提交于 2019-12-12 06:19:21
问题 I'm using the video processor MFT for pixel format conversion. That works fine. But when I change the input size and keep the output the same the processing of the input hr = ColorConv->ProcessInput(0, pSample, 0); fails with: The data specified for the media type is invalid, inconsistent, or not supported by this object. I think I need to make some settings for the video resizer but I can't figure out the minimal conditioins. What I read is that I need to set SetFullCropRegion but that does

Extracting image from QMediaPlayer Video

。_饼干妹妹 提交于 2019-12-12 04:39:10
问题 i am using Qt Creator to implement an application that reads a video and by clicking on a button i will save the frame that is being showed. Then i will process that frame with Opencv. Having a video being displayed with QmediaPlayer, how can i extract a frame from the video? I should then be able to convert that frame to a Mat image in Matlab. Thanks 回答1: QMediaPlayer *player = new QMediaPlayer(); QVideoProbe *probe = new QVideoProbe; connect(probe, SIGNAL(videoFrameProbed(QVideoFrame)),

Incorporate Processing OpenCV contour in video capture: : Width(0) and height(0) cannot be <= 0

扶醉桌前 提交于 2019-12-12 03:16:17
问题 I want to get the contour of video (or image) every 5 second, using Processing OpenCV library. I have the following code, but for the line opencv = new OpenCV(this, cam); , it tells me: Width(0) and height(0) cannot be <= 0 . I think the program is that the second parameter in new OpenCV should be an image, as opposed to a camera capture, but what I should do to put them together? import processing.video.*; import gab.opencv.*; OpenCV opencv; ArrayList<Contour> contours; Capture theCap;

FFmpeg low trim accuracy

牧云@^-^@ 提交于 2019-12-12 01:17:25
问题 So, I'm trying to cut a 1 minute 29 seconds video into clips of 30 seconds each. The expected output is 30sec,30sec,29sec. The result is 35sec,29sec,23sec. This is my code - ArrayList<String> commandList = new ArrayList<>(); commandList.add("-ss"); commandList.add("00:00:00"); commandList.add("-i"); commandList.add(videoPath); commandList.add("-c"); commandList.add("copy"); commandList.add("-f"); commandList.add("segment"); commandList.add("-segment_time"); commandList.add("00:00:30");

Opencv: How to draw a circle contour on an image

爱⌒轻易说出口 提交于 2019-12-11 20:11:25
问题 I have written a python function, which is supposed to draw a circle on an image, where the center point of the circle has been defined using a mouse call back: def draw_circle_contour(frame, pt, radius): cv2.circle(frame, center=pt, radius=3, color=(255,0,0), thickness=-1) discretized_circle_contour_x = [pt[0] + radius*np.cos(theta) for theta in np.linspace(0, 36, 36)] discretized_circle_contour_x = map(int, discretized_circle_contour_x) discretized_circle_contour_y = [pt[1] + radius*np.sin

FFmpeg's AAC (“libfaac”) Codec Options?

…衆ロ難τιáo~ 提交于 2019-12-11 18:34:11
问题 For AAC ("libfaac") audio encoder, how can I specify the "MPEG Version" to either "MPEG-4" or "MPEG-2" through FFmpeg's command? 回答1: When using libfaac, FFmpeg hard-codes the MPEG version to MPEG-4. You can observe this in libfaac.c , line 118. faac_cfg->mpegVersion = MPEG4; If you want to change it, you will have download the FFmpeg source, modify this line to use MPEG2 instead, and recompile FFmpeg with the appropriate configuration (including --enable-libfaac ). This works and produces a