Opened 3 years ago

Last modified 2 years ago

#9423 new defect

avfoundation input device fails to record macOS screen upon display resolution change

Reported by: Mykola Mokhnach Owned by:
Priority: normal Component: undetermined
Version: unspecified Keywords: avfoundation
Cc: Blocked By:
Blocking: Reproduced by developer: no
Analyzed by developer: no

Description

Summary of the bug:
How to reproduce:

  • Set macOS screen resolution to AxB
  • Start screen recording with the below command
  • Change macOS screen resolution to CxD (must be different from AxB) while recording
  • Stop the recording and watch the resulting video

Actual result:
The video loops the recent frame before the display resolution change. No errors are shown in the terminal. On Windows (gdigrab) the recorder properly retrieves the content of the display with the new resolution set.

Expected result:
The video must contain the scaled content of the display with the new resolution.

%ffmpeg -y -f avfoundation -framerate 4 -r 4 -i 0 -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

fmpeg version 4.4-tessus  https://evermeet.cx/ffmpeg/  Copyright (c) 2000-2021 the FFmpeg developers
  built with Apple clang version 11.0.0 (clang-1100.0.33.17)
  configuration: --cc=/usr/bin/clang --prefix=/opt/ffmpeg --extra-version=tessus --enable-avisynth --enable-fontconfig --enable-gpl --enable-libaom --enable-libass --enable-libbluray --enable-libdav1d --enable-libfreetype --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libmysofa --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopenh264 --enable-libopenjpeg --enable-libopus --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvmaf --enable-libvo-amrwbenc --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxavs --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-version3 --pkg-config-flags=--static --disable-ffplay
  libavutil      56. 70.100 / 56. 70.100
  libavcodec     58.134.100 / 58.134.100
  libavformat    58. 76.100 / 58. 76.100
  libavdevice    58. 13.100 / 58. 13.100
  libavfilter     7.110.100 /  7.110.100
  libswscale      5.  9.100 /  5.  9.100
  libswresample   3.  9.100 /  3.  9.100
  libpostproc    55.  9.100 / 55.  9.100

Change History (1)

comment:1 by Carl Eugen Hoyos, 2 years ago

Keywords: avfoundation added
Note: See TracTickets for help on using tickets.