webcamoid / akvirtualcamera

akvirtualcamera, virtual camera for Mac and Windows
GNU General Public License v3.0
407 stars 52 forks source link

Mac version: fwrite takes too long #58

Open renzhilan opened 3 years ago

renzhilan commented 3 years ago

Hi, I installed the virtual camera service in the Mac version, and then tried to write a 2m pixel fwrite (buffer, buffer_size, 1, proc) each time, but it took about 200 milliseconds, causing the picture to get stuck. What's the reason,

hipersayanX commented 3 years ago

The delay is because the plugin needs to convert the source frame to the destination frame, the higher the resolution of the frame, the slowest it will get.

renzhilan commented 2 years ago

The same pixel size of 2M does not freeze on the window version, but it freezes on the mac version.

hipersayanX commented 2 years ago

I freezes completely, or it just lags?

renzhilan commented 2 years ago

The streaming time has slowed down. It takes about 100ms to write a frame fwrite(frameRGBBuffer, bufferSize, 1, outputStream);

isomov commented 1 year ago

Hi! Is there any way to send frames to virtual camera without pipe?

qing-wang commented 1 year ago

One of the bottlenecks is the std::vector used in VideoFrame. The allocation of vector objects costs a lot of time. I have made a modification which improves this.

qing-wang commented 1 year ago

The streaming time has slowed down. It takes about 100ms to write a frame fwrite(frameRGBBuffer, bufferSize, 1, outputStream);

Based on my profiling, write seems fast enough, the bottleneck is the frequent memory allocation.

hipersayanX commented 1 year ago

@qing-wang I know, I must find some time to port the video converter from Webcamoid to the virtual cameras.

jbain commented 1 year ago

I'm seeing AKVCamManager consuming 85% cpu and can't get past 21fps

image

I assume this might be related to this issue? Or should I open a new issue? I'm using 9.11 on a intel mac