[FFmpeg-trac] #9424(undetermined:new): gdigrab input device does not properly scale the screen after display resolution change

FFmpeg trac at avcodec.org
Wed Sep 15 13:01:55 EEST 2021


#9424: gdigrab input device does not properly scale the screen after display
resolution change
-------------------------------------+-------------------------------------
             Reporter:  Mykola       |                    Owner:  (none)
  Mokhnach                           |
                 Type:  defect       |                   Status:  new
             Priority:  normal       |                Component:
                                     |  undetermined
              Version:  unspecified  |               Resolution:
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
-------------------------------------+-------------------------------------
Description changed by Mykola Mokhnach:

Old description:

> OS: Windows 10
>
> How to reproduce:
>
> 1. Set display resolution to AxB
> 2. Start ffmpeg screen recording with the below command
> 3. Change the display resolution to CxD, which is higher than AxB
> 4. Stop recording the video and watch it
>
> Actual result:
> In the recorded video the actual display content is cut off to the
> initial resolution value
>
> Expected result:
> The recorded video should properly fit/scale/pad the screen content after
> display resolution change
>
> {{{
> %ffmpeg.exe -y -f gdigrab -framerate 4 -r 4 -i desktop -filter_complex
> "[0:v]split=2[ts][capture];[ts]setpts=time(0)*FR[ts];[capture]scale=1280:960:force_original_aspect_ratio=decrease:eval=frame,pad=1280:960:-1:-1:color=black[capture]"
> -map "[ts]" -vsync 0 -flush_packets 1 -f mkvtimestamp_v2 output_ts.txt
> -map "[capture]" -c:v libx264 -tune zerolatency -preset veryfast -fflags
> nobuffer -pix_fmt yuv420p -movflags +faststart -f mp4 output.mp4
>
> ffmpeg version 2021-09-11-git-3e127b595a-full_build-www.gyan.dev
> Copyright (c) 2000-2021 the FFmpeg developers
>   built with gcc 10.3.0 (Rev5, Built by MSYS2 project)
>   configuration: --enable-gpl --enable-version3 --enable-static
> --disable-w32threads --disable-autodetect --enable-fontconfig --enable-
> iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma
> --enable-libsnappy --enable-zlib --enable-librist --enable-libsrt
> --enable-libssh --enable-libzmq --enable-avisynth --enable-libbluray
> --enable-libcaca --enable-sdl2 --enable-libdav1d --enable-libzvbi
> --enable-librav1e --enable-libsvtav1 --enable-libwebp --enable-libx264
> --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg
> --enable-libvpx --enable-libass --enable-frei0r --enable-libfreetype
> --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg
> --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec
> --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-
> libmfx --enable-libglslang --enable-vulkan --enable-opencl --enable-
> libcdio --enable-libgme --enable-libmodplug --enable-libopenmpt --enable-
> libopencore-amrwb --enable-libmp3lame --enable-libshine --enable-
> libtheora --enable-libtwolame --enable-libvo-amrwbenc --enable-libilbc
> --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-
> libspeex --enable-libvorbis --enable-ladspa --enable-libbs2b --enable-
> libflite --enable-libmysofa --enable-librubberband --enable-libsoxr
> --enable-chromaprint
>   libavutil      57.  5.100 / 57.  5.100
>   libavcodec     59.  7.103 / 59.  7.103
>   libavformat    59.  5.100 / 59.  5.100
>   libavdevice    59.  0.101 / 59.  0.101
>   libavfilter     8.  9.100 /  8.  9.100
>   libswscale      6.  1.100 /  6.  1.100
>   libswresample   4.  0.100 /  4.  0.100
>   libpostproc    56.  0.100 / 56.  0.100
> Hyper fast Audio and Video encoder
> }}}
> Patches should be submitted to the ffmpeg-devel mailing list and not this
> bug tracker.

New description:

 OS: Windows 10

 How to reproduce:

 1. Set display resolution to AxB
 2. Start ffmpeg screen recording with the below command
 3. Change the display resolution to CxD, which is higher than AxB
 4. Stop recording the video and watch it

 Actual result:
 In the recorded video the actual display content is cut off to the initial
 resolution value

 Expected result:
 The recorded video should properly fit/scale/pad the screen content after
 display resolution change

 {{{
 %ffmpeg.exe -y -f gdigrab -framerate 4 -r 4 -i desktop -filter_complex
 "[0:v]split=2[ts][capture];[ts]setpts=time(0)*FR[ts];[capture]scale=1280:960:force_original_aspect_ratio=decrease:eval=frame,pad=1280:960:-1:-1:color=black[capture]"
 -map "[ts]" -vsync 0 -flush_packets 1 -f mkvtimestamp_v2 output_ts.txt
 -map "[capture]" -c:v libx264 -tune zerolatency -preset veryfast -fflags
 nobuffer -pix_fmt yuv420p -movflags +faststart -f mp4 output.mp4

 ffmpeg version 2021-09-11-git-3e127b595a-full_build-www.gyan.dev Copyright
 (c) 2000-2021 the FFmpeg developers
   built with gcc 10.3.0 (Rev5, Built by MSYS2 project)
   configuration: --enable-gpl --enable-version3 --enable-static --disable-
 w32threads --disable-autodetect --enable-fontconfig --enable-iconv
 --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-
 libsnappy --enable-zlib --enable-librist --enable-libsrt --enable-libssh
 --enable-libzmq --enable-avisynth --enable-libbluray --enable-libcaca
 --enable-sdl2 --enable-libdav1d --enable-libzvbi --enable-librav1e
 --enable-libsvtav1 --enable-libwebp --enable-libx264 --enable-libx265
 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx
 --enable-libass --enable-frei0r --enable-libfreetype --enable-libfribidi
 --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf
 --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec
 --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-
 libglslang --enable-vulkan --enable-opencl --enable-libcdio --enable-
 libgme --enable-libmodplug --enable-libopenmpt --enable-libopencore-amrwb
 --enable-libmp3lame --enable-libshine --enable-libtheora --enable-
 libtwolame --enable-libvo-amrwbenc --enable-libilbc --enable-libgsm
 --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-
 libvorbis --enable-ladspa --enable-libbs2b --enable-libflite --enable-
 libmysofa --enable-librubberband --enable-libsoxr --enable-chromaprint
   libavutil      57.  5.100 / 57.  5.100
   libavcodec     59.  7.103 / 59.  7.103
   libavformat    59.  5.100 / 59.  5.100
   libavdevice    59.  0.101 / 59.  0.101
   libavfilter     8.  9.100 /  8.  9.100
   libswscale      6.  1.100 /  6.  1.100
   libswresample   4.  0.100 /  4.  0.100
   libpostproc    56.  0.100 / 56.  0.100
 Hyper fast Audio and Video encoder
 }}}

--
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/9424#comment:1>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list