Code Monkey home page Code Monkey logo

mpv-gallery-view's People

Contributors

alexherbo2 avatar ckath avatar defaultxr avatar djdv avatar guidocella avatar jgreco avatar microraptor avatar musjj avatar n-r-k avatar occivink avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mpv-gallery-view's Issues

.wmv files

Hi, the script does not seem able to generate thumbnails out of .wmv files.

Show position of file in gallery as number X out of Y

Add an option to display a number (3/249) along the filename. Mostly because the paging keys seem to be… weird, instead of increasing the page, the selected thumbnail jumps to a fixed next page offset, or so it seems. Indexes would help to know how much has been skipped over, and also easier remember where browsing was stopped.

Is it possible to search thumbnails?

Hi!

In order to jump to a specific thumbnail, is it somehow possible to make the script to ask a user for a pattern and then to jump to a thumb representing a playlist entry containing that pattern?

Or are such interactions with mpv not doable at all?

Thank you (and it goes without saying, it's a very nice addition to mpv, I do enjoy it a lot, thanks!)

Windows 8.1 - Thumbnails Improperly Displayed

Not sure if this is a known issue or not, but when I open the gallery with g, it generates thumbnails for all files in a playlist because evidently the files are in mpv/gallery-thumbs-dir. But in the gallery, the thumbnails just turn to the color of the gallery's background color.

I am running Windows 8.1 so I tested it on a new Windows 10 vm and everything works as expected. So I'm not sure if it's a quick fix with something I'm lacking due to running 8.1 or if it's just not supported for 8.1.

I get that this isn't really a big issue seeing it seems as though I'm the only one experiencing it. But any help would be greatly appreciated.

Thumbnails not being genarated

I am not sure what's happening but this is something showing up on the terminal

gallery_thumbgen: free(): invalid pointer
statusline: (Paused) AV: 00:00:41 / 00:03:28 (20%) A-V: -0.012 DS: 3.139/1 Cache: 166s/44MB
[----------------------+--------------------------------------------------------------------------------------------]
gallery_thumbgen: free(): invalid pointer
statusline: (Paused) AV: 00:00:41 / 00:03:28 (20%) A-V: -0.012 DS: 3.139/1 Cache: 166s/44MB
[----------------------+--------------------------------------------------------------------------------------------]
gallery_thumbgen: free(): invalid pointer
statusline: (Paused) AV: 00:00:41 / 00:03:28 (20%) A-V: -0.012 DS: 3.139/1 Cache: 166s/44MB
[----------------------+--------------------------------------------------------------------------------------------]
gallery_thumbgen: free(): invalid pointer
statusline: (Paused) AV: 00:00:41 / 00:03:28 (20%) A-V: -0.012 DS: 3.139/1 Cache: 166s/44MB
[----------------------+--------------------------------------------------------------------------------------------]
gallery_thumbgen: free(): invalid next size (normal)
statusline: (Paused) AV: 00:00:41 / 00:03:28 (20%) A-V: -0.012 DS: 3.139/1 Cache: 166s/44MB
[----------------------+--------------------------------------------------------------------------------------------]
gallery_thumbgen: free(): invalid pointer
statusline: (Paused) AV: 00:00:41 / 00:03:28 (20%) A-V: -0.012 DS: 3.139/1 Cache: 166s/44MB
[----------------------+--------------------------------------------------------------------------------------------]
gallery_thumbgen: free(): invalid pointer
statusline: (Paused) AV: 00:00:41 / 00:03:28 (20%) A-V: -0.012 DS: 3.139/1 Cache: 166s/44MB
[----------------------+--------------------------------------------------------------------------------------------]
gallery_thumbgen: free(): invalid next size (normal)
statusline: (Paused) AV: 00:00:41 / 00:03:28 (20%) A-V: -0.012 DS: 3.139/1 Cache: 166s/44MB
[----------------------+--------------------------------------------------------------------------------------------]
gallery_thumbgen: free(): invalid pointer
statusline: (Paused) AV: 00:00:41 / 00:03:28 (20%) A-V: -0.012 DS: 3.139/1 Cache: 166s/44MB
[----------------------+--------------------------------------------------------------------------------------------]
gallery_thumbgen: free(): invalid pointer
statusline: (Paused) AV: 00:00:41 / 00:03:28 (20%) A-V: -0.012 DS: 3.139/1 Cache: 166s/44MB
[----------------------+--------------------------------------------------------------------------------------------]
gallery_thumbgen: Fatal glibc error: malloc assertion failure in _int_malloc: (unsigned long) (size) >= (unsigned long) (nb)

Or

gallery_thumbgen: corrupted size vs. prev_size in fastbins
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: corrupted size vs. prev_size in fastbins
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: corrupted size vs. prev_size in fastbins
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: corrupted size vs. prev_size in fastbins
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: corrupted size vs. prev_size in fastbins
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: corrupted size vs. prev_size in fastbins
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: free(): invalid next size (normal)
gallery_thumbgen: corrupted size vs. prev_size in fastbins
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: corrupted size vs. prev_size in fastbins
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: free(): invalid pointer
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: corrupted size vs. prev_size in fastbins
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: corrupted size vs. prev_size in fastbins
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: corrupted size vs. prev_size in fastbins
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: corrupted size vs. prev_size in fastbins
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: corrupted size vs. prev_size in fastbins
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: corrupted size vs. prev_size in fastbins
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: corrupted size vs. prev_size in fastbins
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: corrupted size vs. prev_size in fastbins
statusline: (Paused) AV: 00:00:00 / 00:24:13 (0%) A-V: -0.008 DS: 3.571/1 Cache: 1452s/170MB
[+-----------------------------------------------------------------------------------------------------------------------------------]
gallery_thumbgen: corrupted size vs. prev_size in fastbins

Thumbs proportional to window (?)

Firts let me say this is such a cool script =)

I have increased the thumbs' size a bit for a clearer view when in full screen on a big display, the thing is when I start mpv in "windowed" (normal) mode the thumbs are too big; is there a way the thumbs could scale up or down with the window, not dissimilar to the osd-scale?

Thanks

Feature request: restoring flagged state

In the gallery view, it'd be quite nice to have the scripts to:

  1. see if there's mpv_gallery_flagged file in the working directory;
  2. parse the contents of the file; and
  3. restore the flagged state to those files that were previously flagged, resulting in them remaining flagged until manually unflagged.

Cannot Find main.*

Annotation 2020-05-09 012633
Getting this error with the latest build of mpv.net(5.4.7.0
And no thumbnail being generated.
any fixes ?

playback starts when leaving menu

After I press esc (or the key that brought up the menu such as c or g) from the contacts or playlist view, the file starts playing if paused. I have on autopause and am testing the scripts on a file I'm not ready to watch. Is this a bug?

Thumbnail path in portable mpv Windows

I am using mpv with "portable_config" folder in it. All scripts load fine but I just don't know how to set the thumbnail path in this case. I made a "gallery-thumbs-dir" folder in "portable_config" but it doesn't work. Putting the direct path to "gallery-thumbs-dir" in playlist_view.conf does work but that is not the solution I'm looking for because if I move mpv someplace else I have to do this all over again thus making it not so portable anymore.

problem with thumbnails

Hi,

I have followed the installation instructions but I must be doing something wrong: pressing g, the script correctly opens the playlist panel, but it does not generate thumbnails (though the thumbnail directory exists, thumbnail spaces are therefore empty), although moving the cursor to a different, empty thumbnail space correctly opens a different file. When loading the playlist, mpv returns the following error messages:

[gallery_thumbgen]
[gallery_thumbgen] stack traceback:
[gallery_thumbgen] .../.config/mpv/scripts/gallery-thumbgen.lua:6: in main chunk
[gallery_thumbgen] [C]: ?
[gallery_thumbgen] [C]: ?
[gallery_thumbgen] Lua error: .../.config/mpv/scripts/gallery-thumbgen.lua:6: attempt to call field 'getpid' (a nil value)

Am I missing something? Thanks!

Appearance issue with osd-align-x=center

The osd-align-x=center parameter causes an issue with the mpv-gallery-view (gallery-thumbgen, contact-sheet) scripts. This problem is as follows: images showing thumbnails of a certain time section of the current video, or showing previews of other videos from the playlist, are displaced to the right, going beyond their own frames. The displaced images overlap the right frame line of their own frame and the left frame line of the neighbor on the right. The captions are also shifted to the right, being exactly in the center under the images shifted to the right. Also, the background is shifted to the left, going beyond the boundaries of the mpv window.

save contact sheet to a file

Is it possible to save the contact sheet to a png/jpg file like some other software do? Could be a useful feature.
And I am not suggesting using screenshot function that comes with mpv. If the contact sheet is longer than one screen (and usually is), screenshot is not really practical.
Thanks for any comments.

Possible to handle video rotation/orientation tag?

Hi. I filmed some videos on my phone in portrait orientation. Entering show-text ${video-params} in the mpv console shows

...
w=1920
h=1080
...
rotate=90

indicating the videos themselves are formatted in landscape, with a rotation/orientation field set in the metadata, or so I think.

mpv plays the video correctly, but this script doesn't seem to read that field. The result is broken thumbnails where the pixels are misplaced in a pattern of

row1 row1 row1 row2
row2 row2 row3 row3
row3 row4 row4 row4

where it should be

row1 row1 row1
row2 row2 row2
row3 row3 row3
row4 row4 row4

Would it be easy to fix this issue?

By the way this also happens with another similar script: mpv_thumbnail_script.
If the solution would be simple, I'd like to mimic a fix there too.

Thanks for the consideration.

Package this script so it can be run out of a directory inside mpv's script folder

Thank you for thiese awesome mpv scripts. I have a suggestion how to tidy up the folder structure and make the lib.disabled directory unnecessary (I almost deleted it, because the name suggests it isn't needed).

Since mpv build v0.33.1 (Apr 05, 2021) it is possible for scripts to be run out a folder inside the script directory. This is recommended by the mpv manual (second last §):
https://mpv.io/manual/master/#script-location
This makes installation very easy and elegant via git clone right into scripts folder. Since that release v0.33.1 includes security fixes, people should upgrade to it anyways.

All files would be neatly packed into this one folder and the gallery-library would be just alongside them. This import code of contact-sheet.lua and gallery-view could be deleted, because the library would be already in the package path:

local lib = mp.find_config_file('scripts/lib.disable')
if not lib then
    return
end
-- lib can be nil if the folder does not exist or we're in --no-config mode
package.path = package.path .. ';' .. lib .. '/?.lua;'

For it the scripts to load a main.lua is required which would optimally look something like this:

--[[
mpv-gallery-view | https://github.com/occivink/mpv-gallery-view
Playlist view and contact sheet scripts for mpv.
Assigns the script-bindings 'g' and 'c' by default.
]]

local gallery_thumbgen = require 'gallery-thumbgen'
local playlist_view = require 'playlist-view'
local contact_sheet = require 'contact-sheet'

-- Comment out functionalities, you don't want
gallery_thumbgen.init(0)
gallery_thumbgen.init(1)
gallery_thumbgen.init(2)
gallery_thumbgen.init(3)
contact_sheet.init()
playlist_view.init()

However for this these three files have to be changed to lua modules with an init function like that.

I tried a very simple main.lua like this, but just couldn't get it to work:

require 'gallery-thumbgen'
require 'contact-sheet'

The .conf files could be just in a subdirectory of the repo called conf with a readme.txt stating:
If you want to use these config files, place them in the "script-opts" directory inside mpv's configuration directory and edit them. Create the directory if not already present.

For an example of a mpv script which is installed with a directory see:
https://github.com/ctlaltdefeat/mpv-open-imdb-page

Option to show all filenames

Unfortunately the gallery only shows the filename of the currently selected item, it would be great if there was an option to show all filenames.

Better thumbnail management

Let's say I play some video files in a folder and the script generates some thumbs. Now if I move those same videos someplace else or rename the folder they're in and play them again then the script will generate another set of thumbs ignoring the ones already generated.

This happens to me often and was wondering if there's any way to make the script recognize the video by filename or something.
I got familiar with the script itself quite a bit and would appreciate any pointers.

Draggable scroll bar

Is it possible to make the scroll bar draggable via mouse? This is especially useful if you're navigating really long playlists.

Choking on filenames starting with "-"

Both gallery-view and contact-sheet fail to work on files with names starting with -.
Possibly because it's recognized as an option?
Could be addressed by adding -- somewhere if that's the case, I suppose.

p.s. I know it's a bad practice to name files this way, but I didn't name them and can't do anything about it.

Re-entering the gallery triggers autoload.lua

For every time I open the gallery, autoload.lua re-adds every image to the playlist, again. Duplicates quickly pile up in normal use.

I am under Windows, can't test under linux right now.

Folder gallery on file open with mpv

Hello! Can I get full directory on single file open? If I open use:
mpv foo.png
I get only this single foo.png file in my gallery. So I need to open with:
mpv *
How can I automatically scan dir on single file opened?
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.