Skip to content

Codec Settings

Koushik Dutta edited this page Nov 25, 2022 · 18 revisions

These following codec settings are the optimal settings for streaming destinations within Scrypted. Streaming destinations include:

  • HomeKit
  • Google Home
  • Alexa
  • Chromecast
  • Web

Stream Setup

  • Configure all the available streams on your camera. Most cameras will have one 1 main stream and 1 substream. Some may only have 1 main stream. Cameras with 1 main stream and 2 sub streams are ideal.
    • Some cameras, such as Hikvision or Amcrest, allow more stream options when AI is disabled. The camera AI is not used within Scrypted, and can be disabled for better performance.

1 Main Stream

  • Main Stream
    • 1920x1080, 2 Mbit variable bitrate (remote streaming may suffer due to lack of sub streams)

1 Main Stream, 1 Sub Stream

  • Main Stream (Max Available Resolution):
    • 3840x2160, 8 Mbit variable bitrate
    • 2688x1520, 3.5 Mbit variable bitrate
    • 1920x1080, 2 Mbit variable bitrate
  • Sub Stream:
    • 1280x720 (or lower), 1 Mbit, variable bitrate

1 Main Stream, 2 Sub Streams

  • Main Stream (Max Available Resolution):
    • 3840x2160, 8 Mbit variable bitrate
    • 2688x1520, 3.5 Mbit variable bitrate
    • 1920x1080, 2 Mbit variable bitrate
  • Sub Stream 1 or 2:
    • 1280x720, 1 Mbit, variable bitrate
  • Sub Stream 1 or 2:
    • 640x360, 500 Kbit variable bitrate

Configure Stream Codecs

  • These settings apply for all the above streams.
  • h264 video. Do NOT use H.264+, "Super" H.264, H.264B, or any other fancy variant. TURN IT OFF. Sometimes this unsupported variant setting is called "Smart Code(c)" and it should be set to "Close" or "Off".
  • Any FPS between 10 and 30 is fine, and available FPS may depend on the camera and will determine the Frame Interval.
  • 4 second keyframe interval
    • Keyframe Interval is the number of seconds between keyframes. Frame Interval is the number frames between keyframes.
    • Cameras are typically configured in Frame Interval rather than Keyframe Interval. The formula for Frame Interval value is: Frame Interval = 4 * FPS. Examples:
      • If FPS is 30, Frame Interval should be set to 120.
      • If FPS is 20, Frame Interval should be set to 80.
      • If FPS is 10, Frame Interval should be set to 40.
  • Audio codecs, in order of preference:
    • Opus (used for live streaming to HomeKit or web)
    • PCM-ulaw/G711u (raw format suitable for web)