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
07ec83cd
Commit
07ec83cd
authored
Mar 28, 2012
by
Alexander Reshetnikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated ffmpeg test for big video writing (changed saving paths + added removing files)
parent
03cd6072
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
8 deletions
+25
-8
test_ffmpeg.cpp
modules/highgui/test/test_ffmpeg.cpp
+25
-8
No files found.
modules/highgui/test/test_ffmpeg.cpp
View file @
07ec83cd
...
...
@@ -64,28 +64,45 @@ public:
const
size_t
n
=
sizeof
(
codec_bmp_tags
)
/
sizeof
(
codec_bmp_tags
[
0
]);
bool
created
=
false
;
for
(
size_t
j
=
0
;
j
<
n
;
++
j
)
{
stringstream
s
;
s
<<
codec_bmp_tags
[
j
].
tag
;
const
string
filename
=
ts
->
get_data_path
()
+
"../../../../output_"
+
s
.
str
()
+
".avi"
;
Mat
img
(
img_r
,
img_c
,
CV_8UC3
,
Scalar
::
all
(
0
));
try
{
VideoWriter
writer
(
string
(
ts
->
get_data_path
())
+
"video/output_"
+
s
.
str
()
+
".avi"
,
codec_bmp_tags
[
j
].
tag
,
fps
,
frame_s
);
VideoWriter
writer
(
filename
,
codec_bmp_tags
[
j
].
tag
,
fps
,
frame_s
);
if
(
writer
.
isOpened
()
==
false
)
{
ts
->
printf
(
ts
->
LOG
,
"
\n\n
File name: %s
\n
"
,
filename
.
c_str
());
ts
->
printf
(
ts
->
LOG
,
"Codec id: %d Codec tag: %d
\n
"
,
j
,
codec_bmp_tags
[
j
].
tag
);
ts
->
printf
(
ts
->
LOG
,
"Error: cannot create video file."
);
ts
->
set_failed_test_info
(
ts
->
FAIL_INVALID_OUTPUT
);
}
if
(
writer
.
isOpened
()
==
false
)
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_EXCEPTION
);
else
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
fps
*
time_sec
);
i
++
)
{
//circle(img, Point2i(img_c / 2, img_r / 2), cv::min(img_r, img_c) / 2 * (i + 1), Scalar(255, 0, 0, 0), 2);
rectangle
(
img
,
Point2i
(
coeff
*
i
,
coeff
*
i
),
Point2i
(
coeff
*
(
i
+
1
),
coeff
*
(
i
+
1
)),
Scalar
::
all
(
255
*
(
1.0
-
static_cast
<
double
>
(
i
)
/
(
fps
*
time_sec
*
2
)
)),
-
1
);
writer
<<
img
;
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
fps
*
time_sec
);
i
++
)
{
//circle(img, Point2i(img_c / 2, img_r / 2), cv::min(img_r, img_c) / 2 * (i + 1), Scalar(255, 0, 0, 0), 2);
rectangle
(
img
,
Point2i
(
coeff
*
i
,
coeff
*
i
),
Point2i
(
coeff
*
(
i
+
1
),
coeff
*
(
i
+
1
)),
Scalar
::
all
(
255
*
(
1.0
-
static_cast
<
double
>
(
i
)
/
(
fps
*
time_sec
*
2
)
)),
-
1
);
writer
<<
img
;
}
if
(
!
created
)
created
=
true
;
else
remove
(
filename
.
c_str
());
}
}
catch
(...)
{
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_EXCEPTION
);
ts
->
set_failed_test_info
(
ts
->
FAIL_INVALID_OUTPUT
);
}
ts
->
set_failed_test_info
(
cvtest
::
TS
::
OK
);
...
...
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