Apple VT H264 Hardware Encoder gets randomly overloaded

renzokuken

New Member
Hello everyone,
I found that sometimes Apple VT H264 Hardware Encoder gets overloaded I find it hard to find the reasons. Sometimes I just reset OBS and everything is fine without changing any settings. I did not report it earlier because I was waiting for the moment to reproduce it and I managed just now. I attach the log file to this thread.

I would really like to know how to prevent it or at least know the reason for it so that I can stream more reliably.
Thank you everyone for help,
 

Attachments

  • 2021-10-31 13-06-35.txt
    19 KB · Views: 30

renzokuken

New Member
Is there any chance sometimes something else is using the Apple VT h264 hardware encoder concurrently and thus making it overwhelmed and breaking my stream?
 

renzokuken

New Member
I just run a new test. Only recording, no streaming (because if it was the encoder lag and same encoder is shared between recording and streaming it should not affect it).

Previous log contained
13:32:24.787: Output 'adv_stream': Number of lagged frames due to rendering lag/stalls: 15292 (33.9%)

and now I have
22:41:42.912: Output 'adv_file_output': Number of lagged frames due to rendering lag/stalls: 81 (0.8%)

( video lengths are different, so number of frames lagged should be compared proportionally to the length )
At the same time, while running this test I was looking at disk write in the Activity Manager and I noticed that frames are being written to the disk not continuously but rather in peaks. I observed I have 500KB/s writing for most of the time and suddenly a peak of 6MB/s, which must be next load of frames getting dumped to the file in the disk.

My current theory is, if disk is being used when one of those peaks arrives, that could cause write lag. I wonder if there is a way to ensure system gives priority disk writing to OBS during streaming. I searched the web a bit and I found this:

I will try it during next stream and hopefully that could improve.

New log attached.
 

Attachments

  • 2021-11-03 22-35-38.txt
    15.8 KB · Views: 15

renzokuken

New Member
Previous log contained
13:32:24.787: Output 'adv_stream': Number of lagged frames due to rendering lag/stalls: 15292 (33.9%)

I quoted wrong log entry, should have been
13:34:42.631: Output 'adv_file_output': Number of lagged frames due to rendering lag/stalls: 16421 (33.5%)

vs now
22:41:42.912: Output 'adv_file_output': Number of lagged frames due to rendering lag/stalls: 81 (0.8%)
 

renzokuken

New Member
Unfortunately the problem returned. Today I streamed and did it multiple times until it worked.
Those were dropping frames like crazy:
2021-11-13 17-03-00.txt
2021-11-13 17-15-47.txt
2021-11-13 17-12-25.txt
2021-11-13 17-09-00.txt
This one was fine:
2021-11-13 18-03-27.txt

I had the "renice" command used to prioritize OBS process in the system. Also, before every stream I did reset it and re-run renice. I panicly might have tweaked some settings. I haven't yet analyzed the log files but I am already uploading them before they get purged by the system.
 

Attachments

  • 2021-11-13 17-03-00.txt
    17.4 KB · Views: 24
  • 2021-11-13 17-15-47.txt
    18.6 KB · Views: 22
  • 2021-11-13 17-12-25.txt
    17.4 KB · Views: 20
  • 2021-11-13 17-09-00.txt
    18.9 KB · Views: 24
  • 2021-11-13 18-03-27.txt
    18.5 KB · Views: 26
Top