sigal
sigal copied to clipboard
Sort videos according to their date
Currently, it seems as if videos are not sorted according to the metadata they carry. In my case, all videos show up at the very end. Probably because the filenames start with "VID_". The mp4 container I am using does have an "Encoded date" property, according to mediainfo
. I guess I expected sigal to sort images and videos according to their creation time, which it currently does not do.
Currently only the EXIF metadata are used (so for jpeg files). I don't know if and how it is possible to read metadata from video files ?
I don't know how the mediainfo program does it, but it shows the metadata. I guess a fallback could be the ctime (or mtime) of the video.
Right now it seems to be sorted by name. Maybe it makes sense to have a hierarchy of sorting criteria.
Looking at exiftool, it can retrieve information for video files as well. Maybe we shall consider switching to that?
https://sno.phy.queensu.ca/~phil/exiftool/
Maybe not switching, as I prefer to preserve the easy installation with pure Python libraries etc., but we could have an exiftool plugin which use exiftool if available to get the metadata on videos.
Fot future reference: it seems like currently videos are sorted by their date reported by os.stat
if medias_sort_attr
is set to date
. (it wasn't the case in v1.3.0 at least)
Maybe not switching, as I prefer to preserve the easy installation with pure Python libraries etc., but we could have an exiftool plugin which use exiftool if available to get the metadata on videos.
Any progress on this? I may be interested in writing the plugin, if it doesn't exist yet.
No news to my knowledge, so it's great if you are interested! Maybe worth having a look at the available libraries to get the metadata, for instance there is now https://github.com/sbraz/pymediainfo/. We could imagine having several optional dependencies to get the metadata for the various file types.