koush / scrypted

Scrypted is a high performance video integration and automation platform
https://scrypted.app
Other
4.21k stars 248 forks source link

Setting Transcoding Remote Streaming Bitrate doesn't "stick" #522

Closed sgruby closed 3 months ago

sgruby commented 1 year ago

Scrypted 0.5.11

  1. Go into Settings
  2. Click on Transcoding
  3. Change Remote Streaming Bitrate to 250000
  4. Start remote streaming session in HomeKit
  5. Live stream plays fine.

Log shows correct maxrate of 250000.

rt tcp -f rtsp -i rtsp:[REDACTED] -c:v libx264 -pix_fmt yuvj420p -preset ultrafast -bf 0 -filter_complex scale=w='min(1280,iw)':h=-2 -b:v 250000 -bufsize 500000 -maxrate 250000 -g 120 -r 30 -payload_type 99 -ssrc 4228866 -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params rCVGpGS9aO6+i+5dZ6Ad+SPFs9mMzsjflAcVBMOg -dn -sn -an -f rtp srtp://10.0.1.115:65017?rtcpport=65017&pkt_size=1378 -acodec libopus -application lowdelay -frame_duration 60 -flags +global_header -ar 24k -b:a 24k -bufsize 96k -ac 1 -payload_type 110 -ssrc 11254415 -dn -sn -vn -f rtp rtp://127.0.0.1:49852?pkt_size=400 -sdp_file pipe:4

  1. Stop streaming.
  2. Go into settings.
  3. Click transcoding.
  4. See Remote Streaming Bitrate reset to 1000000.
  5. Start remote streaming session.

In log see that maxrate is 1000000:

an 19 07:24:13 cameras-internal npx[3193533]: [Living Room] -hide_banner -analyzeduration 0 -probesize 500000 -reorder_queue_size 0 -rtsp_transport tcp -f rtsp -i rtsp:[REDACTED] -c:v libx264 -pix_fmt yuvj420p -preset ultrafast -bf 0 -filter_complex scale=w='min(1280,iw)':h=-2 -b:v 1000000 -bufsize 2000000 -maxrate 1000000 -g 120 -r 30 -payload_type 99 -ssrc 15985091 -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params MlnI197a+ma37aRQEDZooVOYe03wlzsFckxyHc7S -dn -sn -an -f rtp srtp://10.0.1.115:53789?rtcpport=53789&pkt_size=1378 -acodec libopus -application lowdelay -frame_duration 60 -flags +global_header -ar 24k -b:a 24k -bufsize 96k -ac 1 -payload_type 110 -ssrc 676499 -dn -sn -vn -f rtp rtp://127.0.0.1:44012?pkt_size=400 -sdp_file pipe:4

At this point, my remote stream doesn't consistently play.

sgruby commented 1 year ago

If I change the setting, hit save and then immediately restart the server, the setting "sticks" and my remote stream consistently plays.

koush commented 1 year ago

I was unfortunately unable to reproduce this but I'll take a look again.

sgruby commented 1 year ago

Thanks for taking a look!

ThatsOurJake commented 1 year ago

👋🏻 - I have a similar issue but not the bitrate but setting changing the encoding arguments to Nvidia or any options for the matter. The websocket accepts the request and gives the successful response back which updates the UI. However when the settings are refetched the original settings are there.

oOblik commented 12 months ago

I am also having the same issue as @ThatsOurJake

leankuroneko commented 10 months ago

Seems like I'm on the same boat, am I? Video_2023_12_09-1.webm

If there's any way to provide logs just tell me!

koush commented 3 months ago

fixed with new server release 0.114.0