# OBS Studio H.265 (HEVC)



## arminicos (Jun 22, 2020)

I got a Hikvision 8 mpx IP camera that has the ability to encode images in HEVC or H.265. Is it possible to set OBS Studio to work with H.265 encoding since I don't see the option in the video streaming software in HEVC?


----------



## TryHD (Jun 22, 2020)

OBS can decode h.265, it doesn't matter what it does encode to because the Hikvision stream will always get decoded so OBS can work with it.


----------



## arminicos (Jun 22, 2020)

Can you tell me then how best to set up OBS Studio to stream H.265+ with 3 Mbps upload Internet to transfer 1080p video from Hikvision 8 mpx IP camera?


----------



## koala (Jun 22, 2020)

Before you think about streaming with h.265, make sure the streaming service you intend to use does support h.265. As far as I know, there is none, at least not common and free ones like Twitch, Youtube or Facebook. Because of this, there is no support for h.265/hevc streaming in OBS except probably hidden in some obscure custom ffmpeg output.


----------



## MichaelB (Sep 9, 2020)

Vimeo [Livestream] supports (ingests) H.265 streaming, and it's an encoding option in their Livestream Studio software.  My testing shows what one would hope for: preservation of quality at lower bitrates, or improved quality (over H.264) at the same bitrate.  I look forward to the day when licensing issues get sorted out and OBS has an option for H.265 encoding (and, of course, other services can consume an H.265 stream).


----------



## koala (Sep 9, 2020)

There will be most certainly no changes in h.265 licensing. The patent owners sit on their patents and grab the money they are able to grab. h.265 is used in movie streaming by (commercial) streaming services like Netflix or Amazon Prime, perhaps also by the new paid cloud gaming services. But it will never be used by free live streaming services - it's too expensive for them to use.

The successor of h.264 for live streaming will probably be AV1, as soon as hardware encoder support will appear. AV1 was explicitly made as free codec with the goal to avoid licensing issues as with h.265. Hardware encoder support is obligatory for live streaming, because the computing power required for the encoder is huge.


----------



## ryankm (Nov 22, 2020)

Why not?  It say x265 is open source.








						x265 HEVC Encoder / H.265 Video Codec
					

x265 is the leading H.265 / HEVC encoder software library. Compress video with higher quality and lower bit rates than H.264. Open source codec.



					x265.org


----------



## ryankm (Nov 22, 2020)

GNU General Public License v2.0 - GNU Project - Free Software Foundation
					






					www.gnu.org
				



*GNU General Public License, version 2


Preamble*

The licenses for most software are designed to take away your freedom to share and change it.  By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users.  This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it.  (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.)  You can apply it to your programs, too.


When we speak of free software, we are referring to freedom, not price.  Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things.


To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it.


For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have.  You must make sure that they, too, receive or can get the source code.  And you must show them these terms so they know their rights.


We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software.


Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software.  If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations.


Finally, any free program is threatened constantly by software patents.  We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary.  To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all.


The precise terms and conditions for copying, distribution and modification follow.


----------



## koala (Nov 22, 2020)

You are confusing the licensing of x265, a library for h.265 encoding, with the licensing of streaming h.265 encoded content.


----------



## ryankm (Nov 22, 2020)

That doesn't make sense.  Who would you need a liscense to stream h265 content seperate...   It says specifically in the open source liscense that they could not do that.   What ever streaming software twitch would use and obs can use these opennsource librarys.  It says that they can make special liscences for commercial versions of their software.  But that  would be for special order and cost money.   our purposes are not commercial.  We can use these librays.


----------



## TryHD (Nov 22, 2020)

ryankm said:


> That doesn't make sense.  Who would you need a liscense to stream h265 content seperate...


This guys https://www.mpegla.com/programs/hevc/license-agreement/


ryankm said:


> It says specifically in the open source liscense that they could not do that.   What ever streaming software twitch would use and obs can use these opennsource librarys.  It says that they can make special liscences for commercial versions of their software.  But that  would be for special order and cost money.   our purposes are not commercial.  We can use these librays.


You confuse copyright and patents

Anyway, h265 is dead, no need to talk about it anymore. AV1 is here.
Some smartphone SOCs have hardware decoding for it and in 3 months every new SOC should have it.
The new GPU lineup does have hardware decoders for it.
In 2 years we should have the next GPU generation with hardware encoders, so the usage will than not only VOD but also live streaming.


----------



## ryankm (Nov 22, 2020)

im telling you it is allowed.  Twitch and obs just havent been using it.   This software is out there and been developed they just dont use it.   Just because the guys at x265 developed some special software for Netflix wit commercial liscenses doesnt mean we do not get HEVC because we do.  No one has done the work yet at implementing it.  


Here is another one:  https://www.libde265.org/


----------



## TryHD (Nov 22, 2020)

ryankm said:


> im telling you it is allowed.


I tell you a secret, nobody gives a fuck if you are telling that it is allowed, everybody else knows that it is not and with that the topic is over. Feel free to start your own business that uses h265 without paying license fees to compete with twitch, youtube and co and see how you get sued.

Why the fuck I argue with you at all, you don't understand the diference between a encoder and a codec, what a time waste.


----------



## ryankm (Nov 22, 2020)

x265, the free H.265/HEVC encoder - VideoLAN
					






					www.videolan.org
				




x265 is what I need right now as I cant get CUDA going on Clear Linux to accesse nvhevc hardware encoders...   so having x265 would be nice to cut down on bandwith while streaming online gameing 4k at 60 fps...   right now i can do this with x264 but it uses a lot of bandwidth.   Would it ise more CPU?


----------



## ryankm (Nov 22, 2020)

There are plenty of free HEVC encoders out there.  I encode all the time.  I prefer .ogv though because of 96khz audio, but it would be useful gor streaming.


----------



## ryankm (Nov 22, 2020)

TryHD said:


> I tell you a secret, nobody gives a fuck if you are telling that it is allowed, everybody else knows that it is not and with that the topic is over. Feel free to start your own business that uses h265 without paying license fees to compete with twitch, youtube and co and see how you get sued.
> 
> Why the fuck I argue with you at all, you don't understand the diference between a encoder and a codec, what a time waste.


You are confusing people who are using commercial software with commercial liscensing versus open source.  Which there is exists just hasnt beem used by Twitch.     I encoded a video in HEVC last week just see the quality and speed.  It performed in 30min versus 2hrs of .ogv....   but I didnt post it because .ogv has 96khz audio.   So sue me...









						x265 HEVC Encoder / H.265 Video Codec
					

x265 is the leading H.265 / HEVC encoder software library. Compress video with higher quality and lower bit rates than H.264. Open source codec.



					x265.org
				




Take a second look at this.   The x265 librarys are free and anyone can access the source code.  Twitch is allowed to use it anytime they want.
  It is up to twitch to develop with their platform.  It relys on prediction software to acheive low bit rates with high quality so it wont work that well at first.   It needs time to learn.


I e


----------



## ryankm (Nov 22, 2020)

x264 works the same just it dose les predicting and a smaller area than x265.   I ran x264 streaming Vulkan and Clear Linux desktop for 24 straight hours before the stream worked right.    ObS has gpu h265 encoders for streaming.  now we can benifit from softwsre x265 encoders because not everybodynis allowed to use there Gpu hardware hevc encoders.


----------



## ryankm (Nov 22, 2020)

a relevant interesting article,  but contrary to popular belief here x265/h265 is availible for wide spread use.









						4 Reasons Why HEVC (H.265) Matters, and How You Can Start Using It Now
					

The video ecosystem is evolving, and the hot topic right now is the shift from AVC to HEVC. H.265 / High Efficiency Video Compression (HEVC) is the newest video compression standard that technology has been gradually shifting towards, and while the standard isn’t exactly new by any means (it was...




					teradek.com


----------



## koala (Nov 22, 2020)

The encoders and decoders are readily available (every Nvidia and AMD GPU comes with hevc hardware encoders and decoders). OBS supports them. Just go ahead and use them.

But the license situation about distributing and broadcasting hevc-encoded material is unclear. As long as you don't distribute this commercially to end-users, nobody of the patent holders will give a damn. But if you start broadcasting/distributing hevc-encoded material for free without license contracts, some of the hevc patent holders might crawl up from under their carpet and say: "we have a patent here, and we're going to charge you for that now, or you're required to cease using our patented video format".
This is different to previous encoder patents like h.264. For h.264 the patent holders agreed to act as one entity and set relatively transparent rules for royalty fees. For hevc the patent holders are split. If you want to use hevc, you have to negotiate with every one of them, and their rules are all different. Not transpareny at all.

Some of the big commercial video distributors like Netflix or Amazon Prime negotiated license fees for every hevc-streamed 4k video, which then are paid by their customers on top of the streaming cost.
You might think, broadcasting for free might result in no hevc license costs, but that's not clear. It might be the case, or it might one hevc license holder steps up and says: "you're doing it commercially, we want a share of your advertisement revenue". Because of these unclear costs, no free video provider can offer hevc.


----------



## ryankm (Nov 22, 2020)

Well it shouldnt be like that.  I f companys develop their own hevc encoders seperatly from what the patent holders have on their own version of hevc streaming softwareer using these open source librarys it i would be illegal to sue for copyright claims and patent infrigment.  The open source software liscense states this for the open source x265 librarys.  Whatever nvidia is shipping is known as proprietary software and not has anything to do with haveing a straight x265 software encoder for streaming.


it is one of those things we have to just make the switch where it will be rocky at first.  because it relys onnprediction to make the picture and achieve high quality images  and lower biy rates, but it takes people using them and the open source librarys will get better.   Maybe it uses to much cpu?  Idk because i do not have a x265 streamer and i never turned down the encoder butbit took 30 min to make a 4:20 second video tgat was made using hevc anyway; I just added a new audio travk.  i dont know how much I need to turn that down for streaming purposes.


----------



## Albert Einstin (Feb 16, 2021)

so how to I use h265 encoding option in OBS?  in "Output" there is no drop-down for it. Or is it hidden?


----------



## Necroshader (Apr 4, 2022)

@Fenrir unhide libx265 for custom ffmpeg recording for matroska.
Also ability to fully customize that ffmpeg settings putting anything you want would be nice for future.


----------



## waleedovkh (Aug 12, 2022)

I can't get "libx265" to show up I tried all settings. I have 3080ti and the latest OBS. My GPU must have support for this. What is missing?


----------

