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
133e9f20
Commit
133e9f20
authored
May 30, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11618 from alalek:ffmpeg_debug_log
parents
5c80763a
83ec0f52
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
1 deletion
+23
-1
cap_ffmpeg_impl.hpp
modules/videoio/src/cap_ffmpeg_impl.hpp
+23
-1
No files found.
modules/videoio/src/cap_ffmpeg_impl.hpp
View file @
133e9f20
...
...
@@ -754,6 +754,17 @@ private:
AutoLock
&
operator
=
(
const
AutoLock
&
);
// disabled
};
static
void
ffmpeg_log_callback
(
void
*
ptr
,
int
level
,
const
char
*
fmt
,
va_list
vargs
)
{
static
bool
skip_header
=
false
;
static
int
prev_level
=
-
1
;
(
void
)
ptr
;
if
(
!
skip_header
||
level
!=
prev_level
)
printf
(
"[OPENCV:FFMPEG:%02d] "
,
level
);
vprintf
(
fmt
,
vargs
);
size_t
fmt_len
=
strlen
(
fmt
);
skip_header
=
fmt_len
>
0
&&
fmt
[
fmt_len
-
1
]
!=
'\n'
;
prev_level
=
level
;
}
class
InternalFFMpegRegister
{
...
...
@@ -773,7 +784,18 @@ public:
/* register a callback function for synchronization */
av_lockmgr_register
(
&
LockCallBack
);
av_log_set_level
(
AV_LOG_ERROR
);
#ifndef NO_GETENV
char
*
debug_option
=
getenv
(
"OPENCV_FFMPEG_DEBUG"
);
if
(
debug_option
!=
NULL
)
{
av_log_set_level
(
AV_LOG_VERBOSE
);
av_log_set_callback
(
ffmpeg_log_callback
);
}
else
#endif
{
av_log_set_level
(
AV_LOG_ERROR
);
}
_initialized
=
true
;
}
...
...
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