0

I am using nginx with ffmpeg to stream my live stream and i want to reduce the resolution of it, but it plays the video in high quality everytime

here's my nginx code

events {}
rtmp {
    server {
        listen 1935;

    application src {
        live on;
        exec_push ffmpeg -vcodec libx264 -vprofile baseline -g 10 -s 300x200 -acodec aac -ar 44100 -ac 1 -f flv rtmp://127.0.0.1/live;
        
    }


        application live {
            live on;

            #turn on hls
            hls on;
            hls_continuous on;
            hls_path /tmp/hls/ ;
            hls_fragment 4s;
            hls_playlist_length 12s;
            hls_nested on;
            record off;

            #disable stream consumption from rtmp

            on_publish http://auth_server:4000/auth;
         }

    }
}
8f7an
  • 1
  • 2

1 Answers1

0

hls_continuous on; makes nginx rtmp store previous streams and always start from the beginning, you are likely seeing your original streams from before you added the video scaling.

Try setting hls_continuous off; You might also want to manually confirm if there are any old video fragments inside /tmp/hls

Otherwise your config looks good -s 300x200 is the correct parameter for controlling video resolution.

Baa
  • 438
  • 3
  • 7
  • 22
  • yeah i've changed the settings as you've told, and restarted the stream and even checked if the /tmp/hls files are empty, i simply dont see a resolution change, i dont understand why? – 8f7an Aug 10 '22 at 16:40