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

Support 'screenshot window' input command #4505

Open
wantMoreSleep opened this issue Jul 16, 2023 · 3 comments
Open

Support 'screenshot window' input command #4505

wantMoreSleep opened this issue Jul 16, 2023 · 3 comments

Comments

@wantMoreSleep
Copy link

What you want IINA to do:
As titled.

What IINA does currently:
Nothing happened after I've pressed key that is bind to this command.

Why you think this should be added:
I want to take screenshot with timestamp baked in.

Examples of other projects that have something similar:
The original mpv player does this.

@low-batt
Copy link
Contributor

From the mpv manual section for the Screenshot command:

screenshot <flags>

Take a screenshot.

Multiple flags are available (some can be combined with +):

<window>
Save the contents of the mpv window. Typically scaled, with OSD and subtitles. The exact behavior depends on the selected video output, and if no support is available, this will act like video.

If I'm understanding the issue correctly, the request is to be able to bind a key to screenshot window and have it work like it does in the mpv player.

If currently you bind a key to this command and then press it the IINA log file will contain the following errors:

19:33:14.238 [iina][e] Return value -12 when executing key command screenshot window
19:33:14.238 [mpv][e] [cplayer] error: Taking screenshot failed.

The mpv log file shows:

[  68.575][d][cplayer] Run command: screenshot, flags=73, args=[flags="window", legacy="unused"]
[  68.593][e][cplayer] Taking screenshot failed.

A lot of mpv functionality is available in IINA. The exception is functionality that is tied to mpv's UI. Likely that is the problem in this case.

As it is mpv that generates the screenshot to support this we'd have to figure out how to integrate such functionality into mpv, if that is even possible.

@wantMoreSleep
Copy link
Author

Yup, what you described is my problem. Looks like I will have to be contend with MPV, if there's really no other approach in IINA to take screenshot with timestamp or any other OSD baked-in. Will revisit this project in the future, and thanks for the reply.

@low-batt
Copy link
Contributor

It is possible to embed a timestamp in the video using a filter. If you do that then the timestamp will appear in a screenshot. A quick example…

In IINA I added a FFmpeg drawtext video filter:

box=1:boxborderw=10:fontcolor=black:fontfile=Times.ttc:fontsize=128:text=%{pts}:x=512:y=96

And took a screenshot:

issue-4505

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

No branches or pull requests

2 participants