<p>Update, as of March 2023, RTMP has added support for HEVC. Refer to <a href="http://ossrs.io/lts/en-us/docs/v6/doc/hevc" rel="nofollow noreferrer">Enhanced RTMP</a>. Therefore, both RTMP and FLV standards now support HEVC.</p>
<p>Support status for related open-source projects:</p>
<ul>
<li>OBS 29 supports RTMP HEVC. Refer to <a href="https://github.com/obsproject/obs-studio/pull/8522" rel="nofollow noreferrer">Enable AV1, HEVC via RTMP to YouTube</a>.</li>
<li>FFmpeg's patch for Enhanced RTMP support has been submitted and is under review.</li>
<li>mpegts.js 1.7.3 supports HTTP-FLV HEVC. Refer to <a href="https://github.com/xqq/mpegts.js/issues/64" rel="nofollow noreferrer">FLV with HEVC support</a>.</li>
<li>SRS media server 6.0 supports RTMP HTTP-FLV HEVC. Refer to <a href="https://github.com/ossrs/srs/issues/465" rel="nofollow noreferrer">H265: Support HEVC in RTMP/SRT/HLS/WebRTC/DASH/GB28181</a>.</li>
</ul>
<p>To test RTMP HEVC, you can use OBS, patched FFmpeg, and SRS. First, start SRS:</p>
<pre class="lang-bash prettyprint-override"><code>docker run --rm -it -p 1935:1935 -p 8080:8080 ossrs/srs:6 \
  ./objs/srs -c conf/hevc.flv.conf
</code></pre>
<p>Download OBS 29+ from <a href="https://github.com/obsproject/obs-studio/releases" rel="nofollow noreferrer">here</a>, select the HEVC codec, or use FFmpeg 6.0 to publish RTMP HEVC stream:</p>
<pre class="lang-bash prettyprint-override"><code>ffmpeg -stream_loop -1 -re -i doc/source.flv -acodec copy -vcodec libx265 \
  -f flv rtmp://localhost/live/livestream
</code></pre>
<blockquote>
<p>Note: Build or patch FFmpeg 4/5/6+ with HEVC over RTMP, please see this <a href="https://ossrs.io/lts/en-us/docs/v6/doc/hevc#ffmpeg-tools" rel="nofollow noreferrer">post</a>.</p>
</blockquote>
<p>Now, you are able to play HTTP-FLV or HLS with HEVC codec:</p>
<ul>
<li>HTTP-FLV(by H5): <a href="http://localhost:8080/players/srs_player.html?autostart=true" rel="nofollow noreferrer">http://localhost:8080/live/livestream.flv</a></li>
<li>HLS(by VLC or fflay): <code>http://localhost:8080/live/livestream.m3u8</code></li>
</ul>
<p>Keep in mind that FFmpeg 6.0 does not support HEVC over RTMP until the following commit
<a href="https://github.com/FFmpeg/FFmpeg/commit/637c761be1bf9c3e1f0f347c5c3a390d7c32b282" rel="nofollow noreferrer">637c761b</a>:</p>
<pre><code>commit 637c761be1bf9c3e1f0f347c5c3a390d7c32b282
Author: Steven Liu &lt;liuqi05@kuaishou.com&gt;
Date:   Mon Aug 28 09:59:24 2023 +0800

    avformat/rtmpproto: support enhanced rtmp
    
    add option named rtmp_enhanced_codec,
    it would support hvc1,av01,vp09 now,
    the fourcc is using Array of strings.
    
    Signed-off-by: Steven Liu &lt;lq@chinaffmpeg.org&gt;
</code></pre>
<p>For details, please refer to <a href="http://ossrs.io/lts/en-us/docs/v6/doc/hevc#usage" rel="nofollow noreferrer">SRS HEVC Usage</a>.</p>

CC BY-SA 4.0
2023-10-21T13:28:29.183Z
2023-10-26T03:55:29.677Z
2023-10-26T03:55:29.677Z
Winlin
<p>I'm trying to created live event broadcast on my VPS server , to make the audience able watch my broadcast I use <code>Nginx RTMP</code> that's produce link at this format <code>http://192.168.1.5:8080/hls/live.m3u8</code> this is my ffmpeg command </p>

<p><code>ffmpeg  -re -i &lt;input&gt; -s 634x360 -vb 110k  -c:v libx265 -preset ultrafast -c:a aac -ab 38k  -ar 44100 -f mpegts  rtmp://localhost/hls/live</code></p>

<p>command output </p>

<pre><code>frame= 1465 fps= 25 q=-0.0 size= 1231kB time=00:00:58.56 bitrate= 172.2kbits/s speed=0.999x
</code></pre>

<p>Nginx config file </p>

<pre><code>server {
listen      8080;
server_name  localhost;
 location /hls 
   {
     types 
       {
                application/dash+xml mpd;
                application/vnd.apple.mpegurl m3u8;
       }
      root /tmp;
      add_header Cache-Control no-cache;
    }
  }
</code></pre>

<p>so the encoding runs on mealtime but when I try to access <code>live.m3u8</code> url I got <code>nginx 404 Not Found</code> error message like Nginx didn't generate .m3u file at all .</p>

<p>==update </p>

<p>Alright I found workaround solution to generate <code>.m3u8</code> file directly from ffmpeg using this command </p>

<pre><code>  ffmpeg -i &lt;input&gt; -map 0 -c:v libx265 -vb 300k -c:a aac -ab 38k -ar 44100 -preset veryfast -f ssegment -segment_list /var/www/vhl/live.m3u8 -segment_list_type hls -segment_list_size 10 -segment_list_flags +live -segment_time 10 -segment_wrap 30 /var/www/vhl/live%01d.ts 
</code></pre>

<p>I was able to play it via VLC for which is good for now
to gain more performance e.g you have huge number of audience mount your output folder <code>/var/www/vhl/</code> as <code>tmpfs</code> </p>

CC BY-SA 4.0
2018-06-14T04:33:10.843Z
HLS does not accept HEVC.
Gyan
CC BY-SA 4.0
2018-06-14T14:37:33.420Z
HLS does support HEVC using an mp4 container. RTMP does not support HEVC.
SlimSCSI
CC BY-SA 4.0
2018-06-15T05:43:40.777Z
Alright I found workaround solution to generate .m3u8 file directly from `ffmpeg` using this command `ffmpeg -i <input> -map 0 -c:v libx265 -vb 300k  -c:a aac -ab 38k -ar 44100  -preset veryfast -f ssegment -segment_list /var/www/dmain/live.m3u8 -segment_list_type hls -segment_list_size 10 -segment_list_flags +live -segment_time 10 -segment_wrap 30 /var/www/dmain/live%01d.ts` I was able to play it via VLC for which is good for now .
Salem F
CC BY-SA 4.0
2018-06-16T05:10:20.023Z
Sorry, I meant to write FLV.
Gyan
<ffmpeg><h265><hevc>
Nginx RTMP didn't accept HEVC h265 input format
Salem F
# Nginx RTMP didn't accept HEVC h265 input format

(Asked by: username_0 on 2018-06-13)

I'm trying to created live event broadcast on my VPS server , to make the audience able watch my broadcast I use Nginx RTMP that's produce link at this format http://192.168.1.5:8080/hls/live.m3u8 this is my ffmpeg command 
ffmpeg  -re -i  -s 634x360 -vb 110k  -c:v libx265 -preset ultrafast -c:a aac -ab 38k  -ar 44100 -f mpegts  rtmp://localhost/hls/live
command output 
frame= 1465 fps= 25 q=-0.0 size= 1231kB time=00:00:58.56 bitrate= 172.2kbits/s speed=0.999x

Nginx config file 
server {
listen      8080;
server_name  localhost;
 location /hls 
   {
     types 
       {
                application/dash+xml mpd;
                application/vnd.apple.mpegurl m3u8;
       }
      root /tmp;
      add_header Cache-Control no-cache;
    }
  }

so the encoding runs on mealtime but when I try to access live.m3u8 url I got nginx 404 Not Found error message like Nginx didn't generate .m3u file at all .
==update 
Alright I found workaround solution to generate .m3u8 file directly from ffmpeg using this command 
  ffmpeg -i  -map 0 -c:v libx265 -vb 300k -c:a aac -ab 38k -ar 44100 -preset veryfast -f ssegment -segment_list /var/www/vhl/live.m3u8 -segment_list_type hls -segment_list_size 10 -segment_list_flags +live -segment_time 10 -segment_wrap 30 /var/www/vhl/live%01d.ts 

I was able to play it via VLC for which is good for now
to gain more performance e.g you have huge number of audience mount your output folder /var/www/vhl/ as tmpfs

**Tags:** ffmpeg, h265, hevc

> **Comments:**
> **username_1**: HLS does not accept HEVC.  
> **username_2**: HLS does support HEVC using an mp4 container. RTMP does not support HEVC.  
> **username_0**: Alright I found workaround solution to generate .m3u8 file directly from `ffmpeg` using this command `ffmpeg -i <input> -map 0 -c:v libx265 -vb 300k  -c:a aac -ab 38k -ar 44100  -preset veryfast -f ssegment -segment_list /var/www/dmain/live.m3u8 -segment_list_type hls -segment_list_size 10 -segment_list_flags +live -segment_time 10 -segment_wrap 30 /var/www/dmain/live%01d.ts` I was able to play it via VLC for which is good for now .  
> **username_1**: Sorry, I meant to write FLV.  

---

## 1 answers

### Answer by username_3 on 2023-10-21. Score: 1

Update, as of March 2023, RTMP has added support for HEVC. Refer to Enhanced RTMP. Therefore, both RTMP and FLV standards now support HEVC.
Support status for related open-source projects:

OBS 29 supports RTMP HEVC. Refer to Enable AV1, HEVC via RTMP to YouTube.
FFmpeg's patch for Enhanced RTMP support has been submitted and is under review.
mpegts.js 1.7.3 supports HTTP-FLV HEVC. Refer to FLV with HEVC support.
SRS media server 6.0 supports RTMP HTTP-FLV HEVC. Refer to H265: Support HEVC in RTMP/SRT/HLS/WebRTC/DASH/GB28181.

To test RTMP HEVC, you can use OBS, patched FFmpeg, and SRS. First, start SRS:
docker run --rm -it -p 1935:1935 -p 8080:8080 ossrs/srs:6 \
  ./objs/srs -c conf/hevc.flv.conf

Download OBS 29+ from here, select the HEVC codec, or use FFmpeg 6.0 to publish RTMP HEVC stream:
ffmpeg -stream_loop -1 -re -i doc/source.flv -acodec copy -vcodec libx265 \
  -f flv rtmp://localhost/live/livestream


Note: Build or patch FFmpeg 4/5/6+ with HEVC over RTMP, please see this post.

Now, you are able to play HTTP-FLV or HLS with HEVC codec:

HTTP-FLV(by H5): http://localhost:8080/live/livestream.flv
HLS(by VLC or fflay): http://localhost:8080/live/livestream.m3u8

Keep in mind that FFmpeg 6.0 does not support HEVC over RTMP until the following commit
637c761b:
commit 637c761be1bf9c3e1f0f347c5c3a390d7c32b282
Author: Steven Liu 
Date:   Mon Aug 28 09:59:24 2023 +0800

    avformat/rtmpproto: support enhanced rtmp
    
    add option named rtmp_enhanced_codec,
    it would support hvc1,av01,vp09 now,
    the fourcc is using Array of strings.
    
    Signed-off-by: Steven Liu 

For details, please refer to SRS HEVC Usage.


---

