I want to find video files in a directory with a bitrate greater than 20Mbps. The exiftool command is:
$> exiftool -if '${AvgBitrate} ge "20 Mbps"' -AvgBitrate -g1 -s -ext mp4 -r .
======== ./2019/2019-02-08/VID_20190208_191241.mp4
---- Composite ----
AvgBitrate : 9.19 Mbps
======== ./2019/2019-02-09/L1060023.MP4
---- Composite ----
AvgBitrate : 27.3 Mbps
But here the comparison is based on numerical size, which is different from the expected results. How can I compare based on the actual average bitrate size?
The "ge" operator does a string comparison. You need a numerical comparison using the numerical value of the tag (append "#" to the tag name):
exiftool -if '${AvgBitrate#} >= 20' -AvgBitrate -g1 -s -ext mp4 -r .
- Phil
Thank you, it's working now. Can I use Mbps as the unit for numerical comparison?
Oh right. My command would compare with 20 bps. :P
I would do it like this:
exiftool -if '${AvgBitrate#} >= 20000000' ...
- Phil