Skip to content

[Enhancement] Optimize playback buffering for challenging network conditions #4

@jmhunter83

Description

@jmhunter83

Description

A beta tester reported major stuttering and bitrate issues during playback when using a proxy server. While this specific case was likely environment-related (unfamiliar proxy server), it highlights an opportunity to review and potentially improve buffering behavior for users with challenging network conditions.

Current Implementation

VLC is configured with the following buffer settings in MediaPlayerProxy+VLC.swift:

configuration.options = [
    "network-caching": 5000,     // 5 seconds network buffer
    "file-caching": 5000,        // 5 seconds file buffer
    "live-caching": 5000,        // 5 seconds live stream buffer
    "clock-jitter": 0,           // Disabled
    "clock-synchro": 0,          // Disabled
]

The transcoding profile uses:

  • minSegments: 2 for HLS streaming
  • Auto bitrate detection via network speed test

Potential Improvements

  1. User-adjustable buffer settings - Allow users with poor connections to increase buffer sizes
  2. Adaptive buffering - Dynamically adjust buffer size based on network conditions
  3. Higher minimum segments - Increase minSegments from 2 to reduce re-buffering
  4. Bitrate test improvements - More accurate network speed testing for auto bitrate selection
  5. Documentation - Document existing settings users can adjust for playback issues

Affected Files

  • Shared/Objects/MediaPlayerManager/MediaPlayerProxy/MediaPlayerProxy+VLC.swift
  • Shared/Objects/PlaybackBitrate/PlaybackBitrate.swift
  • Swiftfin tvOS/Views/SettingsView/PlaybackQualitySettingsView.swift

Context

Beta tester Harrison reported stuttering when using a proxy server they hadn't used before (couldn't connect to their normal HTTP server). The stuttering is likely due to the proxy adding latency, but this feedback provides a good opportunity to review buffering behavior.

Reporter

Beta tester Harrison (VID3, IMG2-4 in feedback)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions