Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-10-21T13:28:29.183Z
Answers.LastActivityDate: 2023-10-26T03:55:29.677Z
Answers.LastEditDate: 2023-10-26T03:55:29.677Z
Answers.UserDisplayName: Winlin
Body: <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>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-14T04:33:10.843Z
Comments.Text: HLS does not accept HEVC.
Comments.UserDisplayName: Gyan
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-14T14:37:33.420Z
Comments.Text: HLS does support HEVC using an mp4 container. RTMP does not support HEVC.
Comments.UserDisplayName: SlimSCSI
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-15T05:43:40.777Z
Comments.Text: 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 .
Comments.UserDisplayName: Salem F
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-06-16T05:10:20.023Z
Comments.Text: Sorry, I meant to write FLV.
Comments.UserDisplayName: Gyan
Tags: <ffmpeg><h265><hevc>
Title: Nginx RTMP didn't accept HEVC h265 input format
UserDisplayName: Salem F
ThreadText: # 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 <input> -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 <input> -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](http://ossrs.io/lts/en-us/docs/v6/doc/hevc). 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](https://github.com/obsproject/obs-studio/pull/8522).
  * 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](https://github.com/xqq/mpegts.js/issues/64).
  * SRS media server 6.0 supports RTMP HTTP-FLV HEVC. Refer to [H265: Support HEVC in RTMP/SRT/HLS/WebRTC/DASH/GB28181](https://github.com/ossrs/srs/issues/465).
  
  To test RTMP HEVC, you can use OBS, patched FFmpeg, and SRS. First, start SRS:
  
  ```bash
  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](https://github.com/obsproject/obs-studio/releases), select the HEVC codec, or use FFmpeg 6.0 to publish RTMP HEVC stream:
  
  ```bash
  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](https://ossrs.io/lts/en-us/docs/v6/doc/hevc#ffmpeg-tools).
  
  Now, you are able to play HTTP-FLV or HLS with HEVC codec:
  
  * HTTP-FLV(by H5): [http://localhost:8080/live/livestream.flv](http://localhost:8080/players/srs_player.html?autostart=true)
  * 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](https://github.com/FFmpeg/FFmpeg/commit/637c761be1bf9c3e1f0f347c5c3a390d7c32b282):
  
  ```
  commit 637c761be1bf9c3e1f0f347c5c3a390d7c32b282
  Author: Steven Liu <liuqi05@kuaishou.com>
  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 <lq@chinaffmpeg.org>
  
  ```
  
  For details, please refer to [SRS HEVC Usage](http://ossrs.io/lts/en-us/docs/v6/doc/hevc#usage).
  
  
  ---
  
  