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
6f48dc24
Commit
6f48dc24
authored
Nov 23, 2017
by
Maksim Shabunin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed GStreamer pipeline building on Ubuntu 17
parent
80820115
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
28 deletions
+14
-28
cap_gstreamer.cpp
modules/videoio/src/cap_gstreamer.cpp
+1
-4
test_video_io.cpp
modules/videoio/test/test_video_io.cpp
+13
-24
No files found.
modules/videoio/src/cap_gstreamer.cpp
View file @
6f48dc24
...
...
@@ -78,11 +78,8 @@
#if GST_VERSION_MAJOR == 0
#define COLOR_ELEM "ffmpegcolorspace"
#define COLOR_ELEM_NAME "ffmpegcsp"
#elif FULL_GST_VERSION < VERSION_NUM(1,5,0)
#define COLOR_ELEM "videoconvert"
#define COLOR_ELEM_NAME COLOR_ELEM
#else
#define COLOR_ELEM "
auto
videoconvert"
#define COLOR_ELEM "videoconvert"
#define COLOR_ELEM_NAME COLOR_ELEM
#endif
...
...
modules/videoio/test/test_video_io.cpp
View file @
6f48dc24
...
...
@@ -87,20 +87,18 @@ public:
// TODO: fix this backend
std
::
cout
<<
"SKIP test: AVFoundation backend returns invalid frame count"
<<
std
::
endl
;
return
;
}
else
if
(
apiPref
==
CAP_VFW
)
{
}
else
if
(
apiPref
==
CAP_VFW
)
{
// TODO: fix this backend
std
::
cout
<<
"SKIP test: Video for Windows backend not open files"
<<
std
::
endl
;
return
;
}
else
if
(
apiPref
==
CAP_GSTREAMER
)
{
// TODO: fix this backend
std
::
cout
<<
"SKIP test: Gstreamer failed with read critical error"
<<
std
::
endl
;
return
;
}
VideoCapture
cap
(
video_file
,
apiPref
);
if
(
!
cap
.
isOpened
())
{
std
::
cout
<<
"SKIP test:
Can't open
video: "
<<
video_file
<<
std
::
endl
;
std
::
cout
<<
"SKIP test:
backend "
<<
apiPref
<<
" can't open the
video: "
<<
video_file
<<
std
::
endl
;
return
;
}
int
n_frames
=
(
int
)
cap
.
get
(
CAP_PROP_FRAME_COUNT
);
...
...
@@ -171,20 +169,18 @@ public:
// TODO: fix this backend
std
::
cout
<<
"SKIP test: AVFoundation backend returns invalid frame count"
<<
std
::
endl
;
return
;
}
else
if
(
apiPref
==
CAP_VFW
)
{
}
else
if
(
apiPref
==
CAP_VFW
)
{
// TODO: fix this backend
std
::
cout
<<
"SKIP test: Video for Windows backend not open files"
<<
std
::
endl
;
return
;
}
else
if
(
apiPref
==
CAP_GSTREAMER
)
{
// TODO: fix this backend
std
::
cout
<<
"SKIP test: Gstreamer failed with read critical error"
<<
std
::
endl
;
return
;
}
VideoCapture
cap
(
video_file
,
apiPref
);
if
(
!
cap
.
isOpened
())
{
std
::
cout
<<
"SKIP test:
Can't open
video: "
<<
video_file
<<
std
::
endl
;
std
::
cout
<<
"SKIP test:
backend "
<<
apiPref
<<
" can't open the
video: "
<<
video_file
<<
std
::
endl
;
return
;
}
...
...
@@ -266,14 +262,12 @@ public:
// TODO: fix this backend
std
::
cout
<<
"SKIP test: AVFoundation backend can not write video"
<<
std
::
endl
;
return
;
}
else
if
(
apiPref
==
CAP_VFW
)
{
}
else
if
(
apiPref
==
CAP_VFW
)
{
// TODO: fix this backend
std
::
cout
<<
"SKIP test: Video for Windows backend not open files"
<<
std
::
endl
;
return
;
}
else
if
(
apiPref
==
CAP_GSTREAMER
)
{
// TODO: fix this backend
std
::
cout
<<
"SKIP test: Gstreamer failed with write critical error"
<<
std
::
endl
;
return
;
}
Mat
img
(
frame_size
,
CV_8UC3
);
VideoWriter
writer
(
video_file
,
apiPref
,
fourcc
,
fps
,
frame_size
,
true
);
...
...
@@ -309,11 +303,6 @@ public:
if
(
fourcc
==
VideoWriter
::
fourcc
(
'M'
,
'P'
,
'E'
,
'G'
)
&&
ext
==
"mkv"
)
expected_frame_count
.
end
+=
1
;
// Hack! Some GStreamer encoding pipelines drop last frame in the video
// #ifdef HAVE_GSTREAMER
// expected_frame_count.start -= 1;
// #endif
ASSERT_LE
(
expected_frame_count
.
start
,
actual
);
ASSERT_GE
(
expected_frame_count
.
end
,
actual
);
...
...
@@ -439,13 +428,13 @@ Ext_Fourcc_PSNR synthetic_params[] = {
#endif
#ifdef HAVE_GSTREAMER
makeParam
(
"avi"
,
"XVID"
,
30.
f
,
CAP_GSTREAMER
),
// makeParam("avi", "XVID", 30.f, CAP_GSTREAMER), - corrupted frames, broken indexes
makeParam
(
"avi"
,
"MPEG"
,
30.
f
,
CAP_GSTREAMER
),
makeParam
(
"avi"
,
"IYUV"
,
30.
f
,
CAP_GSTREAMER
),
makeParam
(
"avi"
,
"MJPG"
,
30.
f
,
CAP_GSTREAMER
),
makeParam
(
"avi"
,
"H264"
,
30.
f
,
CAP_GSTREAMER
),
makeParam
(
"mkv"
,
"XVID"
,
30.
f
,
CAP_GSTREAMER
),
//
makeParam("mkv", "XVID", 30.f, CAP_GSTREAMER),
makeParam
(
"mkv"
,
"MPEG"
,
30.
f
,
CAP_GSTREAMER
),
makeParam
(
"mkv"
,
"MJPG"
,
30.
f
,
CAP_GSTREAMER
),
...
...
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