Skip to content

Conversation

@UnaNancyOwen
Copy link
Contributor

This pullrequest changes

Add support image save parameters in cv::VideoWriter.
This change will become available setting same parameters as cv::imwrite() to cv::VideoWriter::set( cv::IMWRITE_*, value ).

e.g.

cv::VideoWriter writer( "img_%02d.jpg", 0, 0.0, cv::Size( 640, 480 ) );
if( !writer.isOpened() ){
    return -1;
}

writer.set( cv::IMWRITE_JPEG_QUALITY, 80 );

Add support image save parameters in cv::VideoWriter.
This change will become available setting same parameters as
cv::imwrite() to cv::VideoWriter::set( cv::IMWRITE_*, value ).
filename = 0;
}
currentframe = 0;
std::vector<int>().swap( params );
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is about params.clear();?

Copy link
Contributor Author

@UnaNancyOwen UnaNancyOwen Dec 1, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops! I will fix it. :)
I will squash the commits when you confirmed it.
Thanks!

Usage:
    writer.set(cv::CAP_PROP_IMAGES_BASE + cv::IMWRITE_JPEG_QUALITY, 80);
@alalek
Copy link
Member

alalek commented Dec 1, 2016

Current documentation for VideoWriter::set declares this:

propId
Property identifier from cv::VideoWriterProperties (eg. cv::VIDEOWRITER_PROP_QUALITY) or one of Additional flags for video I/O API backends

Actually there is conflict by values between VIDEOWRITER_PROP and IMWRITE_ properties. So we need a properties remapping for this to avoid users confusing.

@UnaNancyOwen I have squashed your fixup commit, fixed problem with passed parameters (there is missing required 'stop' mark to limit number of properties) and append commit with proposed changes.
Please take a look.

@UnaNancyOwen
Copy link
Contributor Author

@alalek Oh, It was necessary to add stop mark. Thank you for your advice.
I feel that checking parameters is a bit redundant. But, It seems necessary for many users. LGTM

@alalek
Copy link
Member

alalek commented Dec 1, 2016

👍

@opencv-pushbot opencv-pushbot merged commit e547bbb into opencv:master Dec 1, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants