arut / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
13.45k stars 3.51k forks source link

Bad Streaming Quality at 1080p 60fps #1301

Open dolomats opened 6 years ago

dolomats commented 6 years ago

Hello, Firstable Thanks for this awesome module I really appreciate the effort. I just installed the server today it was easy and it worked like charm, the only issue is the video quality is so bad as you can see here: LINK. Config:

Local VMware VM with centos and nginx + nginx module by following this tutorial HERE

this is the nginx config: rtmp { server { listen 1935; chunk_size 4096;

            application live {
                    live on;
                    record off;
                    push rtmp://live-lis.twitch.tv/app/live_1420kljk075_4NZdfgdfgdgdfgdfgsdfdfgHmFxbAN;
            }
    }

}

I have 100mg Internet and I can stream directly with OBS or Shadowplay at 1080p60fps without problem.

My hardware is fine since I can already stream directly, I have : I7 7700 + 16g Ram + Gtx 1050ti

Any help please?

Smit1237 commented 6 years ago

First of all remove damn twitch key from this issue, anyone can stream to your account Second, what's the resource of vm?

dolomats commented 6 years ago

Thanks for the advice but as u can see it s just a dummy one "gdgdgdgdgdgd"

Smit1237 commented 6 years ago

Didn't notice that last part. My super simple setup for snomix working right now fine( no auto push or other, just a plain rtmp server with one live mountpoint) So there is three possible problems

  1. you don't have resources on vm
  2. your stream is encoded improperly
  3. and maybe this chunk settings is wrong( i'd better try without it) And btw, try to use qsv, far better to offload this work to unused gpu
dolomats commented 6 years ago

1)you don't have resources on vm I was expecting that so I monitored the VM with htop and it was barely used like 10%. 2)your stream is encoded improperly Here is My OBS config : https://imgur.com/a/mkUS8md - NB: The same setting work fine when I stream directly. 3)and maybe this chunk settings is wrong( i'd better try without it) And btw, try to use qsv, far better to offload this work to unused gpu I will try without chunk setting and how and where can I use this qsv you talking about.

Smit1237 commented 6 years ago

QSV is an intel hardware encoder, just install intel driver for intgrated gpu, and choose QSV in a same menu where your choose nvenc, and another potential problem - bitrate, twitch recommend using 6mbps for stream fro non partners, so, try to use this settings. Looks like problem in nginx-rtmp settings

dolomats commented 6 years ago

Thanks For info Just wondering if i need this QSV since i m using a GTX 1050ti !

Smit1237 commented 6 years ago

Absolutley yes, since 1050ti not the most powerful card, i'd prefer to offload this task to unused pice of hardware

dolomats commented 6 years ago

Hi, I did try with QSV and disabled chunk settings but the video quality still bad as you can see HERE

ibizawold commented 6 years ago

OBS, try changing encoder to x264

On Thu, 26 Jul 2018 at 20:40, dolomats notifications@github.com wrote:

Hi, I did try with QSV and disabled chunk settings but the video quality still bad as you can see HERE https://www.twitch.tv/videos/289545278

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/arut/nginx-rtmp-module/issues/1301#issuecomment-408212172, or mute the thread https://github.com/notifications/unsubscribe-auth/ALXSnM6xFrbXTGZ-YqwWtSqPBpk1WJAnks5uKhs3gaJpZM4Vh8uM .

Smit1237 commented 6 years ago

Well i dunno what happens here, need to look at your stream, if you want i can give you access to my server, just push your stream here, and i try to analyze it

dolomats commented 6 years ago

sure we can do that and if u want i can do the same so u can stream on mine to see !

Smit1237 commented 6 years ago

edited, removed url

dolomats commented 6 years ago

streaming On

Smit1237 commented 6 years ago

I see, looks like gpu overloaded i see a framedrops overall stream looks good, you can play it via vlc P.s. recorded a bit of video for further study

Smit1237 commented 6 years ago

yeah fps drops below 60, try to stream 30 or lower resolution

dolomats commented 6 years ago

The stream look very good so it not the pc so it may be the VM ?

Smit1237 commented 6 years ago

VM, or pc from which you streaming, it able to sustain fps ingame but can't in a video, i think gpu is overloaded, saw similar behaviour on 1050ti, nvenc is a dedicated part of gpu but still uses a bit of cuda

Smit1237 commented 6 years ago

i can push a stream to your server but i think the server itself is ok

ibizawold commented 6 years ago

Just for curiosity have you tried changing OBS stream settings to encode-x264 and bitrate-5000.

Rtmp will generally only work well with native x264

On Thu, 26 Jul 2018 at 21:35, dolomats notifications@github.com wrote:

The stream look very good so it not the pc so it may be the VM ?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/arut/nginx-rtmp-module/issues/1301#issuecomment-408226807, or mute the thread https://github.com/notifications/unsubscribe-auth/ALXSnDPua1c7N_flNoMmZEM_OgT-sQDiks5uKigJgaJpZM4Vh8uM .

Smit1237 commented 6 years ago

Lol what? 7700k can't handle game and streaming, i'm streaming with an nvenc, qsv from windows and linux, to twitch and youtube and everything is fine

dolomats commented 6 years ago

Smit1237 Tomorow I will try with a 1060 that normaly should be fine dont you think so !

ibizawold : I will give it a try right now Hold my 🐻 :p

Smit1237 commented 6 years ago

Definetly x264 with no preset(ultrafast) is whorst idea ever

dolomats commented 6 years ago

Lets try it just for the sake of Curiosity

Smit1237 commented 6 years ago

as you wish, but really, set preset ultrafast, even my xeon e5 2683 v3 can't handle a single stream with x264 on presets higher that fast. Btw give me your streaming server address, i try to push a stream to you

ibizawold commented 6 years ago

I would use fast or very fast. Ultra fast will use les cpu but worse results

On Thu, 26 Jul 2018 at 21:43, dolomats notifications@github.com wrote:

Lets try it just for the sake of Curiosity

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/arut/nginx-rtmp-module/issues/1301#issuecomment-408228951, or mute the thread https://github.com/notifications/unsubscribe-auth/ALXSnDRgTgS4UMpVT4l5QTgryWa6Xd-mks5uKinvgaJpZM4Vh8uM .

ibizawold commented 6 years ago

Have u got a url to test

On Thu, 26 Jul 2018 at 21:46, ibizaworld ibizaworld@googlemail.com wrote:

I would use fast or very fast. Ultra fast will use les cpu but worse results

On Thu, 26 Jul 2018 at 21:43, dolomats notifications@github.com wrote:

Lets try it just for the sake of Curiosity

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/arut/nginx-rtmp-module/issues/1301#issuecomment-408228951, or mute the thread https://github.com/notifications/unsubscribe-auth/ALXSnDRgTgS4UMpVT4l5QTgryWa6Xd-mks5uKinvgaJpZM4Vh8uM .

ibizawold commented 6 years ago

Also you have 100mb network, I presume that’s download, what’s your upload ?

On Thu, 26 Jul 2018 at 21:47, ibizaworld ibizaworld@googlemail.com wrote:

Have u got a url to test

On Thu, 26 Jul 2018 at 21:46, ibizaworld ibizaworld@googlemail.com wrote:

I would use fast or very fast. Ultra fast will use les cpu but worse results

On Thu, 26 Jul 2018 at 21:43, dolomats notifications@github.com wrote:

Lets try it just for the sake of Curiosity

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/arut/nginx-rtmp-module/issues/1301#issuecomment-408228951, or mute the thread https://github.com/notifications/unsubscribe-auth/ALXSnDRgTgS4UMpVT4l5QTgryWa6Xd-mks5uKinvgaJpZM4Vh8uM .

Smit1237 commented 6 years ago

https://www.youtube.com/watch?v=Ws3-DQMKv20 this is what recorded no alterations just plain -acodec copy -vcodec copy

dolomats commented 6 years ago

Ibizawold 100mg download, upload it s 11/12mg I think it s enough for streaming 1080p 60fps becoz it work when I stream directly without Rtmp server.

I tried the setting u gave me and i got this : https://www.twitch.tv/videos/289575943

Smit1237 commented 6 years ago

welp, guess this is the answer overloaded gpu, try lowering ingame settings

dolomats commented 6 years ago

I just wached the video, it's bad image quality and laggy as hell unwatchable

ibizawold commented 6 years ago

If your upload is 12mb thenyou have to allow 10% for headroom so that takes it down to 11mb ish.

Your stream is 10mb so that’s just about enough for 1 viewer so if you have more than one viewer then BOOM, not enough.

On Thu, 26 Jul 2018 at 21:57, dolomats notifications@github.com wrote:

Ibizawold 100mg download upload it s 11/12mg I think it s enough for streaming 1080p 60fps becoz it work when I streamù directly without Rtmp server.

I tried the settyying u told me and it gave me this : https://www.twitch.tv/videos/289575943

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/arut/nginx-rtmp-module/issues/1301#issuecomment-408232747, or mute the thread https://github.com/notifications/unsubscribe-auth/ALXSnBwcbwBBhF3CE1eVmea7_TpmNA5Hks5uKi1FgaJpZM4Vh8uM .

ibizawold commented 6 years ago

It will artefact

On Thu, 26 Jul 2018 at 22:00, ibizaworld ibizaworld@googlemail.com wrote:

If your upload is 12mb thenyou have to allow 10% for headroom so that takes it down to 11mb ish.

Your stream is 10mb so that’s just about enough for 1 viewer so if you have more than one viewer then BOOM, not enough.

On Thu, 26 Jul 2018 at 21:57, dolomats notifications@github.com wrote:

Ibizawold 100mg download upload it s 11/12mg I think it s enough for streaming 1080p 60fps becoz it work when I streamù directly without Rtmp server.

I tried the settyying u told me and it gave me this : https://www.twitch.tv/videos/289575943

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/arut/nginx-rtmp-module/issues/1301#issuecomment-408232747, or mute the thread https://github.com/notifications/unsubscribe-auth/ALXSnBwcbwBBhF3CE1eVmea7_TpmNA5Hks5uKi1FgaJpZM4Vh8uM .

Smit1237 commented 6 years ago

he is pushing to my server with 500/500 megs, and the same issue happened, i saw that encoder outputs not stable fps, something around 40-47 fps, sooooo the speed clearly not an issue

ibizawold commented 6 years ago

Wen I used to do all this I used send 720@ 1mb, 1280 @ 1.7mb flawless.

I’d start all res/ bandwidth to see if that cures then up in stages to see where issue lies

On Thu, 26 Jul 2018 at 22:04, Smit1237 notifications@github.com wrote:

he is pushing to my server with 500/500 megs, and the same issue happened, i saw that encoder outputs not stable fps, something around 40-47 fps, sooooo the speed clearly not an issue

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/arut/nginx-rtmp-module/issues/1301#issuecomment-408234638, or mute the thread https://github.com/notifications/unsubscribe-auth/ALXSnLE3GtXdKzT9ArI9RrJBEp-MELqJks5uKi7KgaJpZM4Vh8uM .

dolomats commented 6 years ago

But the viewer are connected to twich or youtube they dosent have nothing to do with my server !

and here is when I stream directly to Twich (See the end of the video) https://www.twitch.tv/videos/289580168?t=01m25s

ibizawold commented 6 years ago

What is twitch bandwidth as they must have a max per users stream

On Thu, 26 Jul 2018 at 22:10, dolomats notifications@github.com wrote:

But the viewer are connected to twich or youtube they dosent have nothing to do with my server !

and here is when I stream directly to Twich (See the end of the video) https://www.twitch.tv/videos/289580168?t=01m25s

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/arut/nginx-rtmp-module/issues/1301#issuecomment-408236301, or mute the thread https://github.com/notifications/unsubscribe-auth/ALXSnJi68ec6zbOm856ApimG20IZhj-Tks5uKjBWgaJpZM4Vh8uM .

ibizawold commented 6 years ago

https://stream.twitch.tv/encoding/

On Thu, 26 Jul 2018 at 22:14, ibizaworld ibizaworld@googlemail.com wrote:

What is twitch bandwidth as they must have a max per users stream

On Thu, 26 Jul 2018 at 22:10, dolomats notifications@github.com wrote:

But the viewer are connected to twich or youtube they dosent have nothing to do with my server !

and here is when I stream directly to Twich (See the end of the video) https://www.twitch.tv/videos/289580168?t=01m25s

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/arut/nginx-rtmp-module/issues/1301#issuecomment-408236301, or mute the thread https://github.com/notifications/unsubscribe-auth/ALXSnJi68ec6zbOm856ApimG20IZhj-Tks5uKjBWgaJpZM4Vh8uM .

dolomats commented 6 years ago

So want me try with this setting :

Technical Specs:

Vertical Resolution: 1080

Bitrate: 4500 to 6000 kbps

Framerate: 60 or 50 fps

Keyframe Interval: 2 seconds

AVC (h.264) Profile: Main/High

AVC (h.264) Level: 4.2

dolomats commented 6 years ago

Smit1237, I changed the ingame setting from very high to medium and yet still got this result

https://www.twitch.tv/videos/289585877

here is my stream server : REMOVED

ibizawold commented 6 years ago

See what the output is

On Thu, 26 Jul 2018 at 22:22, dolomats notifications@github.com wrote:

So want me try with this setting :

Technical Specs:

Vertical Resolution: 1080

Bitrate: 4500 to 6000 kbps

Framerate: 60 or 50 fps

Keyframe Interval: 2 seconds

AVC (h.264) Profile: Main/High

AVC (h.264) Level: 4.2

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/arut/nginx-rtmp-module/issues/1301#issuecomment-408239111, or mute the thread https://github.com/notifications/unsubscribe-auth/ALXSnDPglEhVeUM1pthWf-Xl0oEj-MQmks5uKjL8gaJpZM4Vh8uM .

ibizawold commented 6 years ago

That’s an internal up address so the outside world can’t connect

On Thu, 26 Jul 2018 at 22:26, dolomats notifications@github.com wrote:

Smit1237, I changed the ingame setting from very high to medium and yet still got this result

here is my stream server : rtmp://192.168.20.63/live/test

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/arut/nginx-rtmp-module/issues/1301#issuecomment-408240144, or mute the thread https://github.com/notifications/unsubscribe-auth/ALXSnNSkVH0tf-XUyGPeGzijTvBYFjChks5uKjP1gaJpZM4Vh8uM .

dolomats commented 6 years ago

lol sry got confused; her is teh right one

REMOVED

Smit1237 commented 6 years ago

streaming check it

ibizawold commented 6 years ago

Need set port forward in yer router

On Thu, 26 Jul 2018 at 22:44, Smit1237 notifications@github.com wrote:

private adress, we can't access it

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/arut/nginx-rtmp-module/issues/1301#issuecomment-408244660, or mute the thread https://github.com/notifications/unsubscribe-auth/ALXSnPQBl4W8JTp3zjAr5NwO7lkgmLU1ks5uKjhLgaJpZM4Vh8uM .

dolomats commented 6 years ago

it s working

ibizawold commented 6 years ago

Yeh on now

On Thu, 26 Jul 2018 at 22:47, dolomats notifications@github.com wrote:

it s working

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/arut/nginx-rtmp-module/issues/1301#issuecomment-408245262, or mute the thread https://github.com/notifications/unsubscribe-auth/ALXSnFQrYX5S1nwBRP_zAKrH5bj1XEwGks5uKjjfgaJpZM4Vh8uM .

dolomats commented 6 years ago

seems somthing from the server becoz your stream is also laggy

Smit1237 commented 6 years ago

yep, i saw, 20 fps incoming , nvm

dolomats commented 6 years ago

here is your stream : https://www.twitch.tv/videos/289595301##