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

v4.x support hevc(h.265) RTMP streaming #1721

Closed
wants to merge 17 commits into from

Conversation

wnpllrzodiac
Copy link
Contributor

support hevc(h.265) RTMP streaming
codecID 12

@wnpllrzodiac
Copy link
Contributor Author

rtmp/http-flv/hls test passed.
Notice that hls config MUST add line "hls_vcodec" to specify video codec is hevc

hls {
        enabled         on;
        hls_vcodec      hevc;
        hls_fragment    10;
        hls_window      60;
        hls_path        ./objs/nginx/html;
        hls_m3u8_file   [app]/[stream].m3u8;
        hls_ts_file     [app]/[stream]-[seq].ts;
    }

@codecov-io
Copy link

codecov-io commented Apr 24, 2020

Codecov Report

Merging #1721 into develop will decrease coverage by 0.29%.
The diff coverage is 17.22%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1721      +/-   ##
===========================================
- Coverage    52.88%   52.59%   -0.30%     
===========================================
  Files           82       82              
  Lines        26618    26787     +169     
===========================================
+ Hits         14078    14089      +11     
- Misses       12540    12698     +158     

| Impacted Files | Coverage Δ | |'

'| Impacted Files | Coverage Δ | |
|---|---|---|
| trunk/src/app/srs_app_dvr.cpp | 0.00% <0.00%> (ø) | |
| trunk/src/app/srs_app_hls.cpp | 0.00% <0.00%> (ø) | |
| trunk/src/app/srs_app_source.cpp | 0.67% <0.00%> (-0.01%) | ⬇️ |
| trunk/src/app/srs_app_statistic.cpp | 0.00% <0.00%> (ø) | |
| trunk/src/kernel/srs_kernel_codec.cpp | 76.13% <16.88%> (-19.26%) | ⬇️ |
| trunk/src/kernel/srs_kernel_ts.cpp | 81.26% <29.41%> (-1.11%) | ⬇️ |
| trunk/src/core/srs_core_autofree.hpp | 100.00% <0.00%> (+11.11%) | ⬆️ |


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 856ed5a...277993b. Read the comment docs.

TRANS_BY_GPT3

@wnpllrzodiac
Copy link
Contributor Author

ts encode and pmt encode utest failed
BUT stream play test well.

Neet some one to do code review to help fix utest problem.

@winlinvip
Copy link
Member

winlinvip commented Apr 24, 2020

Like first, then watch, hahaha 👍

TRANS_BY_GPT3

@LustFairy
Copy link

666

@winlinvip winlinvip changed the base branch from 3.0release to develop April 25, 2020 08:58
@winlinvip
Copy link
Member

winlinvip commented Apr 25, 2020

@wnpllrzodiac, could you please provide some additional information on the Usage? Can VLC or FFplay be used to play 265 over HLS? Do we need to patch ffplay for 265 over FLV/RTMP? Could you please add the Usage details? This way, everyone will know how to use it once it's merged.

TRANS_BY_GPT3

@wnpllrzodiac wnpllrzodiac changed the title V3.0.134 support hevc(h.265) RTMP streaming v4.x support hevc(h.265) RTMP streaming Apr 26, 2020
@wnpllrzodiac
Copy link
Contributor Author

wnpllrzodiac commented Apr 26, 2020

Patch FFmpeg

About ffplay with hecv-rtmp/flv player, please read https://github.com/young-I/CDN-Union_H265

About ffmpeg/ffplay build, please read https://github.com/wnpllrzodiac/FFmpeg

git clone -b n3.2.4_hevc_flv https://github.com/wnpllrzodiac/FFmpeg
cd FFmpeg
./configure --ADD_YOUR_FFMPEG_BUILD_PARAMS

SRS

./objs/srs -c conf/hevc.conf

Notice: could add "hls_vcodec" option "h264" or "hevc"(not Mandatory)

publish

Publish stream by (my ffmpeg hecv branch ONLY support codec copy publish)

ffmpeg -re -i test_hevc.mp4 -c copy -f flv rtmp://192.168.1.1/slive/ggg

play

  • RTMP: ffplay rtmp://192.168.1.1/slive/ggg
  • HTTP-FLV: ffplay http://192.168.1.1:8080/slive/ggg.flv
  • HLS: ffplay http://192.168.1.1:8080/slive/ggg.m3u8
 Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2mp41
Lavf57.56.101       :     nan    :  0.000 fd=   0 aq=    0KB vq=    0KB sq=    0B f=0/0
  Duration: N/A, start: 0.083000, bitrate: N/A
    Stream #0:0: Audio: aac (LC), 48000 Hz, stereo, fltp
    Stream #0:1: Video: hevc (Main), yuv420p(tv), 720x480, 24.42 fps, 23.98 tbr, 1k tbn, 23.98 tbc
   1.72 M-V:  0.000 fd=   0 aq=    0KB vq=  120KB sq=    0B f=0/0

@codecov-commenter
Copy link

codecov-commenter commented May 22, 2020

Codecov Report

Merging #1721 into develop will decrease coverage by 0.29%.
The diff coverage is 17.30%.

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #1721      +/-   ##
===========================================
- Coverage    52.88%   52.59%   -0.30%     
===========================================
  Files           82       82              
  Lines        26618    26786     +168     
===========================================
+ Hits         14078    14088      +10     
- Misses       12540    12698     +158     

| Impacted Files | Coverage Δ | |'

'| Impacted Files | Coverage Δ | |
|---|---|---|
| trunk/src/app/srs_app_dvr.cpp | 0.00% <0.00%> (ø) | |
| trunk/src/app/srs_app_hls.cpp | 0.00% <0.00%> (ø) | |
| trunk/src/app/srs_app_source.cpp | 0.67% <0.00%> (-0.01%) | ⬇️ |
| trunk/src/app/srs_app_statistic.cpp | 0.00% <0.00%> (ø) | |
| trunk/src/kernel/srs_kernel_codec.cpp | 76.25% <16.99%> (-19.14%) | ⬇️ |
| trunk/src/kernel/srs_kernel_ts.cpp | 81.26% <29.41%> (-1.11%) | ⬇️ |
| trunk/src/service/srs_service_utility.cpp | 77.84% <0.00%> (ø) | |

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 856ed5a...e5b72aa. Read the comment docs.

TRANS_BY_GPT3

@winlinvip
Copy link
Member

winlinvip commented Jun 14, 2020

Thank you very much @wnpllrzodiac for submitting the Patch for 265. This PR enables RTMP to support h.265. Additionally, there is another PR #1747 that supports a more comprehensive protocol.

I will first merge 265 into the feature/h265 branch, and in the future, I will consider merging it into develop. Students who need it can easily merge it into their own SRS branches.

TRANS_BY_GPT3

@ziyue7575
Copy link

ziyue7575 commented Dec 12, 2020

May I ask why after using the h256 branch, adding hls_vcodec hevc; in hls, it still does not support h264 playback?

vhost __defaultVhost__ {

    http_remux {
        enabled on;
        mount [vhost]/[app]/[stream].flv;
    }
    hls {
        enabled on;
        hls_path ./objs/nginx/html;
        hls_vcodec      hevc;
        hls_fragment 10;
        hls_window 60;
    }
    rtc {
        enabled on;
        bframe discard;
    }
    dvr {
        enabled on;
        dvr_apply all;
        dvr_path /usr/local/srs/srs/trunk/objs/nginx/dvr/defaultVhost/[2006]/[01]/[02]/[app]/[stream]/[timestamp].flv;
        dvr_plan session;
        time_jitter full;
    }
}

TRANS_BY_GPT3

@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TransByAI Translated by AI/GPT.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants