Sonico98 / exifaudio.yazi

Preview audio files metadata on yazi
MIT License
28 stars 2 forks source link

Fixing duration detection for FLAC files? #4

Closed xfzv closed 1 month ago

xfzv commented 3 months ago

This isn't an issue with the plug-in itself but rather with exiftool, which reports wrong duration for FLAC files:

% exiftool -ver
12.76
% exiftool -Duration file-1.flac
Duration                        : 0:04:39

% mediainfo --Output=$'General;Duration: %Duration/String3%\r' file-1.flac
Duration: 00:06:51.870
% exiftool -Duration file-2.flac
Duration                        : 0:02:48

% mediainfo --Output=$'General;Duration: %Duration/String3%\r' file-2.flac
Duration: 00:04:08.150

Just wondering if this could be improved.

It seems that mediainfo does a better job overall, as exiftool cannot read ape,wav or wv tags for example.

Sonico98 commented 3 months ago

I could look into using mediainfo by default and exiftool as a fallback. Thanks for pointing this out!

Sonico98 commented 2 months ago

This has been implemented in the mediainfo branch, unix-only for now until I figure out a way to access the template.txt file on Windows. Please test it if you can. Mediainfo is preferred for displaying the file's metadata, but exiftool is still required for extracting (and thus displaying) the cover art. If mediainfo can't be found, exiftool is used for everything instead.

xfzv commented 2 months ago

Thanks!

Works fine on my end. A minor issue is values spacing compared to exiftool, they overlap cover art:

Untitled

Sonico98 commented 2 months ago

Thanks!

Works fine on my end. A minor issue is values spacing compared to exiftool, they overlap cover art:

Untitled

Is the template.txt file present inside ~/.config/yazi/plugins/exifaudio.yazi? Because if it is, the plugin is not picking it up.

xfzv commented 2 months ago

Sorry, I didn't notice template.txt file. All good now:

Untitled

Sonico98 commented 1 month ago

Reimplemented without the need for a template file in the plugin directory, should work under Windows now as well (haven't tested). Closing for now.