VCV-Recorder icon indicating copy to clipboard operation
VCV-Recorder copied to clipboard

Crash when recording video on 5K display on Mac

Open PaulPomeroy opened this issue 5 years ago • 17 comments

Running on Mac Catalina (10.15.1) using the latest VCV and latest versions of all modules. I'm unable to record an MPEG2 video (I'm able to record just audio, however). As soon as I click on the red button VCV crashes. I get a crash report from the OS that indicates:

"*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow drag regions should only be invalidated on the Main Thread!' Assertion failed: (err >= 0), function open, file src/Recorder.cpp, line 288.

terminating with uncaught exception of type NSException"

First attached file is the crash report. The second file is the patch file.

Rack_2019-11-27-182021_Pauls-iMac.txt

20191127-1-crashes.vcv.txt

PaulPomeroy avatar Nov 28 '19 01:11 PaulPomeroy

UPDATE: This appears to have something to do with the window size and/or zoom percent. I've got a 27" iMac and with VCV on a full-sized window the video recording fails. However, I reduced the VCV zoom percent down to 40 and then reduced the window size to match and was able to get the recording to work.

PaulPomeroy avatar Nov 28 '19 21:11 PaulPomeroy

Can you post the log.txt file in your Rack user directory after it crashes?

AndrewBelt avatar Nov 28 '19 23:11 AndrewBelt

log.txt

PaulPomeroy avatar Nov 29 '19 00:11 PaulPomeroy

Not really sure, but since you see a correlation with the window size (and thus video size), perhaps the encoder doesn't support the exact dimensions of the window.

AndrewBelt avatar Nov 29 '19 00:11 AndrewBelt

So your code isn't doing any resizing? I thought with the "NSWIndow drag" getting mentioned that it might ... that's why I tried it again with the window size and zoom level way down. It's been a couple of decades since I last wrote application software so it was just a wild guess on my part.

Oh. One more factor is that this new computer of mine has the 5K Retina display. The filesizes on the screenshots I do come out HUGE on this thing. It wouldn't surprise me if your code was doing the equivalent of cramming two cups of jello into a one-cup container ...

PaulPomeroy avatar Nov 29 '19 00:11 PaulPomeroy

No, the output video file is the same dimensions as the window size. Even if encoding a 5K video in real time worked, the performance would be poor.

AndrewBelt avatar Nov 29 '19 00:11 AndrewBelt

I wanted to record another video today and am unable to get it working, even when doing the things that worked for me a week ago. No crash this time but the video is no good. It looks like it might be okay at first but the sound will cut out after a few seconds. Also, if I look at the mouse pointer in the video I see that it isn't in the right place. For example, at the very beginning of the recording I click on the clock's RUN button but in the video the mouse pointer is several inches away from where the RUN button is. And then, as the video progresses I can also see that the recording speed is off (everything appears to be in slow motion) and the audio, before it simply quits, is not in sync with the video. There are no errors in the log.txt file, so nothing to attach here for you.

I thought this might have something to do with the Rack folder being up on iCloud (as that's where my Documents folder was) so I moved the Documents folder back to the local drive. I also rebooted the computer. Neither of those things helped.

PaulPomeroy avatar Dec 04 '19 03:12 PaulPomeroy

A follow on: I changed it so that Rack opens/runs in lo-res mode. That fixed the mouse positioning issue mentioned above, but I get no sound at all now and the video is still playing back in "slo-mo".

PaulPomeroy avatar Dec 04 '19 03:12 PaulPomeroy

Video illustrates the problem I'm having. Note that the video length is correct but what it shows is only about half of what I recorded.

FYI, the video here is a "down-res'd" version made with Quicktime (just to lower the file size).

[https://youtu.be/bgZ4Xtq36co]

PaulPomeroy avatar Dec 04 '19 16:12 PaulPomeroy

This problem (or problems?) keeps shifting. Today I can't get REC to work at all. I click on the button and it doesn't appear to do anything. However, it creates an empty file (with the name I've selected for the output MPEG). It also leaves a rather cryptic error message in the log (see attached). I've also attached the patch file in case that helps ... I tried all kinds of settings(frame rate, audio rate, zoom %, window size, ...) to no avail. I also shut down and restarted the computer.

log.txt 20191205a4 copy.vcv.txt

PaulPomeroy avatar Dec 06 '19 23:12 PaulPomeroy

Okay ... Another piece of data: When I open the video up in Quicktime and then open the "Movie Inspector" window I see an "Encoded FPS" value of 7.5. That seems pretty low to me. Other videos I've recorded have rates up near 60 FPS. That having been said, one of the last videos I managed to record successfully also has an Encoded FPS of 7.5. I don't know how the framerate is being set and/or what VCV Rack setting might be used to change it. It doesn't seem to matter what I set the REC bitrate to.

PaulPomeroy avatar Dec 07 '19 19:12 PaulPomeroy

Is this issue solved? I made a change at some point to use the memory heap instead of the stack for particular video data, and that could have been the cause and solution of this issue.

AndrewBelt avatar Aug 24 '20 21:08 AndrewBelt

I'll have to try again. I bought some software (iShowU Instant) to do video/audio recording and have only used the REC module to occasionally grab a sound recording since then. I'll get back to you shortly.

PaulPomeroy avatar Aug 24 '20 23:08 PaulPomeroy

Hmmm. Different problem. When I press the REC button nothing appears to happen. However, for every time I press the REC button, it generates an empty .mpg file and writes the following error message to the log:

[47.902 warn src/Recorder.cpp:352] Could not open video encoder: Invalid argument

log.txt

p.s., Audio recording to a wav file works fine.

PaulPomeroy avatar Aug 25 '20 00:08 PaulPomeroy

What encoder (video format) and settings (e.g. bitrate) are you using when it fails to start recording?

AndrewBelt avatar Aug 25 '20 00:08 AndrewBelt

It's a freshly initialized instance of the module. I'm selecting the mpeg-2 format. Video is at 2048 kbps. Audio is 256 Kbps.

For what it's worth, trying to record with the lossless (avi) formats generates a whole lot of static noise (cpu overload?). I do get something recorded to the output file but the patch doesn't play (actually, it plays a bit in fits and starts but mostly there's just a lot of clicking/static).

PaulPomeroy avatar Aug 25 '20 00:08 PaulPomeroy

Not sure what the relationship is, if any, but I'm using a 48 kHz sample rate and running on a single thread (lowest CPU usage).

PaulPomeroy avatar Aug 25 '20 00:08 PaulPomeroy