Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Video AG Infrastruktur
ffworker
Commits
e1fac6aa
Commit
e1fac6aa
authored
Oct 29, 2017
by
Julian Rother
Browse files
remux: Copy old metadata dicts
parent
41a786b8
Changes
1
Hide whitespace changes
Inline
Side-by-side
remux.c
View file @
e1fac6aa
...
@@ -60,19 +60,19 @@ int main(int argc, char *argv[])
...
@@ -60,19 +60,19 @@ int main(int argc, char *argv[])
goto
fail
;
goto
fail
;
avformat_find_stream_info
(
demux
,
0
);
avformat_find_stream_info
(
demux
,
0
);
avformat_alloc_output_context2
(
&
mux
,
0
,
0
,
path
);
avformat_alloc_output_context2
(
&
mux
,
0
,
0
,
path
);
av_dict_copy
(
&
mux
->
metadata
,
demux
->
metadata
,
0
);
parse_dict
(
&
mux
->
metadata
,
jlookup
(
argv
[
4
],
"metadata"
));
parse_dict
(
&
mux
->
metadata
,
jlookup
(
argv
[
4
],
"metadata"
));
parse_chapters
(
mux
,
jlookup
(
argv
[
4
],
"chapters"
),
av_rescale_q
(
demux
->
duration
,
AV_TIME_BASE_Q
,
chapter_time_base
));
parse_chapters
(
mux
,
jlookup
(
argv
[
4
],
"chapters"
),
av_rescale_q
(
demux
->
duration
,
AV_TIME_BASE_Q
,
chapter_time_base
));
idxmap
=
malloc
(
sizeof
(
int
)
*
demux
->
nb_streams
);
idxmap
=
malloc
(
sizeof
(
int
)
*
demux
->
nb_streams
);
for
(
i
=
0
;
i
<
demux
->
nb_streams
;
i
++
)
for
(
i
=
0
;
i
<
demux
->
nb_streams
;
i
++
)
{
{
idxmap
[
i
]
=
-
1
;
if
(
demux
->
streams
[
i
]
->
codecpar
->
codec_type
!=
AVMEDIA_TYPE_AUDIO
if
(
demux
->
streams
[
i
]
->
codecpar
->
codec_type
!=
AVMEDIA_TYPE_AUDIO
&&
demux
->
streams
[
i
]
->
codecpar
->
codec_type
!=
AVMEDIA_TYPE_VIDEO
&&
demux
->
streams
[
i
]
->
codecpar
->
codec_type
!=
AVMEDIA_TYPE_VIDEO
&&
demux
->
streams
[
i
]
->
codecpar
->
codec_type
!=
AVMEDIA_TYPE_SUBTITLE
)
&&
demux
->
streams
[
i
]
->
codecpar
->
codec_type
!=
AVMEDIA_TYPE_SUBTITLE
)
{
idxmap
[
i
]
=
-
1
;
continue
;
continue
;
}
stream
=
avformat_new_stream
(
mux
,
0
);
stream
=
avformat_new_stream
(
mux
,
0
);
av_dict_copy
(
&
stream
->
metadata
,
mux
->
streams
[
i
]
->
metadata
,
0
);
idxmap
[
i
]
=
stream
->
index
;
idxmap
[
i
]
=
stream
->
index
;
avcodec_parameters_copy
(
mux
->
streams
[
i
]
->
codecpar
,
avcodec_parameters_copy
(
mux
->
streams
[
i
]
->
codecpar
,
demux
->
streams
[
i
]
->
codecpar
);
demux
->
streams
[
i
]
->
codecpar
);
...
...
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