Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9204693
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T23:46:12+00:00 2026-06-17T23:46:12+00:00

This question is in continuation of error-in-opencv-code-for-motion-detection . The editted code works without any

  • 0

This question is in continuation of error-in-opencv-code-for-motion-detection. The editted code works without any errors but the output video is not created,it is of zero bytes!What is wrong in this?Also,the bounding box created for motion detection never really captures the motion that is, it does not do what it originally claimed to do.Am I misunderstanding something about the objective of thie code?So, here are my questions:

  1. How to rectify the creation and save the video?
  2. What needs to be modified to detect motion and track it?
  3. How to convert the video to a series of numbered jpg images from each frame and vice-versa.
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T23:46:13+00:00Added an answer on June 17, 2026 at 11:46 pm

    Here is the code which you can work with to frame a video as a set of images.

    #include <stdio.h>
    #include <string.h>
    #include <stdlib.h>
    #include "cv.h"
    #include <highgui.h>
    #include "cxcore.h" 
    
    int main( int argc, char** argv )
    {    
         CvCapture *capture = cvCaptureFromAVI("E:\\Myvideo.avi");
                 if(!capture) 
        {
            printf("!!! cvCaptureFromAVI failed (file not found?)\n");
            return -1; 
        }
    
        int fps = (int) cvGetCaptureProperty(capture, CV_CAP_PROP_FPS);
    
        printf("* FPS: %d\n", fps);
    
        IplImage* frame = NULL;
        int frame_number = 0;
        char key = 0;   
    
        while (key != 'q') 
        {
            // get frame 
            frame = cvQueryFrame(capture);       
            if (!frame) 
            {
                printf("!!! cvQueryFrame failed: no frame\n");
                break;
            }       
    
    
    
    
            // quit when user press 'q'
            key = cvWaitKey(1000 / fps);
        }
    
        // free resources
        cvReleaseCapture(&capture);
    
        return 0;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is a continuation question from Opencv video frame giving me an error I
This question is the continuation of I created textarea expander from script but after,
This so a continuation of this question: I created textarea expander from script but
This question is continuation of my question . Here is problematic code. a.h: #include
This question is continuation of my previous one. Without going into too much details,
This is a continuation of another question I have. Consider the following code: char
This question is a continuation of the same effort to code my first cte
This question is a continuation of my previous question here zend models architecture (big
This question is in continuation to my previous question . I am trying to
This is a continuation of this question from yesterday . Here are my three

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.