Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H265: FFmpeg support HEVC over RTMP, etc. #2562

Closed
limjoe opened this issue Aug 30, 2021 · 12 comments
Closed

H265: FFmpeg support HEVC over RTMP, etc. #2562

limjoe opened this issue Aug 30, 2021 · 12 comments
Assignees
Labels
Codec HEVC, FFmpeg for ingesting, trascoding or codec. Feature It's a new feature. TransByAI Translated by AI/GPT.
Milestone

Comments

@limjoe
Copy link

limjoe commented Aug 30, 2021

Dup to #465

@winlinvip winlinvip added the Feature It's a new feature. label Aug 30, 2021
@winlinvip winlinvip added this to the SRS 5.0 release milestone Aug 30, 2021
@winlinvip
Copy link
Member

winlinvip commented Aug 30, 2021

This could be two questions:

  1. FFmpeg requires a special version.
  2. Edge may need to support H.265.

TRANS_BY_GPT3

@winlinvip winlinvip added the Codec HEVC, FFmpeg for ingesting, trascoding or codec. label Aug 30, 2021
@limjoe

This comment has been minimized.

@retamia
Copy link
Contributor

retamia commented Aug 31, 2021

FFmpeg's avformat does not support custom codec IDs like H.265 in flv. You can refer to this link for modification:
https://github.com/VCDP/CDN/blob/master/FFmpeg_patches/0001-Add-SVT-HEVC-FLV-support-on-FFmpeg.patch

TRANS_BY_GPT3

@limjoe

This comment has been minimized.

@limjoe

This comment was marked as outdated.

@crazymxm
Copy link

crazymxm commented Sep 1, 2021

The problem is, even if it is resolved, can the server handle the load when using ffmpeg (CPU situation) to convert 10 streams simultaneously (h265->h264)?

TRANS_BY_GPT3

@runner365
Copy link
Contributor

runner365 commented Sep 1, 2021

It seems like your problem is about ffmpeg wanting to include flv support for h265. Refer to this link to compile ffmpeg4.1 by yourself: https://github.com/runner365/ffmpeg_rtmp_h265

The fearue/h265 branch of SRS supports h265 in flv. Are there any issues with h265 in the SRS streaming media server?

TRANS_BY_GPT3

@limjoe
Copy link
Author

limjoe commented Sep 1, 2021

@runner365 The srs feature/h265 can successfully receive H.265 streams and also distribute FLV and RTMP H.265 streams without any issues.

Currently, I want to configure the transcode feature to convert the incoming H.265 stream into an additional H.264 stream. When compiling the srs feature/h265 branch, I added the --ffmpeg-tool=on parameter. However, the compiled objs/ffmpeg/bin/ffmpeg does not support H.265. So, I manually compiled a version of FFmpeg from Kingsoft Cloud and plan to use this compiled FFmpeg for transcoding in transcode.

TRANS_BY_GPT3

@limjoe
Copy link
Author

limjoe commented Sep 1, 2021

@limjoe The problem is, even if it is resolved, can the server handle the load of converting 10 streams simultaneously with ffmpeg (CPU situation) (h265->h264) on the server side?

My internet monitoring scenario involves a large number of streams being pushed, but very few streams being pulled or hardly anyone watching them normally.

@crazymxm What I have in mind is to use the originCluster mode, where transcoding at the Edge side will only be done on-demand when someone is watching the stream (i.e., transcoding will only be done when there are viewers). We just need to add machines on the server side, and we will use GPUs or dedicated NETINT transcoding cards for the transcoding process.

TRANS_BY_GPT3

@limjoe

This comment was marked as outdated.

@limjoe
Copy link
Author

limjoe commented Sep 2, 2021

H265 transcoding consumes a lot of CPU resources. Adjusting ffmpeg parameters can reduce the latency of transcoded streaming playback.

transcode live {
        enabled     on;
        ffmpeg      /usr/local/srs/objs/FFmpeg/ffmpeg;
        engine h265{
            enabled     on;
            iformat     flv;
            vcodec          libx264;
            vthreads        2;
            vprofile        baseline;
            vpreset         veryfast;
            acodec          copy;
            oformat         flv;
            output          rtmp://127.0.0.1:[port]/[app]?vhost=[vhost]/[stream]_[engine];
        }
    }

TRANS_BY_GPT3

@jinleileiking

This comment was marked as off-topic.

@ossrs ossrs locked as too heated and limited conversation to collaborators Jan 13, 2022
@winlinvip winlinvip changed the title H265: FFMPEG 对 H265 的 RTMP 直播流转码支持 H265: FFmpeg support HEVC over RTMP ,etc. Nov 22, 2022
@winlinvip winlinvip changed the title H265: FFmpeg support HEVC over RTMP ,etc. H265: FFmpeg support HEVC over RTMP, etc. Nov 22, 2022
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Codec HEVC, FFmpeg for ingesting, trascoding or codec. Feature It's a new feature. TransByAI Translated by AI/GPT.
Projects
None yet
Development

No branches or pull requests

6 participants