Sorting videos by the date created

Ask for help and post your question on how to use XnView MP.

Moderators: helmut, XnTriq, xnview

Post Reply
PeterM
Posts: 17
Joined: Thu Jan 24, 2019 9:49 am

Sorting videos by the date created

Post by PeterM »

This was asked multiple times, but always without a working solution: So in case the things have changed, I'm asking it again.

I have pictures and videos in the same folder. In Browser, the sorting is by "EXIF Date taken". This works fine for pictures, but not for videos. I understand, videos have no such EXIF data.

I found that in some situations, the video file creation date is used instead. Sometimes, a manual setting

Code: Select all

useFileDateWhenNoExif=1
is needed (I'm not sure if it's still true).

In my case, this doesn't work and the videos are always displayed before pictures. Moreover, the file date is completely irrelevant anyway. In my case, I sync the files with cloud and the file creation dates correspond to the time the file was downloaded to my PC, not to when the video was created.

Is there any way to solve it?

If not, can you implement a simple fallback mechanism for video creation date? The info is there and XnView MP can read it. The mp4 files from my cheap Samsung phone contain it on several places:
mp4_info1.png
and
mp4_info2.png
So instead of assuming an empty "EXIF Date taken" for video files, you can check the metadata above until the first one is found and use this value. (Note, it's in UTC, so the current time offset needs to be added). This way, we could perform various operations with the video files that require the date taken, such as: sorting, batch rename, thumbnail labels and tooltips, etc.
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Sorting videos by the date created

Post by xnview »

if file doesn't have EXIF file date, file's modified date is used
Pierre.
PeterM
Posts: 17
Joined: Thu Jan 24, 2019 9:49 am

Re: Sorting videos by the date created

Post by PeterM »

xnview wrote: Wed Jun 28, 2023 8:40 am if file doesn't have EXIF file date, file's modified date is used
This is true, but only if useFileDateWhenNoExif=1 was manually added in the xnview.ini file, which 99% of users is not aware of or don't know how to do it.

But more importantly, the file's modified date has almost no real value. If I download my 3 years old video files from my phone (or from a cloud storage) to my PC, the file's modified date is today. It would be better to use a smarter mechanism instead. For example, have a flag (ideally in UI for the less tech-savvy users):

Code: Select all

useOtherMetadataForDateWhenNoExif
which would first search (in videos) "Encoded date". If not found, then "Quicktime: Create Date" and possibly others. And only if none of these were found, the file's modified date would be used as the last resort.
User avatar
xnview
Author of XnView
Posts: 46236
Joined: Mon Oct 13, 2003 7:31 am
Location: France
Contact:

Re: Sorting videos by the date created

Post by xnview »

PeterM wrote: Wed Jun 28, 2023 9:07 am
xnview wrote: Wed Jun 28, 2023 8:40 am if file doesn't have EXIF file date, file's modified date is used
This is true, but only if useFileDateWhenNoExif=1 was manually added in the xnview.ini file, which 99% of users is not aware of or don't know how to do it.
So you mean that it will be by default?
But more importantly, the file's modified date has almost no real value. If I download my 3 years old video files from my phone (or from a cloud storage) to my PC, the file's modified date is today. It would be better to use a smarter mechanism instead. For example, have a flag (ideally in UI for the less tech-savvy users):

Code: Select all

useOtherMetadataForDateWhenNoExif
which would first search (in videos) "Encoded date". If not found, then "Quicktime: Create Date" and possibly others. And only if none of these were found, the file's modified date would be used as the last resort.
yes but currently not possible...
Pierre.
PeterM
Posts: 17
Joined: Thu Jan 24, 2019 9:49 am

Re: Sorting videos by the date created

Post by PeterM »

xnview wrote: Wed Jun 28, 2023 9:38 am
PeterM wrote: Wed Jun 28, 2023 9:07 am
This is true, but only if useFileDateWhenNoExif=1 was manually added in the xnview.ini file, which 99% of users is not aware of or don't know how to do it.
So you mean that it will be by default?
I think it's not necessary. Perhaps the people, are used to see the videos at the beginning of the list and not in a potentially random order taken from quite random file dates.

As I understand it from my tests, the "useFileDateWhenNoExif" flag is used only for sorting in Browser. It's not used instead of EXIF:DateTaken anywhere else, such as in batch rename, thumbnail label, etc. So, not a big deal.
Post Reply