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
85d7e02e
Commit
85d7e02e
authored
Jan 08, 2015
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: allow overriding and amending AVStream->disposition
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
a1062e14
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
0 deletions
+41
-0
ffmpeg.c
ffmpeg.c
+32
-0
ffmpeg.h
ffmpeg.h
+3
-0
ffmpeg_opt.c
ffmpeg_opt.c
+6
-0
No files found.
ffmpeg.c
View file @
85d7e02e
...
@@ -2968,6 +2968,37 @@ static int transcode_init(void)
...
@@ -2968,6 +2968,37 @@ static int transcode_init(void)
}
}
}
}
}
}
if
(
ost
->
disposition
)
{
static
const
AVOption
opts
[]
=
{
{
"disposition"
,
NULL
,
0
,
AV_OPT_TYPE_FLAGS
,
{
.
i64
=
0
},
INT64_MIN
,
INT64_MAX
,
.
unit
=
"flags"
},
{
"default"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
AV_DISPOSITION_DEFAULT
},
.
unit
=
"flags"
},
{
"dub"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
AV_DISPOSITION_DUB
},
.
unit
=
"flags"
},
{
"original"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
AV_DISPOSITION_ORIGINAL
},
.
unit
=
"flags"
},
{
"comment"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
AV_DISPOSITION_COMMENT
},
.
unit
=
"flags"
},
{
"lyrics"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
AV_DISPOSITION_LYRICS
},
.
unit
=
"flags"
},
{
"karaoke"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
AV_DISPOSITION_KARAOKE
},
.
unit
=
"flags"
},
{
"forced"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
AV_DISPOSITION_FORCED
},
.
unit
=
"flags"
},
{
"hearing_impaired"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
AV_DISPOSITION_HEARING_IMPAIRED
},
.
unit
=
"flags"
},
{
"visual_impaired"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
AV_DISPOSITION_VISUAL_IMPAIRED
},
.
unit
=
"flags"
},
{
"clean_effects"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
AV_DISPOSITION_CLEAN_EFFECTS
},
.
unit
=
"flags"
},
{
"captions"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
AV_DISPOSITION_CAPTIONS
},
.
unit
=
"flags"
},
{
"descriptions"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
AV_DISPOSITION_DESCRIPTIONS
},
.
unit
=
"flags"
},
{
"metadata"
,
NULL
,
0
,
AV_OPT_TYPE_CONST
,
{
.
i64
=
AV_DISPOSITION_METADATA
},
.
unit
=
"flags"
},
{
NULL
},
};
static
const
AVClass
class
=
{
.
class_name
=
""
,
.
item_name
=
av_default_item_name
,
.
option
=
opts
,
.
version
=
LIBAVUTIL_VERSION_INT
,
};
const
AVClass
*
pclass
=
&
class
;
ret
=
av_opt_eval_flags
(
&
pclass
,
&
opts
[
0
],
ost
->
disposition
,
&
ost
->
st
->
disposition
);
if
(
ret
<
0
)
goto
dump_format
;
}
}
}
/* open each encoder */
/* open each encoder */
...
@@ -3879,6 +3910,7 @@ static int transcode(void)
...
@@ -3879,6 +3910,7 @@ static int transcode(void)
}
}
av_freep
(
&
ost
->
forced_kf_pts
);
av_freep
(
&
ost
->
forced_kf_pts
);
av_freep
(
&
ost
->
apad
);
av_freep
(
&
ost
->
apad
);
av_freep
(
&
ost
->
disposition
);
av_dict_free
(
&
ost
->
encoder_opts
);
av_dict_free
(
&
ost
->
encoder_opts
);
av_dict_free
(
&
ost
->
swr_opts
);
av_dict_free
(
&
ost
->
swr_opts
);
av_dict_free
(
&
ost
->
resample_opts
);
av_dict_free
(
&
ost
->
resample_opts
);
...
...
ffmpeg.h
View file @
85d7e02e
...
@@ -206,6 +206,8 @@ typedef struct OptionsContext {
...
@@ -206,6 +206,8 @@ typedef struct OptionsContext {
int
nb_apad
;
int
nb_apad
;
SpecifierOpt
*
discard
;
SpecifierOpt
*
discard
;
int
nb_discard
;
int
nb_discard
;
SpecifierOpt
*
disposition
;
int
nb_disposition
;
}
OptionsContext
;
}
OptionsContext
;
typedef
struct
InputFilter
{
typedef
struct
InputFilter
{
...
@@ -430,6 +432,7 @@ typedef struct OutputStream {
...
@@ -430,6 +432,7 @@ typedef struct OutputStream {
const
char
*
attachment_filename
;
const
char
*
attachment_filename
;
int
copy_initial_nonkeyframes
;
int
copy_initial_nonkeyframes
;
int
copy_prior_start
;
int
copy_prior_start
;
char
*
disposition
;
int
keep_pix_fmt
;
int
keep_pix_fmt
;
...
...
ffmpeg_opt.c
View file @
85d7e02e
...
@@ -1186,6 +1186,9 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
...
@@ -1186,6 +1186,9 @@ static OutputStream *new_output_stream(OptionsContext *o, AVFormatContext *oc, e
ost
->
enc_ctx
->
global_quality
=
FF_QP2LAMBDA
*
qscale
;
ost
->
enc_ctx
->
global_quality
=
FF_QP2LAMBDA
*
qscale
;
}
}
MATCH_PER_STREAM_OPT
(
disposition
,
str
,
ost
->
disposition
,
oc
,
st
);
ost
->
disposition
=
av_strdup
(
ost
->
disposition
);
if
(
oc
->
oformat
->
flags
&
AVFMT_GLOBALHEADER
)
if
(
oc
->
oformat
->
flags
&
AVFMT_GLOBALHEADER
)
ost
->
enc_ctx
->
flags
|=
CODEC_FLAG_GLOBAL_HEADER
;
ost
->
enc_ctx
->
flags
|=
CODEC_FLAG_GLOBAL_HEADER
;
...
@@ -2937,6 +2940,9 @@ const OptionDef options[] = {
...
@@ -2937,6 +2940,9 @@ const OptionDef options[] = {
{
"discard"
,
OPT_STRING
|
HAS_ARG
|
OPT_SPEC
|
{
"discard"
,
OPT_STRING
|
HAS_ARG
|
OPT_SPEC
|
OPT_INPUT
,
{
.
off
=
OFFSET
(
discard
)
},
OPT_INPUT
,
{
.
off
=
OFFSET
(
discard
)
},
"discard"
,
""
},
"discard"
,
""
},
{
"disposition"
,
OPT_STRING
|
HAS_ARG
|
OPT_SPEC
|
OPT_OUTPUT
,
{
.
off
=
OFFSET
(
disposition
)
},
"disposition"
,
""
},
/* video options */
/* video options */
{
"vframes"
,
OPT_VIDEO
|
HAS_ARG
|
OPT_PERFILE
|
OPT_OUTPUT
,
{
.
func_arg
=
opt_video_frames
},
{
"vframes"
,
OPT_VIDEO
|
HAS_ARG
|
OPT_PERFILE
|
OPT_OUTPUT
,
{
.
func_arg
=
opt_video_frames
},
...
...
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