NSInternalInconsistencyException: NSWindow drag regions should only be invalidated on the Main Thread!
Hi there,
I have been tasked with fixing a script which has broken since updating a Mac to the latest OS Ventura. This is the first time I've seen this script, and the person who wrote it is no longer around. I'm not familiar with GST plugins, so hoping someone can kindly point me in the right direction!
Here is the command:
gst-launch-1.0 -e avfvideosrc device-index=1 blocksize=8192 ! deinterlace ! videorate ! queue ! videoconvert ! videoscale ! video/x-raw,width=1920, height=1080,framerate=25/1 ! queue ! videoflip method=horizontal-flip ! videomixer name=mix sink_1::alpha=0.3 ! videoconvert ! queue ! osxvideosink processing-deadline=5000000 sync=false avfvideosrc capture-screen=true device-index=2 ! video/x-raw,framerate=25/1 ! tee name=t ! videoconvert ! avenc_mpeg4 quantizer=15 ! queue ! muxer. osxaudiosrc device=67 ! queue ! avenc_aac ! queue ! muxer. qtmux name='muxer' ! filesink location="/tmp/video-temp.mov" t. ! videoscale ! video/x-raw,width=1920,height=1080 ! mix.
And the response:
2022-11-21 17:20:11.883 gst-launch-1.0[5558:71462] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!'
*** First throw call stack:
(
0 CoreFoundation 0x00007ff80811e43b __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007ff807c6de25 objc_exception_throw + 48
2 CoreFoundation 0x00007ff8081465d6 _CFBundleGetValueForInfoKey + 0
3 AppKit 0x00007ff80b1ed161 -[NSWindow(NSWindow_Theme) _postWindowNeedsToResetDragMarginsUnlessPostingDisabled] + 307
4 AppKit 0x00007ff80b20a826 -[NSView removeFromSuperview] + 364
5 AppKit 0x00007ff80b209d5f -[NSWindow setContentView:] + 89
6 libgstosxvideo.so 0x0000000109621c6a -[GstOSXVideoSinkWindow initWithContentNSRect:styleMask:backing:defer:screen:] + 175
7 libgstosxvideo.so 0x00000001096200cc -[GstOSXVideoSinkObject createInternalWindow] + 179
8 Foundation 0x00007ff808f1c420 __NSThreadPerformPerform + 177
9 CoreFoundation 0x00007ff8080a5bc8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
10 CoreFoundation 0x00007ff8080a5b77 __CFRunLoopDoSource0 + 157
11 CoreFoundation 0x00007ff8080a59b1 __CFRunLoopDoSources0 + 308
12 CoreFoundation 0x00007ff8080a45cb __CFRunLoopRun + 929
13 CoreFoundation 0x00007ff8080a3bb0 CFRunLoopRunSpecific + 560
14 HIToolbox 0x00007ff811985bd6 RunCurrentEventLoopInMode + 292
15 HIToolbox 0x00007ff811985806 ReceiveNextEventCommon + 199
16 HIToolbox 0x00007ff811985723 _BlockUntilNextEventMatchingListInModeWithFilter + 70
17 AppKit 0x00007ff80b1c6b37 _DPSNextEvent + 909
18 AppKit 0x00007ff80b1c59b8 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 1219
19 libgstosxvideo.so 0x0000000109620a7f -[GstOSXVideoSinkObject nsAppThread] + 290
20 Foundation 0x00007ff808ef582c __NSThread__start__ + 1009
21 libsystem_pthread.dylib 0x00007ff807fcb259 _pthread_start + 125
22 libsystem_pthread.dylib 0x00007ff807fc6c7b thread_start + 15
)
Setting pipeline to PLAYING ...
libc++abi: terminating with uncaught exception of type NSException
./record.sh: line 134: 5558 Abort trap: 6 gst-launch-1.0 -e avfvideosrc device-index=$videodeviceid blocksize=8192 ! deinterlace ! videorate ! queue ! videoconvert ! videoscale ! video/x-raw,width=1920, height=1080,framerate=25/1 ! queue ! videoflip method=horizontal-flip ! videomixer name=mix sink_1::alpha=0.3 ! videoconvert ! queue ! osxvideosink processing-deadline=5000000 sync=false avfvideosrc capture-screen=true device-index=$record_monitor ! video/x-raw,framerate=25/1 ! tee name=t ! videoconvert ! avenc_mpeg4 quantizer=15 ! queue ! muxer. osxaudiosrc device=$audiodeviceid ! queue ! avenc_aac ! queue ! muxer. qtmux name='muxer' ! filesink location="$temppa" t. ! videoscale ! video/x-raw,width=1920,height=1080 ! mix.
I believe the external monitor configuration got lost in the update, and with no record of the previous configuration I have set them using displayplacer like this:
displayplacer
"id:311E94AD-0A66-BBC7-221F-A9639FB96130 res:3200x1800 color_depth:8 scaling:on origin:(0,0) degree:0"
"id:981DEE1A-1160-9DDC-4DAF-7F94723A49A0 res:1920x1080 hz:30 color_depth:8 scaling:on origin:(3200,0) degree:0"
"id:E463AFAE-35D0-13D5-D06A-EAAB3074FF1E res:1920x1080 hz:30 color_depth:8 scaling:on origin:(3200,1080) degree:0"
Any pointers would be greatly appreciated! Thanks.