[FFmpeg-devel] [PATCH] avformat/image2: Upon request, make available extra metadata, fields related to input path to be used by filters.

Marton Balint cus at passwd.hu
Thu Jan 9 23:39:17 EET 2020



On Sat, 4 Jan 2020, Alexandre Heitor Schmidt wrote:

> Hi there! I'm just writing to make sure this patch wasn't forgotten. :)

Thanks, I think the patch is fine now, I will apply it tomorrow if there 
are no further comments.

Regards,
Marton

>
> Best wishes to you all!
>
> Alex.
>
> On 01/01/2020 17:17, Alexandre Heitor Schmidt wrote:
>> The patch follows attached, to avoid formatting issues. The
>> commit message is as follows:
>>
>> avformat/image2: Upon request, make available extra metadata
>>  fields related to input path to be used by filters.
>>
>> libavformat/img2.h: New field export_path_metadata to
>> VideoDemuxData to only allow the use of the extra metadata
>> upon explicit user request, for security reasons.
>>
>> libavformat/img2dec.c: Modify image2 demuxer to make available
>> two special metadata entries called lavf.image2dec.source_path
>> and lavf.image2dec.source_basename, which represents, respectively,
>> the complete path to the source image for the current frame and
>> the basename i.e. the file name related to the current frame.
>> These can then be used by filters like drawtext and others. The
>> metadata fields will only be available when explicitly enabled
>> with image2 option -export_path_metadata 1.
>>
>> doc/demuxers.texi: Documented the new metadata fields available
>> for image2 and how to use them.
>>
>> doc/filters.texi: Added an example on how to use the new metadata
>> fields with drawtext filter, in order to plot the input file path
>> to each output frame.
>>
>> Usage example:
>>
>> ffmpeg -f image2 -export_path_metadata 1 -pattern_type glob
>>  -framerate 18 -i '/path/to/input/files/*.jpg'
>>  -filter_complex drawtext="fontsize=40:fontcolor=white:
>>  fontfile=FreeSans.ttf:borderw=2:bordercolor=black:
>>  text='%{metadata\:lavf.image2dec.source_basename\:NA}':x=5:y=50"
>>  output.avi
>>
>> Fixes #2874.
>>
>> Signed-off-by: Alexandre Heitor Schmidt <alexandre.schmidt at gmail.com>
>>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".


More information about the ffmpeg-devel mailing list