Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
580fa76c
Commit
580fa76c
authored
May 10, 2011
by
Baptiste Coudurier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allocate per codec options, now that options are freed between inputs and outputs.
parent
3732c483
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
8 deletions
+15
-8
cmdutils.c
cmdutils.c
+1
-1
libx264.c
libavcodec/libx264.c
+14
-7
No files found.
cmdutils.c
View file @
580fa76c
...
@@ -435,7 +435,7 @@ void set_context_opts(void *ctx, void *opts_ctx, int flags, AVCodec *codec)
...
@@ -435,7 +435,7 @@ void set_context_opts(void *ctx, void *opts_ctx, int flags, AVCodec *codec)
const
char
*
str
;
const
char
*
str
;
if
(
priv_ctx
)
{
if
(
priv_ctx
)
{
if
(
av_find_opt
(
priv_ctx
,
opt_names
[
i
],
NULL
,
flags
,
flags
))
{
if
(
av_find_opt
(
priv_ctx
,
opt_names
[
i
],
NULL
,
flags
,
flags
))
{
if
(
av_set_string3
(
priv_ctx
,
opt_names
[
i
],
opt_values
[
i
],
0
,
NULL
)
<
0
)
{
if
(
av_set_string3
(
priv_ctx
,
opt_names
[
i
],
opt_values
[
i
],
1
,
NULL
)
<
0
)
{
fprintf
(
stderr
,
"Invalid value '%s' for option '%s'
\n
"
,
fprintf
(
stderr
,
"Invalid value '%s' for option '%s'
\n
"
,
opt_names
[
i
],
opt_values
[
i
]);
opt_names
[
i
],
opt_values
[
i
]);
exit
(
1
);
exit
(
1
);
...
...
libavcodec/libx264.c
View file @
580fa76c
...
@@ -35,13 +35,13 @@ typedef struct X264Context {
...
@@ -35,13 +35,13 @@ typedef struct X264Context {
uint8_t
*
sei
;
uint8_t
*
sei
;
int
sei_size
;
int
sei_size
;
AVFrame
out_pic
;
AVFrame
out_pic
;
c
onst
c
har
*
preset
;
char
*
preset
;
c
onst
c
har
*
tune
;
char
*
tune
;
c
onst
c
har
*
profile
;
char
*
profile
;
c
onst
c
har
*
level
;
char
*
level
;
int
fastfirstpass
;
int
fastfirstpass
;
c
onst
c
har
*
stats
;
char
*
stats
;
c
onst
c
har
*
weightp
;
char
*
weightp
;
}
X264Context
;
}
X264Context
;
static
void
X264_log
(
void
*
p
,
int
level
,
const
char
*
fmt
,
va_list
args
)
static
void
X264_log
(
void
*
p
,
int
level
,
const
char
*
fmt
,
va_list
args
)
...
@@ -163,6 +163,13 @@ static av_cold int X264_close(AVCodecContext *avctx)
...
@@ -163,6 +163,13 @@ static av_cold int X264_close(AVCodecContext *avctx)
if
(
x4
->
enc
)
if
(
x4
->
enc
)
x264_encoder_close
(
x4
->
enc
);
x264_encoder_close
(
x4
->
enc
);
av_free
(
x4
->
preset
);
av_free
(
x4
->
tune
);
av_free
(
x4
->
profile
);
av_free
(
x4
->
level
);
av_free
(
x4
->
stats
);
av_free
(
x4
->
weightp
);
return
0
;
return
0
;
}
}
...
@@ -185,7 +192,7 @@ static void check_default_settings(AVCodecContext *avctx)
...
@@ -185,7 +192,7 @@ static void check_default_settings(AVCodecContext *avctx)
score
+=
x4
->
params
.
analyse
.
inter
==
0
&&
x4
->
params
.
analyse
.
i_subpel_refine
==
8
;
score
+=
x4
->
params
.
analyse
.
inter
==
0
&&
x4
->
params
.
analyse
.
i_subpel_refine
==
8
;
if
(
score
>=
5
)
{
if
(
score
>=
5
)
{
av_log
(
avctx
,
AV_LOG_ERROR
,
"Default settings detected, using medium profile
\n
"
);
av_log
(
avctx
,
AV_LOG_ERROR
,
"Default settings detected, using medium profile
\n
"
);
x4
->
preset
=
"medium"
;
x4
->
preset
=
av_strdup
(
"medium"
)
;
if
(
avctx
->
bit_rate
==
200
*
100
)
if
(
avctx
->
bit_rate
==
200
*
100
)
avctx
->
crf
=
23
;
avctx
->
crf
=
23
;
}
}
...
...
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