- Howto: добавляем поддержку NVENC в ffmpeg
- Ошибки с кодеками OBS: Failed to open NVENC codec: function not implemented – решение сбоев вывода
- Причины ошибки вывода потока в OBS
- Как исправить ошибку вывода?
- Выводы
- Question / Help Failed to open NVENC codec: Generic error in an external library (I HAVE TRIED EVERYTHING)
- TheRealNoman
- Attachments
- koala
- TheRealNoman
- Jogger2
- csmgj
- dalenacio
- DerkWehler
- tensai
- tensai
- Ken_SF
- domaxi198
- braintalked
- Awoolyx
- Rutopia
- oxkos
- OBS Failed to open NVENC Codec: Function not implemented
- Reorient
- carlmmii
- reikuroi
- SeniorMeowMeow
- kohdra
- tathan3x
- Oatmeal_01
- spadonk
- ThanksForTheFish
- oxkos
- ZaBici
Howto: добавляем поддержку NVENC в ffmpeg
Что такое ffmpeg?
А то вы не знаете.
Что такое nvenc?
На каких картах работает?
Kepler (NVIDIA GeForce 6xx за исключением тех, которые базируются на Fermi) и новее.
Установите заголовочные файлы NVENC, взяв их отсюда: https://developer.nvidia.com/nvidia-video-codec-sdk#Download Файлы имеют имена *.h, например nvEncodeAPI.h. Класть в /usr/include (Upd: оказывается, можно в пространство пользователя — читаем конец статьи).
Есть USE-флаг «nvenc», «подтягивающий» media-video/nvidia_video_sdk Пруф
FFmpeg из дефолтных реп собран с nvenc. Пруф
Имейте в виду что ffmpeg вернули лишь в последних релизах Ubuntu. Включаем репозиторий Source уот так уот. Обновляем базу пакетов apt-get. Выполняем:
Собирать командой fakeroot ./debian/rules binary , но нам сначала надо открыть файл rules, найти параметры для сборки, и добавить —enable-nonfree и —enable-nvenc . Первый, скорее всего, уже добавлен (для AAC).
Берём исходник ffmpeg. Распаковываем его куда-нибудь, например в
/build-ffmpeg. Выполняем «ffmpeg», чтобы посмотреть, с какими параметрами configure он собран. Заходим в директорию с исходниками и пишем «./configure», затем копируем параметры. Только в них надо кое-что поменять:
- Убираем всю эту кашу директорий: «это туда, это сюда». Тупо делаем —prefix=/home/username/build-ffmpeg/3.2/
- Добавляем —enable-nvenc. Если по какой-то причине —enable-nonfree нет, добавляем и его тоже
Потом make и make install (без sudo). Всё. Использовать так:
Начиная с FFmpeg 3.2, вместо «nvenc» — «h264_nvenc», вероятно будет h265. И вместо libfaac теперь что-то другое.
Не удивляйтесь моему комменту под записью с накладыванием стороннего патча на ffmpeg. Оказалось что патч уже в апстриме, я не знал. Выше я рассказывал только про NVENC. А ещё есть libnpp и CUVID, речь о которых пойдёт здесь.
libnpp (бывший nvresize) расширяет возможности NVENC, который разделён на часть без CUDA (nvenc) и с CUDA (nvenc+libnpp). Я считаю разумным отделение части функционала, требующего CUDA! У меня без libnpp не заработало только обрезание видео с 1600×900 до 1024×600 (хотел взять запись полного экрана и выхватить из него только окно с помощью -filter:v «crop=1024:600:263:75» ). Я уверен что есть и другие применения libnpp, о которых я не знаю, и также уверен что большинству пользователей часть с CUDA не нужна: ведь что нужно большинству? Записывать видео с экрана (с минимальной нагрузкой на CPU), сжимать несжатые видео, ну и некоторым стримить в Твич.
CUVID теперь называется nvDecode. Насколько я понял, включение CUVID выступает в роли катализатора для декодирования и кодирования видео, перенося ещё больше действий с CPU на GPU. Как работает, Как пользоваться (спасибо hizel за ссылки).
Кстати, если вам нужны libnpp и CUVID, устанавливать CUDA Toolkit не нужно: тех файлов CUDA, которые есть в самом драйвере NVIDIA, будет достаточно.
Источник
Ошибки с кодеками OBS: Failed to open NVENC codec: function not implemented – решение сбоев вывода
Сегодня расскажем что предпринять если у вас появился сбой вывода в программе OBS. NVEC или AMD. Ошибка может звучать в английском варианте «Failed to open NVENC codec: Function Not Implemented» или Generic error in an external library. Симптомы у них похожи. Либо просто выскакивает окошко с уведомлением как на скриншоте ниже: «Сбой вывода. Подробности отражены в журнале. Примечание: Если вы используете кодировщики NVEC или AMD, убедитесь что у вас установлена последняя версия видеодрайвера.»
Сбой вывода. Не удалось начать запись в OBS
Причины ошибки вывода потока в OBS
Поскольку запись или трансляция стримов потребляют большие ресурсы видеопамяти все ошибки нужно начинать с проверки видеокарты и ее работы. Естественно, первым делом стоит убедиться, что вы загрузили последнюю версию драйверов на официальном сайте и обновили. Для видеокарт от NVIDIA после запуска любой игры или приложения в трее есть иконка, которая позволяет увидеть какая видеокарта задействована в данный момент. При работе с графикой и записи видео или стримов разумеется должна отображаться внешняя видеокарта.
Второе – часто программа конфликтует с продуктами от Adobe запущенными на компьютере в данный момент(Photoshop, InDesign, Premiere Pro, Illustrator или Adobe XD). Сохраните всё, что делали, выключите программу и попробуйте снова запустить запись. Эта ошибка вызвана тем, что графические редакторы задействуют ресурсы видеокарт по максимуму, а если карточка не последних поколений, выделить дополнительную память на стрим или запись она просто не сможет.
Как исправить ошибку вывода?
Если обновление драйверов не помогло, посмотрим что пишут в логах. Закройте все лишние работающие программы. Далее в запущенной программе OBS:
- Переходим в пункт меню «Справка», «Log файлы», «Посмотреть текущий журнал».
Справка, Log файлы, посмотреть текущий журнал
Stream output type «rtmp_output» failed to start!
Файл, настройки, вывод в программе OBS
Устанавливаем значение 0 в настройках GPU
Переключаем кодек с с NVENC H.264 на любой другой
Дополнительно можно обновить саму библиотеку кодеков, если вы до сих пор сидите на Windows XP или 7. Скачать можно с любого сайта. Яндекс предлагает https://softportal.pro/codecs/. Обновляем кодеки Video Codec x264, которые как раз подходят для стрима и записи в OBS. Заодно можно установить Windows 10 Codec Pack.
Обновляем кодеки Video Codec x264 и Windows 10 Codec Pack
Выводы
Самые распространенные ошибки при работе с OBS связанные со сбоем вывода или ошибкой открытия кодеков «Failed to open NVENC codec» появляются из-за конфликтов при запущенных программах Adobe(поскольку они потребляют ресурсы видеопамяти). Либо проблемой с кодеками. Проверьте в настройках какая видеокарта выставлена. Затем обновите кодеки и если не помогло переключайте текущий кодировщик. Если что-то осталось непонятно задавайте вопросы в комментариях под этой странице и обязательно напишите какой из способов помог вам решить проблему.
Источник
Question / Help Failed to open NVENC codec: Generic error in an external library (I HAVE TRIED EVERYTHING)
TheRealNoman
New Member
I have attached the log file. No matter what settings I change or what I do, I get this same error using Nvenc in OBS Studio.
I am running 64 bit OBS Studio, I have tried running it as administrator. I have run it with nothing else open and tried to record my desktop.
I have already reinstalled OBS studio multiple times in multiple different locations.
I have reinstalled my GPU drivers after cleaning them out using DDU.
I have changed every setting around in the output tab while in advanced mode.
Please someone help me fix this. I want to stream/record using Nvenc and OBS studio.
I want to stream with OBS studio specifically as it has all my scenes set up already, and my new GPU is coming in and I’m sure Nvenc encoding will not work even when I swap out the GPU as it seems to be an OBS Studio specific error.
NOTE: Nvenc encoding works with Streamlabs OBS for me. This leads me to believe my install of OBS Studio is broken, but reinstalling it in different locations has done nothing to stop this error.
If any of you help me fix this error, I will be insanely grateful.
Thanks in advance.
Attachments
koala
Active Member
TheRealNoman
New Member
UPDATE | I fixed it
Changing the Color Format/Range didn’t seem to fix it either.
I did a complete clean install of OBS Studio. I not only uninstalled it, but also deleted the folders of any installations of OBS Studio before reinstalling it, and this seemed to fix the problem.
@koala thanks for the reply
Jogger2
New Member
csmgj
New Member
UPDATE | I fixed it
Changing the Color Format/Range didn’t seem to fix it either.
I did a complete clean install of OBS Studio. I not only uninstalled it, but also deleted the folders of any installations of OBS Studio before reinstalling it, and this seemed to fix the problem.
@koala thanks for the reply
dalenacio
New Member
DerkWehler
New Member
Mine is already set like this. I tried changing the Encoder to «Software (x264)» (though I would prefer to use hardware). Sometimes it works, sometimes it doesn’t. I tried «Software (x264) low CPU usage. » too, which does the same.
It seems like with Software, it works when I click «start recording», but when I use my hot key, it gives me the error. Yep, recurring: hot key gives codec error, button works (on software encoding).
tensai
New Member
tensai
New Member
Ken_SF
New Member
I had this problem on a seldom used Windows 7 Pro 64 Bit computer. The Settings—>output—>change to software encoding did not work for me. What did work: update my NVIDIA drivers. That was a problem too as I first had to install Java and subsequently the NVIDIA driver web page kept asking me to install over and over, even though I had the most current version.
I finally, opened the NVIDIA control panel, found the model of my current driver and manually downloaded the NVIDIA driver that seemed to be the best match. There was a compatibility check portion of the NVIDIA driver installation, so hopefully, that will protect someone if they select the wrong NVIDIA driver; I selected the right one.
After installing the NVIDIA drivers I rebooted, launched OBS (updated to most recent version today — 06/15/2020) and recording worked perfectly with hardware or software encoding selected in settings—>output.
I hope this helps someone else.
Thanks for the prior posts; they helped me figure out what to do.
domaxi198
New Member
braintalked
New Member
Awoolyx
New Member
Some of you guys used the solution of going with CPU Encoding (Software), but this isn’t really great if you have an NVIDIA GPU.
Here’s my fix if you are looking for NVENC:
In Settings > Output ensure that only have EITHER Streaming OR Recording set to Hardware Encoding (NVENC). Set the other one that you don’t want to CPU/Software (x264). NVIDIA does not let you use NVENC twice/parallel.
If you want to stream and record, I’d recommend using NVENC for Recording and Software for Streaming, as recording has a much higher bitrate than streaming.
Rutopia
New Member
I found that for me, it was scaling the video. Apparently I had it scale to an 8k resolution. (I was messing about with different scenes). Setting scaling to my screen resolution allowed recording with NVENC to continue.
Scaling can be found in Settings -> Output. It’s under both Stream and Record. (freely translated from Dutch ;))
Hope it helps anyone else in the future.
oxkos
New Member
I have attached the log file. No matter what settings I change or what I do, I get this same error using Nvenc in OBS Studio.
I am running 64 bit OBS Studio, I have tried running it as administrator. I have run it with nothing else open and tried to record my desktop.
I have already reinstalled OBS studio multiple times in multiple different locations.
I have reinstalled my GPU drivers after cleaning them out using DDU.
I have changed every setting around in the output tab while in advanced mode.
Please someone help me fix this. I want to stream/record using Nvenc and OBS studio.
I want to stream with OBS studio specifically as it has all my scenes set up already, and my new GPU is coming in and I’m sure Nvenc encoding will not work even when I swap out the GPU as it seems to be an OBS Studio specific error.
NOTE: Nvenc encoding works with Streamlabs OBS for me. This leads me to believe my install of OBS Studio is broken, but reinstalling it in different locations has done nothing to stop this error.
If any of you help me fix this error, I will be insanely grateful.
Thanks in advance.
Источник
OBS Failed to open NVENC Codec: Function not implemented
Reorient
New Member
Hello! I just recently downloaded OBS Studio and once I hit «start recording», I get an error
Tried to update my Nvidia drivers but still get the same error
Here is the log:
carlmmii
Active Member
On laptops, it’s not going to be possible to use display capture and encode with nvenc. Display capture requires you to run OBS using the integrated graphics, while nvenc requires you to run OBS using dedicated graphics.
The only way you’re going to be able to use nvenc is if you run OBS on your dedicated graphics card, and use a capture method other than display capture for your scene.
reikuroi
New Member
If you’re a simpleton like me, I can tell you how to change these settings. Hopefully this will help any newbies who are having trouble like I was.
1. Open OBS
2. Click Settings in the lower right.
3. Click Output, then look for the «Streaming» box.
4. Click «Encoder» and switch it to Software instead of NVENC, then apply.
You should be good to go.
SeniorMeowMeow
New Member
kohdra
New Member
tathan3x
New Member
If you’re a simpleton like me, I can tell you how to change these settings. Hopefully this will help any newbies who are having trouble like I was.
1. Open OBS
2. Click Settings in the lower right.
3. Click Output, then look for the «Streaming» box.
4. Click «Encoder» and switch it to Software instead of NVENC, then apply.
You should be good to go.
Oatmeal_01
New Member
If you’re a simpleton like me, I can tell you how to change these settings. Hopefully this will help any newbies who are having trouble like I was.
1. Open OBS
2. Click Settings in the lower right.
3. Click Output, then look for the «Streaming» box.
4. Click «Encoder» and switch it to Software instead of NVENC, then apply.
You should be good to go.
New Member
I got the same issue. Started with blank screan. Followed YouTube and got my screen showing up but then got this message. Tried the Note above but it was already selected. Doesn’t work PLEASE help!
New Member
Of course NOTHING. THANKS OBS guess I’ll buy something. Try helping your users. Before you lose them. I shouldn’t have to fix any issues. It’s your software. Why can’t you make it work?
Coders are the most inept people on the planet. Imagine buying a car with no wheels and tires. That’s like most software.
New Member
HELLO.
Is there anybody out there.
Just yell if you can hear me.
spadonk
New Member
HELLO.
Is there anybody out there.
Just yell if you can hear me.
ThanksForTheFish
New Member
To help elaborate on Reikuroi’s solution a little, as mentioned by Spadonk, for us simpler simpletons : )
1. Open OBS
2. Click Settings in the lower right.
3. Click Output, then
. look in the «Streaming» box if your have trouble with «Start Streaming», or
. look in the «Recording» box if your have trouble with «Start Recording»
4. Click «Encoder» and switch it to Software instead of NVENC, then apply.
Great product !
Thank you to the developers & contributors of OBS.
oxkos
New Member
Hello! I just recently downloaded OBS Studio and once I hit «start recording», I get an error
Tried to update my Nvidia drivers but still get the same error
Here is the log:
ZaBici
New Member
If you’re a simpleton like me, I can tell you how to change these settings. Hopefully this will help any newbies who are having trouble like I was.
1. Open OBS
2. Click Settings in the lower right.
3. Click Output, then look for the «Streaming» box.
4. Click «Encoder» and switch it to Software instead of NVENC, then apply.
You should be good to go.
YOOOO. STOP RIGHT THERE. There’s a reason simple answers are simple. Not to take ANYTHING away from reikuroi but hat solution is a bandaid, NOT a FIX. It just uses integrated graphics to record/stream, which is wholly ineffective, it will create serious stutters on older laptops and pretty sure it’s gonna struggle on new ones as well, after all, that’s why you buy a dedicated graphics card.
So, back with the issue at hand. WHY IN GODS NAME CAN’T I RECORD ON THE DEDICATED GRAPHICS CARD? OBS? LAPTOP MANUFACTURERES? GOD.
Yes, I’m being hysterical for no reason, just needed some hype. Anyway
On laptops, it’s not going to be possible to use display capture and encode with nvenc. Display capture requires you to run OBS using the integrated graphics, while nvenc requires you to run OBS using dedicated graphics.
The only way you’re going to be able to use nvenc is if you run OBS on your dedicated graphics card, and use a capture method other than display capture for your scene.
Can someone pick this up? Maybe OP?
Not sure if I follow, but is desktop always run on integrated graphics card? And only . idk, overlays such as programs/games etc are being run on dedicated? What about a Sony Vegas, would that run on integrated or dedicated? I digress;
I’m trying to record a game with obs. I create a game source which defaults to the game I have opened and when I click record I get the error.
The game is run on the dedicated obviously and this is where I disconnect from your message, why in God’s name can’t I use the dedicated to record as well? «Won’t work on laptops» . Wait, by «display captures» do you mean, an encompassing any and all captures run through obs? Including my Game capture example? «Display capture requires you to run OBS using the integrated graphics» — Why? Like.. why?
That. just sounds like a fault on OBS’s end or at least an unaddressed issue if this is a common occurrence for laptops — which, I’m just gonna get this out the way now, I’ve used this program with success on a laptop before, that had integrated, was an I7-9750H with a GTX 1660 TI MAX-Q. It’s definitely not a «won’t work on laptops» issue. It just looks like a, it won’t work, because there’s an issue.
Someone care to address it? OBS? @dodgepong
I’m tired of my mind running in circles, I’ll just download fraps.
Источник