Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
F
ffmpeg
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
ffmpeg
Commits
3e0b29cc
Commit
3e0b29cc
authored
Oct 16, 2012
by
Michael Niedermayer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ffmpeg: Make video filter graph reinit user selectable
Signed-off-by:
Michael Niedermayer
<
michaelni@gmx.at
>
parent
a07e9d72
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
2 deletions
+12
-2
ffmpeg.c
ffmpeg.c
+3
-2
ffmpeg.h
ffmpeg.h
+4
-0
ffmpeg_opt.c
ffmpeg_opt.c
+5
-0
No files found.
ffmpeg.c
View file @
3e0b29cc
...
@@ -1610,12 +1610,13 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
...
@@ -1610,12 +1610,13 @@ static int decode_video(InputStream *ist, AVPacket *pkt, int *got_output)
ist
->
resample_height
=
decoded_frame
->
height
;
ist
->
resample_height
=
decoded_frame
->
height
;
ist
->
resample_pix_fmt
=
decoded_frame
->
format
;
ist
->
resample_pix_fmt
=
decoded_frame
->
format
;
for
(
i
=
0
;
i
<
nb_filtergraphs
;
i
++
)
for
(
i
=
0
;
i
<
nb_filtergraphs
;
i
++
)
{
if
(
ist_in_filtergraph
(
filtergraphs
[
i
],
ist
)
&&
if
(
ist_in_filtergraph
(
filtergraphs
[
i
],
ist
)
&&
ist
->
reinit_filters
&&
configure_filtergraph
(
filtergraphs
[
i
])
<
0
)
{
configure_filtergraph
(
filtergraphs
[
i
])
<
0
)
{
av_log
(
NULL
,
AV_LOG_FATAL
,
"Error reinitializing filters!
\n
"
);
av_log
(
NULL
,
AV_LOG_FATAL
,
"Error reinitializing filters!
\n
"
);
exit
(
1
);
exit
(
1
);
}
}
}
}
}
frame_sample_aspect
=
av_opt_ptr
(
avcodec_get_frame_class
(),
decoded_frame
,
"sample_aspect_ratio"
);
frame_sample_aspect
=
av_opt_ptr
(
avcodec_get_frame_class
(),
decoded_frame
,
"sample_aspect_ratio"
);
...
...
ffmpeg.h
View file @
3e0b29cc
...
@@ -161,6 +161,8 @@ typedef struct OptionsContext {
...
@@ -161,6 +161,8 @@ typedef struct OptionsContext {
int
nb_copy_prior_start
;
int
nb_copy_prior_start
;
SpecifierOpt
*
filters
;
SpecifierOpt
*
filters
;
int
nb_filters
;
int
nb_filters
;
SpecifierOpt
*
reinit_filters
;
int
nb_reinit_filters
;
SpecifierOpt
*
fix_sub_duration
;
SpecifierOpt
*
fix_sub_duration
;
int
nb_fix_sub_duration
;
int
nb_fix_sub_duration
;
SpecifierOpt
*
pass
;
SpecifierOpt
*
pass
;
...
@@ -253,6 +255,8 @@ typedef struct InputStream {
...
@@ -253,6 +255,8 @@ typedef struct InputStream {
* currently video and audio only */
* currently video and audio only */
InputFilter
**
filters
;
InputFilter
**
filters
;
int
nb_filters
;
int
nb_filters
;
int
reinit_filters
;
}
InputStream
;
}
InputStream
;
typedef
struct
InputFile
{
typedef
struct
InputFile
{
...
...
ffmpeg_opt.c
View file @
3e0b29cc
...
@@ -579,6 +579,9 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
...
@@ -579,6 +579,9 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
ist
->
dec
=
choose_decoder
(
o
,
ic
,
st
);
ist
->
dec
=
choose_decoder
(
o
,
ic
,
st
);
ist
->
reinit_filters
=
-
1
;
MATCH_PER_STREAM_OPT
(
reinit_filters
,
i
,
ist
->
reinit_filters
,
ic
,
st
);
switch
(
dec
->
codec_type
)
{
switch
(
dec
->
codec_type
)
{
case
AVMEDIA_TYPE_VIDEO
:
case
AVMEDIA_TYPE_VIDEO
:
if
(
!
ist
->
dec
)
if
(
!
ist
->
dec
)
...
@@ -2341,6 +2344,8 @@ const OptionDef options[] = {
...
@@ -2341,6 +2344,8 @@ const OptionDef options[] = {
"set profile"
,
"profile"
},
"set profile"
,
"profile"
},
{
"filter"
,
HAS_ARG
|
OPT_STRING
|
OPT_SPEC
,
{
.
off
=
OFFSET
(
filters
)
},
{
"filter"
,
HAS_ARG
|
OPT_STRING
|
OPT_SPEC
,
{
.
off
=
OFFSET
(
filters
)
},
"set stream filterchain"
,
"filter_list"
},
"set stream filterchain"
,
"filter_list"
},
{
"reinit_filter"
,
HAS_ARG
|
OPT_INT
|
OPT_SPEC
,
{
.
off
=
OFFSET
(
reinit_filters
)
},
"reinit filtergraph on input parameter changes"
,
""
},
{
"filter_complex"
,
HAS_ARG
|
OPT_EXPERT
,
{
.
func_arg
=
opt_filter_complex
},
{
"filter_complex"
,
HAS_ARG
|
OPT_EXPERT
,
{
.
func_arg
=
opt_filter_complex
},
"create a complex filtergraph"
,
"graph_description"
},
"create a complex filtergraph"
,
"graph_description"
},
{
"stats"
,
OPT_BOOL
,
{
&
print_stats
},
{
"stats"
,
OPT_BOOL
,
{
&
print_stats
},
...
...
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