[FFmpeg-devel] [PATCH 2/2] flvdec: Add an option for exporting unknown metadata packets as opaque data

Martin Storsjö martin at martin.st
Sun Oct 28 23:07:22 EET 2018


On Sun, 28 Oct 2018, Michael Niedermayer wrote:

> On Sat, Oct 27, 2018 at 09:22:18PM +0300, Martin Storsjö wrote:
>> On Sat, 27 Oct 2018, Michael Niedermayer wrote:
>>
>>> On Thu, Oct 25, 2018 at 03:59:17PM +0300, Martin Storsjö wrote:
>>>> ---
>>>> libavformat/flv.h    |  1 +
>>>> libavformat/flvdec.c | 21 +++++++++++++++++----
>>>> 2 files changed, 18 insertions(+), 4 deletions(-)
>>>
>>> [...]
>>>> @@ -1290,6 +1302,7 @@ static const AVOption options[] = {
>>>>     { "flv_full_metadata", "Dump full metadata of the onMetadata", OFFSET(dump_full_metadata), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
>>>>     { "flv_ignore_prevtag", "Ignore the Size of previous tag", OFFSET(trust_datasize), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
>>>>     { "missing_streams", "", OFFSET(missing_streams), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 0xFF, VD | AV_OPT_FLAG_EXPORT | AV_OPT_FLAG_READONLY },
>>>> +    { "export_opaque_meta", "", OFFSET(export_opaque_meta), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, VD },
>>>>     { NULL }
>>>
>>> I think this together with doc/demuxers.texi (which doesnt document this)
>>> is not enough to use this option by a user
>>
>> Oh right, I had forgotten to actually write something here.
>>
>>> also why is this conditional ? is there a disadvantage of always
>>> exporting this ?
>>
>> Not sure - I thought it'd be less behaviour change and less risk of
>> potentially confusing packets for unsuspecting users by not doing it by
>> default. But as any normal flv stream doesn't contain any such packets, it
>> might be fine to just expose them all the time.
>
> I dont know enough about these to have an oppinion ...
>
> but I just realized another aspect. How do these packets interact with
> flvenc ?
> Should they be preserved by default ? because if so then they would need
> to be exported by default

I guess it depends on what the packets actually are - as it can be 
anything, it's pretty much up to the application what treatment they want 
for them. flvenc right now does write them out properly afaik (a data 
track with codec type AV_CODEC_ID_NONE gets copied straight through into 
FLV_TAG_TYPE_META packets). I guess the sensible default would be to copy 
them, so I guess I'll amend the patch to always export them.

// Martin


More information about the ffmpeg-devel mailing list