Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

save contact sheet to a file #29

Open
akizuha opened this issue May 5, 2021 · 3 comments
Open

save contact sheet to a file #29

akizuha opened this issue May 5, 2021 · 3 comments

Comments

@akizuha
Copy link

akizuha commented May 5, 2021

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.

@occivink
Copy link
Owner

occivink commented May 5, 2021

That's not really possible to do in a script I'm afraid. Stitching multiple screenshots together is actually the simplest way I can think of.

@akizuha
Copy link
Author

akizuha commented May 6, 2021

Is this because of that mpv does not have necessary api?
What about using the help of external program such as ImageMagick, like this https://wiki.videolan.org/VLC_HowTo/Make_thumbnails/.
I also wonder what format is used in store those thumbnail in cache folder. Maybe it is possible to manipulate that format directly.


If screenshots is the easiest way to do this. It would be better to change (lavfi-complex could do this I believe) the video output to a fixed size (portrait), make the screenshot, then restore the video size.

@occivink
Copy link
Owner

occivink commented May 6, 2021

Yes it's very much possible to read the thumbnail files and build the contact sheet externally. The format is described here, more specifically

Currently, only bgra is defined. This format has 4 bytes per pixels, with 8 bits per component. The least significant 8 bits are blue, and the most significant 8 bits are alpha (in little endian, the components are B-G-R-A, with B as first byte).

I think it might be possible to programmatically resize the window such that the entire contact sheet fits and then take a screenshot, but that seems tricky and error-prone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants