Update 2025-07-16

This commit is contained in:
2025-07-16 15:33:59 +03:00
parent 1a19d1112b
commit eb47813a34
20 changed files with 553 additions and 248 deletions

View File

@@ -1,9 +1,12 @@
# mediainfo.yazi
# mediainfo.yazi (fork)
<!--toc:start-->
- [mediainfo.yazi](#mediainfo-yazi)
- [mediainfo.yazi (fork)](#mediainfoyazi-fork)
- [Preview](#preview)
- [Installation](#installation)
- [Configuration:](#configuration)
- [Custom theme](#custom-theme)
<!--toc:end-->
This is a Yazi plugin for previewing media files. The preview shows thumbnail
@@ -16,50 +19,52 @@ using `ffmpeg` if available and media metadata using `mediainfo`.
- Video
![video](assets/2025-02-15-09-15-39.png)
![video](assets/2025-02-15-09-15-39.png)
- Audio file with cover
![audio_with_cover_picture](assets/2025-02-15-09-14-23.png)
![audio_with_cover_picture](assets/2025-02-15-09-14-23.png)
- Images
![image](assets/2025-02-15-16-52-39.png)
![image](assets/2025-02-15-16-52-39.png)
- Subtitle
![subrip](assets/2025-02-15-16-51-11.png)
![subrip](assets/2025-02-15-16-51-11.png)
- SVG+XML file doesn't have useful information, so it only show the image preview.
- There are more extensions which are supported by mediainfo. Just add file's MIME type to `previewers`, `preloaders`.
- There are more file extensions which are supported by mediainfo. Just add file's MIME type to `previewers`, `preloaders`.
Use `spotter` to determine File's MIME type. [Default is `<Tab>` key](https://github.com/sxyazi/yazi/blob/1a6abae974370702c8865459344bf256de58359e/yazi-config/preset/keymap-default.toml#L59)
## Installation
Install mediainfo CLI:
- Install mediainfo CLI:
- [https://mediaarea.net/en/MediaInfo/Download](https://mediaarea.net/en/MediaInfo/Download)
- Run this command in terminal to check if it's installed correctly:
- [https://mediaarea.net/en/MediaInfo/Download](https://mediaarea.net/en/MediaInfo/Download)
- Run this command in terminal to check if it's installed correctly:
```bash
mediainfo --version
```
If it output `Not found` then add it to your PATH environment variable. It's better to ask ChatGPT to help you (Prompt: `Add MediaInfo CLI to PATH environment variable in Windows`).
- Install this plugin:
```bash
mediainfo --version
ya pkg add boydaihungst/mediainfo
```
- If it output `Not found` then add it to your PATH environment variable. It's better to ask ChatGPT to help you (Prompt: `Add MediaInfo CLI to PATH environment variable in Windows`).
Install + config this plugin:
## Configuration:
> [!IMPORTANT] > `mediainfo` use video, image, svg, magick built-in plugins behind the scene to render preview image, song cover.
> So you can remove those 3 plugins from `preloaders` and `previewers` sections in `yazi.toml`.
If you have cache problem, run this cmd, and follow the tips: `yazi --clear-cache`
```bash
ya pkg add boydaihungst/mediainfo
# or
ya pack -a boydaihungst/mediainfo
```
Config folder for each OS: https://yazi-rs.github.io/docs/configuration/overview.
Config folder for each OS: https://yazi-rs.github.io/docs/configuration/overview
Create `.../yazi/yazi.toml` and add:
```toml
@@ -68,22 +73,24 @@ Create `.../yazi/yazi.toml` and add:
# Replace magick, image, video with mediainfo
{ mime = "{audio,video,image}/*", run = "mediainfo" },
{ mime = "application/subrip", run = "mediainfo" },
# Adobe Illustrator
{ mime = "application/postscript", run = "mediainfo" },
]
prepend_previewers = [
# Replace magick, image, video with mediainfo
{ mime = "{audio,video,image}/*", run = "mediainfo"},
{ mime = "application/subrip", run = "mediainfo" },
# Adobe Illustrator
{ mime = "application/postscript", run = "mediainfo" },
]
# There are more extensions which are supported by mediainfo.
# Just add file's MIME type to `previewers`, `preloaders` above.
# https://mediaarea.net/en/MediaInfo/Support/Formats
```
## Custom theme
Using the same style with spotter
Read more: https://github.com/sxyazi/yazi/pull/2391
Using the same style with spotter. [Read more](https://github.com/sxyazi/yazi/pull/2391)
Edit or add `yazi/theme.toml`: