1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-24 13:56:33 +02:00

lavf/concatdec: add stream_extradata directive

This commit is contained in:
Nicolas George 2021-08-31 19:36:35 +02:00
parent 5b052c4bcb
commit 94aa7e8a76
2 changed files with 14 additions and 0 deletions

View File

@ -184,6 +184,9 @@ Can be present multiple times.
@item @code{stream_codec @var{value}}
Codec for the stream.
@item @code{stream_extradata @var{hex_string}}
Extradata for the string, encoded in hexadecimal.
@item @code{cahpter @var{id} @var{start} @var{end}}
Add a chapter. @var{id} is an unique identifier, possibly small and
consecutive.

View File

@ -432,6 +432,7 @@ typedef enum ParseDirective {
DIR_EXSID,
DIR_STMETA,
DIR_STCODEC,
DIR_STEDATA,
DIR_CHAPTER,
} ParseDirective;
@ -448,6 +449,7 @@ static const ParseSyntax syntax[] = {
[DIR_EXSID ] = { "exact_stream_id", "i", NEEDS_STREAM },
[DIR_STMETA ] = { "stream_meta", "ks", NEEDS_STREAM },
[DIR_STCODEC ] = { "stream_codec", "k", NEEDS_STREAM },
[DIR_STEDATA ] = { "stream_extradata", "k", NEEDS_STREAM },
[DIR_CHAPTER ] = { "chapter", "idd", 0 },
};
@ -612,6 +614,15 @@ static int concat_parse_script(AVFormatContext *avf)
break;
}
case DIR_STEDATA: {
int size = ff_hex_to_data(NULL, arg_kw[0]);
ret = ff_alloc_extradata(stream->codecpar, size);
if (ret < 0)
FAIL(ret);
ff_hex_to_data(stream->codecpar->extradata, arg_kw[0]);
break;
}
case DIR_CHAPTER:
chapter = avpriv_new_chapter(avf, arg_int[0], AV_TIME_BASE_Q,
arg_int[1], arg_int[2], NULL);