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

CLI Screenshot Wrong resolution.. #5619

Closed
ne0ark opened this issue Mar 10, 2018 · 5 comments

Comments

Projects
None yet
7 participants
@ne0ark
Copy link

commented Mar 10, 2018

mpv version and platform

If you're not using git master or the latest release, update.
Releases are listed here: https://github.com/mpv-player/mpv/releases

Reproduction steps

Using following Parameters to take a screenshot:

			"--no-config",
			"--no-audio",
			"--no-sub",
			"--start", str( int( timeInSeconds ) ),
			"--frames", "1",
			"--screenshot-format", "png",
			"--screenshot-png-compression", "9", # doesn't seem to be working
			"--vf", "scale=0:0", # 0: scaled d_width/d_height
			"--o", outputPngPath,
			self.InputVideoPath ]```

MediaInfo

Video
ID : 224 (0xE0)
Format : MPEG Video
Format version : Version 2
Format profile : Main@Main
Format settings, BVOP : Yes
Format settings, Matrix : Custom
Format settings, GOP : Variable
Duration : 20mn 47s
Bit rate mode : Variable
Bit rate : 6 071 Kbps
Maximum bit rate : 9 800 Kbps
Width : 720 pixels
Height : 480 pixels
Display aspect ratio : 16:9
Frame rate : 23.976 fps
Standard : NTSC
Color space : YUV
Chroma subsampling : 4:2:0
Bit depth : 8 bits
Scan type : Progressive
Scan order : 2:3 Pulldown
Compression mode : Lossy
Bits/(Pixel*Frame) : 0.733
Time code of first frame : 00:20:31:14
Time code source : Group of pictures header
Stream size : 903 MiB (88%)

Expected behavior

Screenshot resolution should be 853x480.

Actual behavior

Screenshot resolution is 720x480

Few version back it seems to work properly now it's broke.

Log file

NA

Sample files

https://0x0.st/sm05.VOB

@kevmitch

This comment has been minimized.

Copy link
Member

commented Mar 10, 2018

Looks like it's outputting the image scaled to the correct aspect ratio, rather than a pixel-wise representation of the input. Probably an artifact of the new renderer screenshot mechanism.

@Hrxn

This comment has been minimized.

Copy link

commented Mar 10, 2018

Try it without "--vf", "scale=0:0", # 0: scaled d_width/d_height maybe?
Why would you want to use this for screenshots in the first place?

@wm4

This comment has been minimized.

Copy link
Contributor

commented Mar 10, 2018

Definitely a bug, it should take the screenshot using the correct aspect ratio. Simple regression due to the screenshot change.

@sfan5 sfan5 added the bug label Mar 10, 2018

@kevmitch kevmitch closed this in 569383b Mar 16, 2018

@h633537

This comment has been minimized.

Copy link

commented Mar 16, 2018

@wm4
The screenshot is the right resolution now but the image is wrong. The video is stored at 720x428 and displayed at 1024x428.
https://i.imgur.com/ioDxKNZ.jpg
It also happens to any video when you change to a different aspect ratio with shift+A.

jeeb added a commit that referenced this issue Mar 16, 2018

vo_gpu: fix anamorphic video screenshots (second try)
This passed the display size as source size to the renderer, which is of
course nonsense. I don't know what I was doing in 569383b.

Yet another fix for those damn anamorphic videos.

As a somewhat redundant/cosmetic change, use image_params instead of
real_image_params in the code above. They should have the same, dimensions
(but possibly different formats when doing hw decdoing), and mixing them
is confusing. p->image_params wins because it's shorter.

Actually fixes #5619.

deu added a commit to deu/mpv that referenced this issue Mar 20, 2018

vo_gpu: fix anamorphic screenshots
We took the storage size instead of the display size for "unscaled"
screenshots. Even if it's called "unscaled", it's still supposed to
scale to compensate for aspect ratio.

(How many commits fixing anamorphic screenshots in various situations
are there?)

Fixes mpv-player#5619.

deu added a commit to deu/mpv that referenced this issue Mar 20, 2018

vo_gpu: fix anamorphic video screenshots (second try)
This passed the display size as source size to the renderer, which is of
course nonsense. I don't know what I was doing in 569383b.

Yet another fix for those damn anamorphic videos.

As a somewhat redundant/cosmetic change, use image_params instead of
real_image_params in the code above. They should have the same, dimensions
(but possibly different formats when doing hw decdoing), and mixing them
is confusing. p->image_params wins because it's shorter.

Actually fixes mpv-player#5619.
@signedout

This comment has been minimized.

Copy link

commented Feb 25, 2019

I have a file whose full mediainfo output shows:

Width : 764
Width : 764 pixels
Height : 576
Height : 576 pixels
Stored_Width : 768
Sampled_Width : 764
Sampled_Height : 576
Pixel aspect ratio : 1.003

If I take a screenshot of it during playback using mpv, I get a file with a width of 766. Should be 764...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.