move clips based on duration

Started by audiogalaxy, May 08, 2018, 09:11:16 PM

Previous topic - Next topic

audiogalaxy

hallo, I'm trying this:

exiftool -filename -duration# -if "$duration# le 5" -ext MOV .

... this is an example but I need to move the file in a directory if the DURATION is LOWER or is GREATER than some values.

lower than 5 seconds or greater than 60 seconds

I've tried to simply move the fiels, setting the -directory value: it works.

But I can't correctly evaluate the duration in seconds.

For example the "exiftool -filename -duration# -if "$duration# le 5" -ext MOV ." command gives me these results:

======== ./20180408_7949.MOV
File Name                       : 20180408_7949.MOV
Duration                        : 14.16
======== ./20180408_7974.MOV
File Name                       : 20180408_7974.MOV
Duration                        : 24.12
======== ./20180408_7982.MOV
File Name                       : 20180408_7982.MOV
Duration                        : 4.24
    1 directories scanned
    3 files failed condition
    3 image files read


so... I have 2 problems:


  • I don't know the correct operators: I read they are "like in perl" ... but I don't know how they are in perl: I know the "IF" operators in windows commandline and this is not the case.
  • I can't evaluate this duration field in seconds ...
--
Sorry for my halting English: I'm not a natural English speaker.
On a PC / windows commandline

StarGeek

le is a string comparison.  You want to use the numeric comparison, <=.

So try
-if "$duration# <= 5"
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

audiogalaxy

Quote from: StarGeek on May 08, 2018, 10:43:43 PM
le is a string comparison.  You want to use the numeric comparison, <=.

So try
-if "$duration# <= 5"

THANKS!!!!!!!  ;D :D ;D :D
--
Sorry for my halting English: I'm not a natural English speaker.
On a PC / windows commandline