Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. write video partition ie:10 min with opencv in qthread
Forum Updated to NodeBB v4.3 + New Features

write video partition ie:10 min with opencv in qthread

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 295 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    RahibeMeryem
    wrote on last edited by
    #1

    Hi,

    I want to write videos as 10 min long or a certtain frame count and than want to change file name ie:date_time dynamically.

    I am using QThread and moving my class to it.:

    #include "videowriter.h"
    
    using namespace cv;
    
    CamVideoWriter::CamVideoWriter(QObject *parent) : QObject (parent)
    {
    
        video_writer = new VideoWriter;
        video_writer->open("outcpp.avi",CV_FOURCC('M','J','P','G'),25, Size(1280,720)) ;
    }
    CamVideoWriter::~CamVideoWriter() {
        exit;
    }
    
    void CamVideoWriter::FrameWriter(const cv::Mat &frame)
    {
        if (video_writer->isOpened()) {
    
                video_writer->write(frame);
    
    }
    
    
    
    }
    
    
    
    

    How can I change the file name dynamically if a I wrote a certain amount of frame ?

    Best

    1 Reply Last reply
    0
    • Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by
      #2

      I believe you must close video_writer and open an new one with a different name. you don't mention whether you expect to use a single QThread for all writing or spawn a new QThread each time the video file name changes.

      1 Reply Last reply
      1

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved