OBS v27 stopping stream with "Encoding Error"

Gianluca Leal

New Member
TL;DR - OBS v27 stops stream with "encoding error" message. Issue likely caused by FFMPEG encoding an AAC with an error. How do I fix this issue?

Hello OBS Forums,
Since updating to OBS v27 I've been running into "encoding errors" during my streams.
OBS doesn't crash or close; the stream just stopped with an "encoding error" message and then won't start again until I completely close OBS and reopen it.
The streams can last anywhere from 2-3 hours before the "encoding error" can occur. The longest I've had was 3-5 hours before killing the stream.
Considering OBS doesn't actually crash, there is no proper crash log but I'll upload the latest anyway.

I was having no issues with OBS v26 since release, but since updating to v27 on its official release date, I get "encoding error" at least once a stream, every stream. (3 stream a week)
The only thing I've changed since updating was changing my microphone's audio filter from SPEEX to the NVIDIA RTX-VOICE filter to remove background noise.
I'm on the latest NVIDIA drivers, and I downloaded and installed the NVIDIA SDK required for the filter to work.
The only plugins I have installed are NewTek's NDI, and OpenVR

Having Googled the issue and searching the OBS Forums, the only thing I could really find was one person saying the it was caused by FFMPEG's encoding of an AAC audio stream. With that in mind, I checked the end of the logs just before the stream stopped and it seems to say the same thing.
The one thread I had found didn't have any solutions listed on how to stop or fix this error.

Below you can find my latest logs and the (useless) crashlog. I've cut out the particular useful piece of the first log file before my stream stops.
Feel free to read the rest of the log entries and If you need anything else or have any questions, please ask.

Code:
02:57:02.324: error:   Input contains (near) NaN/+-Inf
02:57:02.325: [FFmpeg aac encoder: 'adv_stream_aac'] avcodec_encode_audio2 failed: Invalid argument
02:57:02.325: Error encoding with encoder 'adv_stream_aac'
02:57:02.327: [rtmp stream: 'adv_stream'] Encoder error, disconnecting
02:57:02.328: Output 'adv_stream': stopping
02:57:02.328: Output 'adv_stream': Total frames output: 572327
02:57:02.328: Output 'adv_stream': Total drawn frames: 572286 (572472 attempted)
02:57:02.328: Output 'adv_stream': Number of lagged frames due to rendering lag/stalls: 186 (0.0%)
02:57:02.329: Video stopped, number of skipped frames due to encoding lag: 210/572364 (0.0%)
02:57:02.338: ==== Streaming Stop ================================================

Log File #1:
Log File #2:

Latest Crash Report:
 

Gianluca Leal

New Member
After some more digging, I think I was able to find a solution; though this is untested so fair.
The common resolution to this issue is to install CoreAudio AAC Encoder. The guide is from 2018 though.

The official iTunes page now links you to the Microsoft Store to download; which does not work for the guide.
You can use the "Looking for other versions?" option slightly below the official download link but it no longer includes the "AppleApplicationSupport64.msi" file that you need within the installation file.

We can alleviate this by going to:
https://discussions.apple.com/docs/DOC-6562#versions
And then downloading the latest package that does contain the required .msi!
At the time of writing this post, the version I used was the following:
iTunes 12.9.1.4 for Windows (64-bit) - iTunes64Setup.exe (2018-10-24)

Before installing, the OBS launch log will say:
00:37:45.439: [CoreAudio encoder]: CoreAudio AAC encoder not installed on the system or couldn't be loaded

After installing the AppleApplicationSupport64.msi, the OBS launch log should now say:
17:58:07.754: [CoreAudio encoder]: Adding CoreAudio AAC encoder

I will be using and testing this method tonight on my Twitch stream; hopefully this resolves my issue.

Supposedly the CoreAudio AAC Encoder is also a higher quality AAC encoder than the default included with OBS v27.
Other commenters have said they've noticed a audible improvement of their overall stream audio.
I look forward to potentially hearing the difference myself.
 

KucingPucing

New Member
After some more digging, I think I was able to find a solution; though this is untested so fair.
The common resolution to this issue is to install CoreAudio AAC Encoder. The guide is from 2018 though.

The official iTunes page now links you to the Microsoft Store to download; which does not work for the guide.
You can use the "Looking for other versions?" option slightly below the official download link but it no longer includes the "AppleApplicationSupport64.msi" file that you need within the installation file.

We can alleviate this by going to:
https://discussions.apple.com/docs/DOC-6562#versions
And then downloading the latest package that does contain the required .msi!
At the time of writing this post, the version I used was the following:
iTunes 12.9.1.4 for Windows (64-bit) - iTunes64Setup.exe (2018-10-24)

Before installing, the OBS launch log will say:
00:37:45.439: [CoreAudio encoder]: CoreAudio AAC encoder not installed on the system or couldn't be loaded

After installing the AppleApplicationSupport64.msi, the OBS launch log should now say:
17:58:07.754: [CoreAudio encoder]: Adding CoreAudio AAC encoder

I will be using and testing this method tonight on my Twitch stream; hopefully this resolves my issue.

Supposedly the CoreAudio AAC Encoder is also a higher quality AAC encoder than the default included with OBS v27.
Other commenters have said they've noticed a audible improvement of their overall stream audio.
I look forward to potentially hearing the difference myself.
hello are you still getting the encoder error after installing the aac encoder from apple?
 
Top