Skip to content

mpv freezes when taking screenshots (screenshot command is not asynchronous) #4250

Closed

Description

@UserNaem

mpv version and platform

mpv 0.24.0-git-0f1afc6ba, Windows 7 build 7601, SP1

Reproduction steps

Add these lines to mpv.conf:
screenshot-format=png
screenshot-png-compression=9

Open any video file (the higher resolution the better) and take a screenshot with hotkey (default: s)

Expected behavior

I'd like mpv to pass the screenshot to another process for compression to not interfere with playback.

Actual behavior

mpv freezes for a few seconds to compress the screenshot, disrupting playback.

Also, is it possible to create a screenshot with 0 compression and then run some other PNG compression tool on the screenshot?

Activity

  1. ghost changed the title [-]mpv freezes for 1-2 seconds when taking screenshots[/-] [+]mpv freezes when taking screenshots (screenshot command is not asynchronous)[/+] on Mar 17, 2017
  2. UserNaem commented on Mar 18, 2017

    @UserNaem
    Author

    I tried running PngOptimizer but I have no idea how to pass the screenshot's name to it as a parameter, how to use screenshot wildcards as parameters?

  3. UserNaem commented on Mar 18, 2017

    @UserNaem
    Author

    How about take a raw bitmap screenshot and then pass it to another thread for compression, then?

  4. UserNaem commented on Mar 18, 2017

    @UserNaem
    Author

    So the only option is to set PNG compression to 0 and use some other tool to watch for new files in mpv's screenshots folder? That sounds rather inconvenient.
    I hope some day there will be a way to make well compressed screenshots without disrupting playback or having to use other tools.

  5. hrxn commented on Mar 18, 2017

    @hrxn
    Contributor

    If I may ask: what are you even trying to do?

  6. UserNaem commented on Mar 18, 2017

    @UserNaem
    Author

    I take screenshots. When I take screenshots, the video hangs, unless I disable PNG compression, in which case I would have to compress it later using some other tools. I tried to make mpv run PngOptimizer on a freshly created screenshot but I have no idea how to pass the resulting screenshot's filename to it.

  7. hrxn commented on Mar 18, 2017

    @hrxn
    Contributor

    Just a few random screenshots? And what is the problem with compressing them later? It seems to me like you're trying to automate something, but I don't see the point here.

  8. tmpsa commented on Mar 28, 2017

    @tmpsa

    Perhaps related (or should this be made a separate issue?):
    Taking a screenshot using the command "screenshot-to-file" result in an image that appears to be taken from the video input. But if the image on the screen is rotated with the command "video-rotate" this does not affect the screenshot. So the screenshot is not really what is shown on the real screen. It would be very useful if that was the case.

  9. ghost closed this as completedin 9bcb9fcon Apr 1, 2017
  10. tmpsa commented on Apr 3, 2017

    @tmpsa

    My program takes screenshots on a regular basis, using the libmpv API function mpv_command(ctx, "screenshot-to-file", "mydir/myfile.png"). Not when the user presses a key. So there's no key binding involved. How can my program get a correctly rotated screenshot?

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions