Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
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
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
86a2123a
Commit
86a2123a
authored
Nov 26, 2021
by
Limin Wang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avfilter/src_movie: add format_opts for the opened file
Signed-off-by:
Limin Wang
<
lance.lmwang@gmail.com
>
parent
0d924d6e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
filters.texi
doc/filters.texi
+9
-0
src_movie.c
libavfilter/src_movie.c
+3
-1
No files found.
doc/filters.texi
View file @
86a2123a
...
...
@@ -28395,6 +28395,15 @@ timestamps.
@item dec_threads
Specifies the number of threads for decoding
@item format_opts
Specify format options for the opened file. Format options can be specified
as a list of @var{key}=@var{value} pairs separated by ':'. The following example
shows how to add protocol_whitelist and protocol_blacklist options:
@example
ffplay -f lavfi
"movie=filename='1.sdp':format_opts='protocol_whitelist=file,rtp,udp\:protocol_blacklist=http'"
@end example
@end table
It allows overlaying a second video on top of the main input of
...
...
libavfilter/src_movie.c
View file @
86a2123a
...
...
@@ -74,6 +74,7 @@ typedef struct MovieContext {
int
max_stream_index
;
/**< max stream # actually used for output */
MovieStream
*
st
;
/**< array of all streams, one per output */
int
*
out_index
;
/**< stream number -> output number map, or -1 */
AVDictionary
*
format_opts
;
}
MovieContext
;
#define OFFSET(x) offsetof(MovieContext, x)
...
...
@@ -92,6 +93,7 @@ static const AVOption movie_options[]= {
{
"loop"
,
"set loop count"
,
OFFSET
(
loop_count
),
AV_OPT_TYPE_INT
,
{.
i64
=
1
},
0
,
INT_MAX
,
FLAGS
},
{
"discontinuity"
,
"set discontinuity threshold"
,
OFFSET
(
discontinuity_threshold
),
AV_OPT_TYPE_DURATION
,
{.
i64
=
0
},
0
,
INT64_MAX
,
FLAGS
},
{
"dec_threads"
,
"set the number of threads for decoding"
,
OFFSET
(
dec_threads
),
AV_OPT_TYPE_INT
,
{.
i64
=
0
},
0
,
INT_MAX
,
FLAGS
},
{
"format_opts"
,
"set format options for the opened file"
,
OFFSET
(
format_opts
),
AV_OPT_TYPE_DICT
,
{.
str
=
NULL
},
0
,
0
,
FLAGS
},
{
NULL
},
};
...
...
@@ -243,7 +245,7 @@ static av_cold int movie_common_init(AVFilterContext *ctx)
iformat
=
movie
->
format_name
?
av_find_input_format
(
movie
->
format_name
)
:
NULL
;
movie
->
format_ctx
=
NULL
;
if
((
ret
=
avformat_open_input
(
&
movie
->
format_ctx
,
movie
->
file_name
,
iformat
,
NULL
))
<
0
)
{
if
((
ret
=
avformat_open_input
(
&
movie
->
format_ctx
,
movie
->
file_name
,
iformat
,
&
movie
->
format_opts
))
<
0
)
{
av_log
(
ctx
,
AV_LOG_ERROR
,
"Failed to avformat_open_input '%s'
\n
"
,
movie
->
file_name
);
return
ret
;
...
...
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