[FFmpeg-devel] [RFC] lavfi: metadata injection
Clément Bœsch
ubitux at gmail.com
Wed Oct 10 00:55:09 CEST 2012
Hey.
So here is an attempt to introduce some communication between filters, and
allow the users to exploit the results of analysis filters.
[PATCH 1/4] lavfi: add metadata to buffer ref.
This patch is based on https://github.com/kuehnelth/libav/commit/b8e9baf7
I added more dict copy & stuff. Hopefully it is correct, but the code is a
bit convoluted so I'm still unsure if I'm missing or no a corner case.
[PATCH 2/4] lavd: make lavfi device export the metadata up to the
This one is a proposition of raising information from a lavfi input device up
to AVFrame. It abuses the priv field, but it looks like the simpler way to
me. I had a solution making use of side_data, but it was really too much
code. priv seems mostly unused, and we can move to some other system if
necessary in the future.
[PATCH 3/4] lavfi/silencedetect: export silence info to metadata.
First application of the feature. Still lacking documentation, but I'm
waiting for more filters to use it. We should decide on the convention to
follow for the prefix. I selected "lavfi", it can be discussed to whatever
color you prefer.
Example of usage:
% ./ffprobe -v 0 -f lavfi -i amovie=silence.mp3,silencedetect -show_frames -of flat|grep lavfi_silence
frames.frame.207.tags.lavfi_silence_start="3.40735"
frames.frame.259.tags.lavfi_silence_end="3.40735"
frames.frame.259.tags.lavfi_silence_duration="3.35837"
frames.frame.549.tags.lavfi_silence_start="12.3412"
frames.frame.824.tags.lavfi_silence_end="12.3412"
frames.frame.824.tags.lavfi_silence_duration="9.18367"
frames.frame.1299.tags.lavfi_silence_start="31.9331"
frames.frame.1323.tags.lavfi_silence_end="31.9331"
frames.frame.1323.tags.lavfi_silence_duration="2.62694"
frames.frame.1826.tags.lavfi_silence_start="45.6996"
frames.frame.1953.tags.lavfi_silence_end="45.6996"
frames.frame.1953.tags.lavfi_silence_duration="5.31755"
%
[PATCH 4/4] lavfi/select: store scene score in buf ref metadata.
Application with a video filter this time. Somehow interesting if you use
select=gt(scene\,0)
More information about the ffmpeg-devel
mailing list