Question / Help How to add x265 library for FFMPEG?

storrm

Member
Hi guys,

I've taken a read around the forum for any chatter re x265 but cant find an answer to my question, which is, how can I add H.265 recording support to OBS? I'm using the customer Output (FFMPEG) option but when looking in Video Encoder with "show all codecs" checked, I cant find a h265, libx265 or hevc option (except for nvenc which I have no intension of using as its terrible quality compared to cpu encoding).

I read that ffmpeg has supported the x265 codec for some while, so I'm assuming it hasn't been compiled into the version obs is using? Is there anyway I can add it? If not, is there any chance of a future build of OBS with x65 support for recording?

Although I use OBS for streaming games, I also do quite a lot of screen capture. Currently I'm recording native AVI or high bitrate AVC and then re-encoding to H265. If possible, it would be nice to encode directly to H265 :-)

Thanks
Matt
 

storrm

Member
Are you referring to @sam686 post :

A CPU-only libx265 could be an option... only if FFmpeg was compiled with x265 support. There is an option to replace OBS-Studio's avcodec-57.dll with the one that have libx265.
https://trac.ffmpeg.org/wiki/Encode/H.265

Can you clarify how that helps answer my question? I couldn't find anything at that link except the source code for ffmpeg and a static build that I could download. Are you suggesting that I need to compile my own sources in order to get the dll?
 

Marcedo

Member
Hi storrm - seems its not currenty implemented within the release, but at least its technically spoken possible to do. cheers
 

storrm

Member
so, we're saying its not possible? This is why I asked my original question as there seems to be different opinions. Mine is that although the FFMPEG support built into OBS can expose the nvenc-hevc hardware encoder, it doesn't (for some reason) expose the cpu libx265 encoder.
 

Dbzruler72

New Member
Recording with libx265 was possible in earlier versions of OBS that used FFmpeg 3.x. You can get around the new limitation by using the older FFmpeg files before the 4.0 release.

The last FFmpeg 3.x release was 3.4.2, so download its shared binaries (32-bit/64-bit). Extract, and copy avcodec-57.dll and avformat-57.dll into your \bin\32bit\ or \bin\64bit\ OBS directory. Then you will see libx265 in the Video Encoder dropdown.

I'm not sure why libx265 no longer displays in OBS. This says FFmpeg must be built manually with the --enable-libx265 flag, but ffmpeg -buildconf and ffmpeg -encoders clearly show that current 4.x versions of FFmpeg have the libx265 build flag enabled.

EDIT: Correction--libx265 was never an option in OBS out-of-the-box. I verified this by checking the older versions. libx265 displays only after copying over the FFmpeg pre-4.x shared binaries.
 
Last edited:

storrm

Member
THANK YOU Db . This is exactly what I was hoping. With any luck, the OBS developers will re-enable this option with the later versions of ffmpeg. Thank you for posting your findings. It seems others are more concerned over their post count rather than the quality and assistance of their replies
 
Top