#1 2019-06-21 22:30

rebwa1
Member
Registered: 2019-06-21
Posts: 3

File name = name of previous "valid" file in a list - possible?

Hi all,

I have no idea if this is even possible, but I have a set of files following the scheme

P1060108.jpg
P1060109.jpg
P1060110.mp4
P1060111.jpg
P1060112.mp4
P1060113.mp4
P1060114.jpg
P1060115.jpg

etc...

I'd like to rename the files given their EXIF date (for sorting reasons on my NAS). The problem is that the date only exists for the .jpg files.

Thus my idea is to give the .mp4 file the name of the previous .jpg in the list, even though it is not really the correct EXIF date, but I wouldn't mind.

Check this screenshot for an example:
Check this screenshot for an example

In a first step, I could insert the EXIF date for the .jpg's, but then I'm stuck big_smile

I need a rule that says "if EXIF date ist not available, identify previous (already renamed) file name in list and use the corresponding EXIF date/first 19 digits as prefix"


Thanks in advance!!!
rebwa1

Offline

#2 2019-06-21 22:43

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,440

Re: File name = name of previous "valid" file in a list - possible?

Yes, that is doable using a Pascal Script rule:

var
  TagValue: WideString;
  LastTagValue: WideString;

begin
  TagValue := CalculateMetaTagFormat(FilePath, 'EXIF_Date', 'yyyy-mm-dd hh-nn-ss');
  if Length(TagValue) > 0 then
  begin
    FileName := TagValue + ' ' + FileName;
    LastTagValue := TagValue;
  end
  else if Length(LastTagValue) > 0 then
  begin
    FileName := LastTagValue + ' ' + FileName;
  end
end.

However, there is probably a date tag of some kind in your MP4 files. You should try some tag extractor tool, like MediaInfo CLI, and if it can extract a date, then you can use it within a Pascal Script rule. See this example: http://www.den4b.com/wiki/ReNamer:Scripts:MediaInfo

Offline

#3 2019-06-21 22:47

rebwa1
Member
Registered: 2019-06-21
Posts: 3

Re: File name = name of previous "valid" file in a list - possible?

It works genius!!!

Thanks a lot for your super super quick answer and great help!!!

Offline

#4 2019-06-22 08:04

rebwa1
Member
Registered: 2019-06-21
Posts: 3

Re: File name = name of previous "valid" file in a list - possible?

I checked out MediaInfo CLI and created a Pascal Sript Rule - and ReNamer was able to extract the correct "DateCreated" --> EncodedDate from the .mp4 files!!

A huge huge thanks for your help - I'm very happy big_smile

Offline

Board footer

Powered by FluxBB