Manipulate frame metadata.
This filter accepts the following options:
- mode
-
Set mode of operation of the filter.
Can be one of the following:
- select
-
If both
valueandkeyis set, select frames which have such metadata. If onlykeyis set, select every frame that has such key in metadata. - add
-
Add new metadata
keyandvalue. If key is already available do nothing. - modify
-
Modify value of already present key.
- delete
-
If
valueis set, delete only keys that have such value. Otherwise, delete key. Ifkeyis not set, delete all metadata values in the frame. -
Print key and its value if metadata was found. If
keyis not set print all metadata values available in frame.
- key
-
Set key used with all modes. Must be set for all modes except
printanddelete. - value
-
Set metadata value which will be used. This option is mandatory for
modifyandaddmode. - function
-
Which function to use when comparing metadata value and
value.Can be one of following:
- same_str
-
Values are interpreted as strings, returns true if metadata value is same as
value. - starts_with
-
Values are interpreted as strings, returns true if metadata value starts with the
valueoption string. - less
-
Values are interpreted as floats, returns true if metadata value is less than
value. - equal
-
Values are interpreted as floats, returns true if
valueis equal with metadata value. - greater
-
Values are interpreted as floats, returns true if metadata value is greater than
value. - expr
-
Values are interpreted as floats, returns true if expression from option
exprevaluates to true.
- expr
-
Set expression which is used when
functionis set toexpr. The expression is evaluated through the eval API and can contain the following constants:- VALUE1
-
Float representation of
valuefrom metadata key. - VALUE2
-
Float representation of
valueas supplied by user invalueoption.
- file
-
If specified in
printmode, output is written to the named file. Instead of plain filename any writable url can be specified. Filename “-” is a shorthand for standard output. Iffileoption is not set, output is written to the log with AV_LOG_INFO loglevel.
Examples
-
Print all metadata values for frames with key
lavfi.signalstats.YDIFwith values between 0 and 1.signalstats,metadata=print:key=lavfi.signalstats.YDIF:value=0:function=expr:expr='between(VALUE1,0,1)'
-
Print silencedetect output to file metadata.txt.
silencedetect,ametadata=mode=print:file=metadata.txt
-
Direct all metadata to a pipe with file descriptor 4.
metadata=mode=print:file='pipe\:4'