Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
c60b7d76
Commit
c60b7d76
authored
Jun 26, 2017
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8984 from alalek:update_videowriter_apipreference
parents
cc021e55
23f4bff7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
26 deletions
+17
-26
videoio.hpp
modules/videoio/include/opencv2/videoio.hpp
+3
-9
cap.cpp
modules/videoio/src/cap.cpp
+14
-14
precomp.hpp
modules/videoio/src/precomp.hpp
+0
-3
No files found.
modules/videoio/include/opencv2/videoio.hpp
View file @
c60b7d76
...
...
@@ -855,7 +855,7 @@ public:
The `apiPreference` parameter allows to specify API backends to use. Can be used to enforce a specific reader implementation
if multiple are available: e.g. cv::CAP_FFMPEG or cv::CAP_GSTREAMER.
*/
CV_WRAP
VideoWriter
(
int
apiPreference
,
const
String
&
filenam
e
,
int
fourcc
,
double
fps
,
CV_WRAP
VideoWriter
(
const
String
&
filename
,
int
apiPreferenc
e
,
int
fourcc
,
double
fps
,
Size
frameSize
,
bool
isColor
=
true
);
/** @brief Default destructor
...
...
@@ -875,15 +875,9 @@ public:
CV_WRAP
virtual
bool
open
(
const
String
&
filename
,
int
fourcc
,
double
fps
,
Size
frameSize
,
bool
isColor
=
true
);
/** @brief Initializes or reinitializes video writer.
The method opens video writer. Parameters are the same as in the constructor
VideoWriter::VideoWriter.
@return `true` if video writer has been successfully initialized
The method first calls VideoWriter::release to close the already opened file.
/** @overload
*/
CV_WRAP
bool
open
(
int
apiPreference
,
const
String
&
filenam
e
,
int
fourcc
,
double
fps
,
CV_WRAP
bool
open
(
const
String
&
filename
,
int
apiPreferenc
e
,
int
fourcc
,
double
fps
,
Size
frameSize
,
bool
isColor
=
true
);
/** @brief Returns true if video writer has been successfully initialized.
...
...
modules/videoio/src/cap.cpp
View file @
c60b7d76
...
...
@@ -368,13 +368,7 @@ CV_IMPL CvCapture * cvCreateFileCapture (const char * filename)
* Videowriter dispatching method: it tries to find the first
* API that can write a given stream.
*/
CV_IMPL
CvVideoWriter
*
cvCreateVideoWriter
(
const
char
*
filename
,
int
fourcc
,
double
fps
,
CvSize
frameSize
,
int
is_color
)
{
return
cvCreateVideoWriterWithPreference
(
CV_CAP_ANY
,
filename
,
fourcc
,
fps
,
frameSize
,
is_color
);
}
CvVideoWriter
*
cvCreateVideoWriterWithPreference
(
int
apiPreference
,
const
char
*
filename
,
int
fourcc
,
static
CvVideoWriter
*
cvCreateVideoWriterWithPreference
(
const
char
*
filename
,
int
apiPreference
,
int
fourcc
,
double
fps
,
CvSize
frameSize
,
int
is_color
)
{
CV_UNUSED
(
frameSize
);
...
...
@@ -428,6 +422,12 @@ CvVideoWriter* cvCreateVideoWriterWithPreference(int apiPreference, const char*
return
result
;
}
CV_IMPL
CvVideoWriter
*
cvCreateVideoWriter
(
const
char
*
filename
,
int
fourcc
,
double
fps
,
CvSize
frameSize
,
int
is_color
)
{
return
cvCreateVideoWriterWithPreference
(
filename
,
CV_CAP_ANY
,
fourcc
,
fps
,
frameSize
,
is_color
);
}
CV_IMPL
int
cvWriteFrame
(
CvVideoWriter
*
writer
,
const
IplImage
*
image
)
{
return
writer
?
writer
->
writeFrame
(
image
)
:
0
;
...
...
@@ -563,7 +563,7 @@ static Ptr<IVideoCapture> IVideoCapture_create(const String& filename)
return
Ptr
<
IVideoCapture
>
();
}
static
Ptr
<
IVideoWriter
>
IVideoWriter_create
(
int
apiPreference
,
const
String
&
filenam
e
,
int
_fourcc
,
double
fps
,
Size
frameSize
,
bool
isColor
)
static
Ptr
<
IVideoWriter
>
IVideoWriter_create
(
const
String
&
filename
,
int
apiPreferenc
e
,
int
_fourcc
,
double
fps
,
Size
frameSize
,
bool
isColor
)
{
Ptr
<
IVideoWriter
>
iwriter
;
#ifdef HAVE_MFX
...
...
@@ -757,9 +757,9 @@ VideoWriter::VideoWriter(const String& filename, int _fourcc, double fps, Size f
}
VideoWriter
::
VideoWriter
(
int
apiPreference
,
const
String
&
filenam
e
,
int
_fourcc
,
double
fps
,
Size
frameSize
,
bool
isColor
)
VideoWriter
::
VideoWriter
(
const
String
&
filename
,
int
apiPreferenc
e
,
int
_fourcc
,
double
fps
,
Size
frameSize
,
bool
isColor
)
{
open
(
apiPreference
,
filenam
e
,
_fourcc
,
fps
,
frameSize
,
isColor
);
open
(
filename
,
apiPreferenc
e
,
_fourcc
,
fps
,
frameSize
,
isColor
);
}
void
VideoWriter
::
release
()
...
...
@@ -775,18 +775,18 @@ VideoWriter::~VideoWriter()
bool
VideoWriter
::
open
(
const
String
&
filename
,
int
_fourcc
,
double
fps
,
Size
frameSize
,
bool
isColor
)
{
return
open
(
CAP_ANY
,
filename
,
_fourcc
,
fps
,
frameSize
,
isColor
);
return
open
(
filename
,
CAP_ANY
,
_fourcc
,
fps
,
frameSize
,
isColor
);
}
bool
VideoWriter
::
open
(
int
apiPreference
,
const
String
&
filenam
e
,
int
_fourcc
,
double
fps
,
Size
frameSize
,
bool
isColor
)
bool
VideoWriter
::
open
(
const
String
&
filename
,
int
apiPreferenc
e
,
int
_fourcc
,
double
fps
,
Size
frameSize
,
bool
isColor
)
{
CV_INSTRUMENT_REGION
()
if
(
isOpened
())
release
();
iwriter
=
IVideoWriter_create
(
apiPreference
,
filenam
e
,
_fourcc
,
fps
,
frameSize
,
isColor
);
iwriter
=
IVideoWriter_create
(
filename
,
apiPreferenc
e
,
_fourcc
,
fps
,
frameSize
,
isColor
);
if
(
!
iwriter
.
empty
())
return
true
;
writer
.
reset
(
cvCreateVideoWriterWithPreference
(
apiPreference
,
filename
.
c_str
()
,
_fourcc
,
fps
,
frameSize
,
isColor
));
writer
.
reset
(
cvCreateVideoWriterWithPreference
(
filename
.
c_str
(),
apiPreference
,
_fourcc
,
fps
,
frameSize
,
isColor
));
return
isOpened
();
}
...
...
modules/videoio/src/precomp.hpp
View file @
c60b7d76
...
...
@@ -162,9 +162,6 @@ CvCapture * cvCreateCameraCapture_Unicap (const int index);
CvCapture
*
cvCreateCameraCapture_PvAPI
(
const
int
index
);
CvVideoWriter
*
cvCreateVideoWriter_GStreamer
(
const
char
*
filename
,
int
fourcc
,
double
fps
,
CvSize
frameSize
,
int
is_color
);
CvVideoWriter
*
cvCreateVideoWriterWithPreference
(
int
api
,
const
char
*
filename
,
int
fourcc
,
double
fps
,
CvSize
frame_size
,
int
is_color
CV_DEFAULT
(
1
));
namespace
cv
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment