jackburton79 / bescreencapture

BeScreenCapture - Screen Capture software for Haiku
BSD 3-Clause "New" or "Revised" License
7 stars 10 forks source link

Initialization failed #57

Closed jackburton79 closed 1 year ago

jackburton79 commented 1 year ago

On haiku 32 bit, encoding fails with "initialization failed" when recording more than 100 frames

jackburton79 commented 1 year ago

It seems there are various tickets filed in the haiku bugtracker which could be the cause of this problem: https://dev.haiku-os.org/ticket/17153 https://dev.haiku-os.org/ticket/18160 https://dev.haiku-os.org/ticket/9458

jackburton79 commented 1 year ago

Haiku ticket 9458 is fixed, but situation seems to have worsened on x86_gcc32 (32 bit).

jackburton79 commented 1 year ago

Interesting: changing line 76 of FramesList.cpp from

CountItems() >= 100

to

CountItems() >= 10

seems to fix the issues.

jackburton79 commented 1 year ago

More tests: If I let BeScreenCapture capture more than 100 frames, it crashes (around 95/100 frames), much before the encoding phase. Note that memory isn't an issue, since I tested with 2GB or 4GB with the same results. The workaround described above fixes the issue.

jackburton79 commented 1 year ago

Added more logging:

It fails like this: MovieEncoder::_EncoderThread() started MovieEncoder::_CreateFile() path: /boot/system/cache/tmp/BSC_clip_CzAVqu1 media_file_format: MPEG (Motion Picture Experts Group)(mpg) media_format: width: 1920, height: 1080, colorspace: 8 PluginManager: Error, load_add_on(): General system error PluginManager: Error, loading PlugIn ffmpeg failed PluginManager::CreateWriter: GetPlugin failed BMediaFile::InitCheck() failed with Initialization failed MovieEncoder::_EncoderThread(): _CreateFile failed with Initialization failed

jackburton79 commented 1 year ago

Seems like we hit the 2GB application memory limit on 32 bit, so there is no way this can work. I'll just avoid keeping the bitmaps in memory, then.