saimn / sigal

yet another simple static gallery generator
http://sigal.saimon.org/
MIT License
880 stars 169 forks source link

Sort videos according to their date #208

Open muelli opened 8 years ago

muelli commented 8 years ago

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.

saimn commented 8 years ago

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 ?

muelli commented 8 years ago

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.

matelakat commented 6 years ago

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

matelakat commented 6 years ago

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

saimn commented 6 years ago

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.

Informatic commented 6 years ago

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)

defeo commented 5 years ago

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.

saimn commented 5 years ago

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.