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
421fcf9e
Commit
421fcf9e
authored
Mar 16, 2016
by
Roman Donchenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Rearrange CvVideoWriter_FFMPEG::writeFrame for better readability
parent
d142c05d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
16 deletions
+15
-16
cap_ffmpeg_impl.hpp
modules/highgui/src/cap_ffmpeg_impl.hpp
+15
-16
No files found.
modules/highgui/src/cap_ffmpeg_impl.hpp
View file @
421fcf9e
...
...
@@ -1552,7 +1552,20 @@ static int icv_av_write_frame_FFMPEG( AVFormatContext * oc, AVStream * video_st,
/// write a frame with FFMPEG
bool
CvVideoWriter_FFMPEG
::
writeFrame
(
const
unsigned
char
*
data
,
int
step
,
int
width
,
int
height
,
int
cn
,
int
origin
)
{
bool
ret
=
false
;
// check parameters
if
(
input_pix_fmt
==
AV_PIX_FMT_BGR24
)
{
if
(
cn
!=
3
)
{
return
false
;
}
}
else
if
(
input_pix_fmt
==
AV_PIX_FMT_GRAY8
)
{
if
(
cn
!=
1
)
{
return
false
;
}
}
else
{
assert
(
false
);
}
if
(
(
width
&
-
2
)
!=
frame_width
||
(
height
&
-
2
)
!=
frame_height
||
!
data
)
return
false
;
...
...
@@ -1605,20 +1618,6 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int
}
#endif
// check parameters
if
(
input_pix_fmt
==
AV_PIX_FMT_BGR24
)
{
if
(
cn
!=
3
)
{
return
false
;
}
}
else
if
(
input_pix_fmt
==
AV_PIX_FMT_GRAY8
)
{
if
(
cn
!=
1
)
{
return
false
;
}
}
else
{
assert
(
false
);
}
if
(
c
->
pix_fmt
!=
input_pix_fmt
)
{
assert
(
input_picture
);
...
...
@@ -1652,7 +1651,7 @@ bool CvVideoWriter_FFMPEG::writeFrame( const unsigned char* data, int step, int
}
picture
->
pts
=
frame_idx
;
ret
=
icv_av_write_frame_FFMPEG
(
oc
,
video_st
,
outbuf
,
outbuf_size
,
picture
)
>=
0
;
bool
ret
=
icv_av_write_frame_FFMPEG
(
oc
,
video_st
,
outbuf
,
outbuf_size
,
picture
)
>=
0
;
frame_idx
++
;
return
ret
;
...
...
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