Opened 8 months ago

Closed 8 months ago

Last modified 3 months ago

#8072 closed defect (fixed)

ffplay does not scale video to window size when exiting fullscreen

Reported by: jimbo1qaz Owned by:
Priority: normal Component: ffplay
Version: unspecified Keywords:
Cc: cus Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
How to reproduce:

% ffplay file.mp4
ffplay version N-94500-g2828f5b0d8 Copyright (c) 2003-2019 the FFmpeg developers
  built with gcc 9.1.1 (GCC) 20190807
  • While video is playing, rress F to enter fullscreen. The video will resize to fit the entire screen.
  • Press F to exit fullscreen. The video will not resize to fit the window, and only the top-left portion is visible until the window is resized.

This bug happens on both NUT holding raw video frames from stdin, and x264 MP4 files.

OS: Windows 10 x64.

I tested historical builds from https://ffmpeg.zeranoe.com/builds/win64/shared/ :

Unaffected: ffmpeg-4.1.
Affected: ffmpeg-4.1.1, 20190101, and 20190811.

Change History (13)

comment:1 Changed 8 months ago by cus

  • Cc cus added

Seems SDL version related rather than ffmpeg version related, as ffplay did not change between 4.1 and 4.1.1. Can you check the SDL version used by zeranoe on the two builds?

comment:2 Changed 8 months ago by cehoyos

  • Resolution set to invalid
  • Status changed from new to closed

This cannot be fixed within FFmpeg, please report to Zeranoe.

comment:4 Changed 8 months ago by cehoyos

  • Resolution invalid deleted
  • Status changed from closed to reopened

comment:5 Changed 8 months ago by jimbo1qaz

This patch has been pushed to master: https://github.com/FFmpeg/FFmpeg/commit/a1c70148471c528104d64dffbc7af70e5d1ce33e

zeranoe dev is https://github.com/FFmpeg/FFmpeg/commit/8fcc5d9 and several days old. Should I wait for zeranoe to build something including this commit, or try to setup ffmpeg build myself?

Last edited 8 months ago by jimbo1qaz (previous) (diff)

comment:6 Changed 8 months ago by cus

  • Resolution set to fixed
  • Status changed from reopened to closed

I think zeranoe will auto-build a new version on git master every couple of days, so you only have to wait.

comment:7 Changed 8 months ago by Balling

  • Resolution fixed deleted
  • Status changed from closed to reopened

Hello! Excuse me for hijacking the issue but there is still one problem.

(After testing letest zeranoe build.)

It is that when you press F ffplay first changes the window's location to left top angle of the screen (not changing its size) while it should immediatelly change to full screen with size change. You can press F for a long time to understand what is the problem. (Really it is bad.)))

Thank you very very much)

Last edited 8 months ago by Balling (previous) (diff)

comment:8 follow-up: Changed 8 months ago by cus

  • Resolution set to fixed
  • Status changed from reopened to closed

FFPlay is only calling SDL_SetWindowFullscreen, it is not positioning the window any way. I suggest you report this to SDL.

comment:9 in reply to: ↑ 8 ; follow-up: Changed 8 months ago by Balling

Replying to cus:

FFPlay is only calling SDL_SetWindowFullscreen, it is not positioning the window any way. I suggest you report this to SDL.

No, please! I do not know how to report this to SDL! At least tell me can YOU reproduce it? I.e. do you understand what I am talking about? Thanks.

comment:10 in reply to: ↑ 9 ; follow-up: Changed 8 months ago by cus

Replying to Balling:

Replying to cus:

FFPlay is only calling SDL_SetWindowFullscreen, it is not positioning the window any way. I suggest you report this to SDL.

No, please! I do not know how to report this to SDL! At least tell me can YOU reproduce it? I.e. do you understand what I am talking about? Thanks.

I can see that the window positions itself to the top left corner for a fraction of a second before going full screen, but I guess I am used to this. Definitely has been this way as long as I can remember, going fullscreen never was "smooth". I also don't see why it is a big deal. A bit ugly, but does not affect usability.

https://bugzilla.libsdl.org/

comment:11 Changed 7 months ago by jimbo1qaz

Confirming that the original bug seems to be fixed. Exiting fullscreen scales the video to the proper size on Zeranoe ffmpeg-20190824.

comment:12 in reply to: ↑ 10 ; follow-up: Changed 7 months ago by Balling

Replying to cus:

Replying to Balling:

Replying to cus:

FFPlay is only calling SDL_SetWindowFullscreen, it is not positioning the window any way. I suggest you report this to SDL.

No, please! I do not know how to report this to SDL! At least tell me can YOU reproduce it? I.e. do you understand what I am talking about? Thanks.

I can see that the window positions itself to the top left corner for a fraction of a second before going full screen, but I guess I am used to this. Definitely has been this way as long as I can remember, going fullscreen never was "smooth". I also don't see why it is a big deal. A bit ugly, but does not affect usability.

https://bugzilla.libsdl.org/

The same problem is in media player classic AND VLC((( I did not see it but now I always see it. Damn it. I open https://github.com/clsid2/mpc-hc/issues/128

comment:13 in reply to: ↑ 12 Changed 3 months ago by Balling

The same problem is in media player classic AND VLC((( I did not see it but now I always see it. Damn it. I open https://github.com/clsid2/mpc-hc/issues/128

It is fixed now! We used

if (IsWindows8OrGreater()) {//DWMWA_CLOAK not supported on 7
            BOOL setEnabled = FALSE;
            ::DwmSetWindowAttribute(m_hWnd, DWMWA_CLOAK, &setEnabled, sizeof(setEnabled));
        }

New CLOAK API that was added in windows 10! Cool, right! See https://github.com/clsid2/mpc-hc/pull/206/files

Last edited 3 months ago by Balling (previous) (diff)
Note: See TracTickets for help on using tickets.