sigal icon indicating copy to clipboard operation
sigal copied to clipboard

Sort videos according to their date

Open muelli opened this issue 8 years ago • 8 comments

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.

muelli avatar May 09 '16 07:05 muelli

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 ?

saimn avatar May 11 '16 21:05 saimn

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.

muelli avatar May 12 '16 09:05 muelli

Looking at exiftool, it can retrieve information for video files as well. Maybe we shall consider switching to that?

matelakat avatar Nov 08 '17 20:11 matelakat

https://sno.phy.queensu.ca/~phil/exiftool/

matelakat avatar Nov 08 '17 21:11 matelakat

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.

saimn avatar Nov 08 '17 21:11 saimn

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)

Informatic avatar May 01 '18 10:05 Informatic

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.

defeo avatar Aug 22 '19 17:08 defeo

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.

saimn avatar Aug 22 '19 20:08 saimn