If this site goes down it is because of the crappy DreamHost web hosting: They will disable your "unlimited traffic" web server if a single bot hammers the site with a moderate load.  If necessary, an alternate ExifTool forum page is available at

Main Menu

Include original directory name into new directory and file name (iPhone)

Started by rdmitre, May 04, 2021, 12:46:14 AM

Previous topic - Next topic


I have an iPhone and a lot of movie files (MOV files) sorted in folder as:
/home/Qnap/..../original folder 1/img001.MOV
/home/Qnap/..../original folder 1/img002.MOV
/home/Qnap/..../original folder 2/img07.MOV
/home/Qnap/..../original folder n/img00001.MOV
/home/Qnap/..../original folder n/img001.MOV

I want to rename my files as:
/home/Qnap/.../Year/month/Year-month-date_original folder name/year-month-date_hour.minutes.seconds_original folder name.MOV

I have the next code that work for a similar case but i can't obtain what i want to do:
exiftool -r -ee -api QuickTimeUTC -ext mov -d "/home/Qnap/Multimedia/Fotos_y_Videos_Familiares/Videos\ Familiares/%Y/%m/%Y-%m-%d/%Y-%m-%d %H.%M.%S%%-c.%%le" "-filename<CreateDate" -if '($Directory eq "/home/Qnap/Public/Fotos_y_Videos_a_Ordenar")' /home/Qnap/Public/Fotos_y_Videos_a_Ordenar

Could you help me?
For example if i have a file:
/home/Qnap/Christmas 2020/Original File Name 1.MOV
/home/Qnap/Christmas 2020/Original File Name 2.MOV
/home/Qnap/Christmas 2020/Original File Name 3.MOV

I want to get:
/home/Qnap/Classified/2020/12/2020_12_24_Christmas 2020/2020_12_24_19.30.25_Christmas 2020.MOV
/home/Qnap/Classified/2020/12/2020_12_24_Christmas 2020/2020_12_24_19.30.25_1_Christmas 2020.MOV
/home/Qnap/Classified/2020/12/2020_12_24_Christmas 2020/2020_12_24_19.30.25_2_Christmas 2020.MOV