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

Is it possible to support OBS publish HEVC stream over rtmp ? #3464

Closed
cochiachang opened this issue Mar 13, 2023 · 18 comments · Fixed by #3495
Closed

Is it possible to support OBS publish HEVC stream over rtmp ? #3464

cochiachang opened this issue Mar 13, 2023 · 18 comments · Fixed by #3495
Assignees
Labels
Codec HEVC, FFmpeg for ingesting, trascoding or codec. EnglishNative This issue is conveyed exclusively in English. Enhancement Improvement or enhancement. Feature It's a new feature.

Comments

@cochiachang
Copy link

cochiachang commented Mar 13, 2023

Description

Note that SRS already has HEVC over SRT/HLS/HTTP-TS/WebRTC support, see #465

  1. SRS Version: 6.0.10

  2. SRS Log:

[2023-03-13 19:13:35.025][INFO][4274][52f90744] RTMP client ip=172.16.50.225:52391, fd=83
[2023-03-13 19:13:35.028][INFO][4274][52f90744] simple handshake success.
[2023-03-13 19:13:35.029][INFO][4274][52f90744] connect app, tcUrl=rtmp://172.16.46.87/live, pageUrl=, swfUrl=rtmp://172.16.46.87/live, schema=rtmp, vhost=172.16.46.87, port=1935, app=live, args=null
[2023-03-13 19:13:35.029][INFO][4274][52f90744] protocol in.buffer=0, in.ack=0, out.ack=0, in.chunk=4096, out.chunk=128
[2023-03-13 19:13:35.103][INFO][4274][52f90744] client identified, type=fmle-publish, vhost=172.16.46.87, app=live, stream=test, param=, duration=0ms
[2023-03-13 19:13:35.103][INFO][4274][52f90744] connected stream, tcUrl=rtmp://172.16.46.87/live, pageUrl=, swfUrl=rtmp://172.16.46.87/live, schema=rtmp, vhost=__defaultVhost__, port=1935, app=live, stream=test, param=, args=null
[2023-03-13 19:13:35.103][INFO][4274][52f90744] source url=/live/test, ip=172.16.50.225, cache=1/2500, is_edge=0, source_id=/im03rm66
[2023-03-13 19:13:35.161][INFO][4274][52f90744] RTC bridge from RTMP, rtmp2rtc=0, keep_bframe=0, merge_nalus=0
[2023-03-13 19:13:35.162][INFO][4274][52f90744] hls: win=60000ms, frag=10000ms, prefix=, path=./objs/nginx/html, m3u8=[app]/[stream].m3u8, ts=[app]/[stream]-[seq].ts, aof=2.00, floor=0, clean=1, waitk=1, dispose=0ms, dts_directly=1
[2023-03-13 19:13:35.162][INFO][4274][52f90744] ignore disabled exec for vhost=__defaultVhost__
[2023-03-13 19:13:35.162][INFO][4274][52f90744] start publish mr=0/350, p1stpt=20000, pnt=5000, tcp_nodelay=0
[2023-03-13 19:13:35.208][INFO][4274][52f90744] got metadata, width=800, height=450, vcodec=7, acodec=10
[2023-03-13 19:13:35.530][INFO][4274][52f90744] 7B audio sh, codec(10, profile=LC, 2channels, 0kbps, 48000HZ), flv(16bits, 2channels, 44100HZ)
  1. SRS Config:

same as hevc.flv.conf

Replay

Step 1: Publish stream from OBS v29.0.2, and select encoder QuickSync HEVC
obs setting

Step 2: Start Streaming to SRS server

Step 3: SRS console can see this stream but can not get stream type, and can not play

console

Expect

I can see HEVC format video in srs v6.0.10 from publish stream by ffmpeg, but can not see stream if publish from OBS, and I can publish HEVC format by OBS to youtube, and it is normal.
I expect to use OBS to stream in SRS should also be able to play.

@winlinvip
Copy link
Member

Make sense! Could you please join the discord and we need some help from you, about the environment setup.

@winlinvip winlinvip self-assigned this Mar 14, 2023
@winlinvip winlinvip added Enhancement Improvement or enhancement. Feature It's a new feature. Codec HEVC, FFmpeg for ingesting, trascoding or codec. labels Mar 14, 2023
@GekkaSaori

This comment was marked as off-topic.

@winlinvip

This comment was marked as outdated.

@winlinvip

This comment was marked as outdated.

@cochiachang

This comment was marked as outdated.

@cochiachang

This comment was marked as outdated.

@flying1314
Copy link

flying1314 commented Mar 28, 2023

OBS will support AV1、HEVC over RTMP, see this PR, it has been merged, and will be released in OBS 29.1
obsproject/obs-studio#8522

@flying1314

This comment was marked as outdated.

@winlinvip
Copy link
Member

winlinvip commented Mar 31, 2023

@flying1314 Thanks.

obsproject/obs-studio#8522
Enable AV1, HEVC via RTMP to YouTube #8522

Please note that OBS also support RTMP HEVC in OBS 29.1, so SRS will also follow this standard.

Video FourCC
AV1 = { 'a', 'v', '0', '1' } 
VP9 = { 'v', 'p', '0', '9' } 
HEVC = { 'h', 'v', 'c', '1' }

Captured by wireshark is here: obs-hevc-rtmp-29.1.pcapng.zip

rtmp-hevc

SRS will support OBS 29.1 to push HEVC via RTMP, please note that previous verisoned OBS is not supported.

Note: Old versions of OBS supported HEVC via RTMP but with bugs, the codecid is duplicated to AVC.

@cochiachang

This comment was marked as outdated.

@wsy
Copy link

wsy commented Jul 15, 2024

Hi @winlinvip ,
I'm using OBS30.1.2 to stream over RTMP.
I tried both SRS 5.x and SRS 6.x with both Docker(Ubuntu) and Windows. With all four combinations, I cannot stream QSV HEVC nor NVEnc HEVC.
image

Is there anything I can do to see what went wrong?

@Docteh
Copy link

Docteh commented Jul 15, 2024

I got odd errors with OBS 29.0.2, and so I blindly accepted upgrade to OBS 30.2.0 this version works.
image

publishing with RTMP, NVENC on GTX1080

@wsy
Copy link

wsy commented Jul 16, 2024

I got odd errors with OBS 29.0.2, and so I blindly accepted upgrade to OBS 30.2.0 this version works. image

publishing with RTMP, NVENC on GTX1080

Hi @Docteh ,
I upgraded to OBS30.2.0, and I still cannot use HEVC, nor NVEnc. I have i7 6700k with RTX2080.
Can you please share you detailed configuration?

I tried with OBS30.1.2 and OBS30.2.0, the results are the same:

Codec SRS5.exe SRS6.exe SRS5Docker SRS6Docker
CPU x264 Work Work Work Work
QSV H264 Work Work Work Work
QSV HEVC No No No No
NVEnc H264 No No No No
NVEnc HEVC No No No No

In the console log of SRS, there's nothing but regular CPU usage report.
image

@Docteh
Copy link

Docteh commented Jul 16, 2024

Not sure what sort of detail you need. When I connect with OBS I see this pop up in the log. The CPU usage updates can cause it to scroll past quickly
image

This is what OBS is told under Output
image

For config on SRS 6.x I am using http.ts.live.conf

@wsy
Copy link

wsy commented Jul 18, 2024

Not sure what sort of detail you need. When I connect with OBS I see this pop up in the log. The CPU usage updates can cause it to scroll past quickly

image

This is what OBS is told under Output

image

For config on SRS 6.x I am using http.ts.live.conf

Hi,
Thanks for your information.
I tried 'http.ts.live.conf' and OBS configuration such as 'CQP' instead of 'VBR', but still no luck.

As of the 'CPU Update' log, it's a 2-line log and it's generated every five seconds. So nothing would slip away.

@Docteh
Copy link

Docteh commented Jul 20, 2024

So what does the SRS log show on your end? If its not showing even an RTMP connection, its likely that the problem is within OBS, or maybe a firewall

The mere act of a TCP connection on port 1935, via something like OBS or telnet seems to print something to the log

[2024-07-20 14:48:58.166][INFO][1387][n796b84f] RTMP client ip=127.0.0.1:55166, fd=9

@wsy
Copy link

wsy commented Jul 21, 2024

If its not showing even an RTMP connection, its likely that the problem is within OBS, or maybe a firewall

I don't think it's firewall problem. Because I can stream with Intel QSV and H264.

[2024-07-20 14:48:58.166][INFO][1387][n796b84f] RTMP client ip=127.0.0.1:55166, fd=9

I will try to find the log file instead of the console log and see if there's anything related to tcp connection.

@wsy
Copy link

wsy commented Jul 24, 2024

Hi Docteh,
Thanks for your idea. I re-checked my network configuration. It's indeed networking problem.
I can now stream with NVEnc or HEVC. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Codec HEVC, FFmpeg for ingesting, trascoding or codec. EnglishNative This issue is conveyed exclusively in English. Enhancement Improvement or enhancement. Feature It's a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants