Commit e1fac6aa authored by Julian Rother's avatar Julian Rother

remux: Copy old metadata dicts

parent 41a786b8
......@@ -60,19 +60,19 @@ int main(int argc, char *argv[])
goto fail;
avformat_find_stream_info(demux, 0);
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_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);
for (i = 0; i < demux->nb_streams; i ++)
{
idxmap[i] = -1;
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_SUBTITLE)
{
idxmap[i] = -1;
continue;
}
stream = avformat_new_stream(mux, 0);
av_dict_copy(&stream->metadata, mux->streams[i]->metadata, 0);
idxmap[i] = stream->index;
avcodec_parameters_copy(mux->streams[i]->codecpar,
demux->streams[i]->codecpar);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment