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
fcde059c
Commit
fcde059c
authored
Mar 05, 2013
by
cuda-geek
Committed by
OpenCV Buildbot
Mar 05, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #618 from caotto:master
parents
c0ba0c90
c02f9439
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
0 deletions
+23
-0
cap_ffmpeg_impl.hpp
modules/highgui/src/cap_ffmpeg_impl.hpp
+23
-0
No files found.
modules/highgui/src/cap_ffmpeg_impl.hpp
View file @
fcde059c
...
...
@@ -59,6 +59,7 @@ extern "C" {
#include "ffmpeg_codecs.hpp"
#include <libavutil/opt.h>
#include <libavutil/mathematics.h>
#ifdef WIN32
...
...
@@ -1114,6 +1115,14 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc,
c
->
codec_type
=
AVMEDIA_TYPE_VIDEO
;
#if LIBAVCODEC_BUILD >= CALC_FFMPEG_VERSION(54,25,0)
// Set per-codec defaults
AVCodecID
c_id
=
c
->
codec_id
;
avcodec_get_context_defaults3
(
c
,
codec
);
// avcodec_get_context_defaults3 erases codec_id for some reason
c
->
codec_id
=
c_id
;
#endif
/* put sample parameters */
int64_t
lbit_rate
=
(
int64_t
)
bitrate
;
lbit_rate
+=
(
bitrate
/
2
);
...
...
@@ -1176,6 +1185,20 @@ static AVStream *icv_add_video_stream_FFMPEG(AVFormatContext *oc,
/* avoid FFMPEG warning 'clipping 1 dct coefficients...' */
c
->
mb_decision
=
2
;
}
#if LIBAVUTIL_BUILD > CALC_FFMPEG_VERSION(51,11,0)
/* Some settings for libx264 encoding, restore dummy values for gop_size
and qmin since they will be set to reasonable defaults by the libx264
preset system. Also, use a crf encode with the default quality rating,
this seems easier than finding an appropriate default bitrate. */
if
(
c
->
codec_id
==
CODEC_ID_H264
)
{
c
->
gop_size
=
-
1
;
c
->
qmin
=
-
1
;
c
->
bit_rate
=
0
;
av_opt_set
(
c
->
priv_data
,
"crf"
,
"23"
,
0
);
}
#endif
#if LIBAVCODEC_VERSION_INT>0x000409
// some formats want stream headers to be seperate
if
(
oc
->
oformat
->
flags
&
AVFMT_GLOBALHEADER
)
...
...
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