Skip to content

screenshot_raw fails on nvidia GPU with 4K AVC Codec #306

@kanehekili

Description

@kanehekili

Calling
MPV.screenshot_raw(includes="video")

  • which has been working for years - does not seem to work with the following settings

["hwdec"] = "nvdec"

hwdec is usually "auto-safe" - but this did not seem to work on the tested hardware either.

Using the same code and the same 4k source (other media works) on an INTEL machine is no problem.

The nvidia GPU driven hardware responds with:

"SystemError: ('Error running mpv command', -12, (<MpvHandle object at 0x7f8b56da18b0>, <ctypes.LP_MpvNode object at 0x7f8af89628f0>, <ctypes.LP_MpvNode object at 0x7f8af89627b0>))

in line 1304 (res = self.command('screenshot-raw', includes)

Using mpv Version 1.0.8 with python 3.14.2

Current workaround:
decoder = self.mediaPlayer["hwdec"]
self.mediaPlayer["hwdec"]="No"
im=self.mediaPlayer.screenshot_raw(includes="video")
self.mediaPlayer["hwdec"]=decoder

where self.mediaPlayer is the "MPV" instance. Looks like an ugly hack

That hack does NOT work for "screenshot_to_file" - total failure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions