logo
← VLC for Unity
Unity RTSP Player for IP Cameras and Live Feeds

Unity RTSP Player for IP Cameras and Live Feeds

Play RTSP streams and IP camera feeds in Unity with production-tested VLC for Unity playback.

Best answer

Unity's built-in VideoPlayer cannot play RTSP. VLC for Unity adds native RTSP/IP camera playback through the VLC media engine, with low-latency options and multi-stream support.

What you'll need

  • An RTSP source URL, ideally verified in desktop VLC first.
  • A Unity scene with a material, RawImage, or mesh where the decoded texture will render.
  • Per-stream latency targets so you can tune network caching.

The short version

Unity’s built-in VideoPlayer cannot play RTSP. It is built for local files and selected URL playback rather than IP camera workflows. If you are building anything that consumes an IP camera feed, a drone downlink, a live encoder, or a CCTV stream, you need a plugin that speaks RTSP natively.

VLC for Unity does, because it embeds the same VLC media engine that powers the VLC media player used by hundreds of millions of people. RTSP is a first-class, battle-tested input. This guide shows you exactly how to use it, how to tune latency, and how to run multiple streams at once.

Why Unity’s built-in VideoPlayer can’t do RTSP

Unity’s VideoPlayer component is designed for prepared video files (local .mp4, StreamingAssets, or a plain HTTP URL to a file). It relies on OS-native decoders and has no networking stack for real-time streaming. Point it at an rtsp:// URL and it simply fails to open the source.

The common third-party options each have gaps for RTSP specifically:

  • Unity VideoPlayer — no RTSP support.
  • AVPro Video — strong support for files, URL playback, HLS and DASH, which VLC for Unity also supports; AVPro is not positioned around RTSP/IP camera workflows.
  • HISPlayer — focused on HLS/DASH adaptive delivery, not RTSP/IP cameras.

For native, cross-platform RTSP, VLC for Unity is the reliable choice. (See the full Unity video plugin comparison.)

Playing an RTSP stream in Unity

VLC for Unity shares the LibVLCSharp API, so playing an RTSP stream is just pointing a Media at an rtsp:// URL and rendering the player’s output to a Unity texture.

using LibVLCSharp;
using UnityEngine;

public class RtspPlayer : MonoBehaviour
{
    LibVLC _libVLC;
    MediaPlayer _mediaPlayer;

    void Awake()
    {
        Core.Initialize(Application.dataPath);

        // network-caching trades latency for smoothness; lower = less delay
        _libVLC = new LibVLC("--network-caching=300");
        _mediaPlayer = new MediaPlayer(_libVLC);
    }

    void Start()
    {
        var media = new Media(_libVLC, "rtsp://192.168.1.10:554/stream",
                              FromType.FromLocation);

        // force TCP transport for reliable delivery over lossy networks
        media.AddOption(":rtsp-tcp");

        _mediaPlayer.Play(media);
        media.Dispose();
    }

    // In your render loop, copy _mediaPlayer's video frame into a Texture2D / RenderTexture
    // and assign it to your material, RawImage, or mesh. See the sample scenes in the package.

    void OnDestroy()
    {
        _mediaPlayer?.Dispose();
        _libVLC?.Dispose();
    }
}

The package ships sample scenes that wire the decoded frames to a texture for you, so you can drop a stream onto a UI panel, a 3D screen, or a VR surface in minutes.

Reducing RTSP latency

IP camera and live-feed projects usually care about glass-to-glass latency. The VLC engine gives you direct control through LibVLC options:

  • --network-caching=<ms> — the single biggest lever. The default favors smooth playback; drop it (e.g. 300, or lower on a clean LAN) to cut delay. Too low on a lossy link causes stutter, so tune to your network.
  • :rtsp-tcp — force TCP instead of UDP. More reliable on Wi-Fi and congested networks, at a small latency cost. Use UDP (the default) when you need the absolute lowest latency on a reliable wired network.
  • --clock-jitter=0 and --clock-synchro=0 — disable jitter smoothing for live sources where you would rather have minimum delay than perfectly even pacing.
_libVLC = new LibVLC(
    "--network-caching=150",
    "--clock-jitter=0",
    "--clock-synchro=0");

Running multiple RTSP streams at once

A surveillance wall, a multi-camera sports rig, or a simulation cockpit often needs several feeds on screen simultaneously. Each stream gets its own MediaPlayer rendering to its own texture, so they run independently:

foreach (var url in cameraUrls)
{
    var player = new MediaPlayer(_libVLC);
    var media = new Media(_libVLC, url, FromType.FromLocation);
    media.AddOption(":rtsp-tcp");
    player.Play(media);
    media.Dispose();
    // assign player's output texture to the matching screen / quad
}

Practical throughput depends on resolution, codec, and the GPU, but hardware-accelerated decoding (up to 8K per stream where the hardware allows) means multi-stream layouts are well within reach.

Supported platforms

RTSP works across every platform VLC for Unity supports:

Platform RTSP support
Windows (D3D11/D3D12) Yes
UWP Yes
Android Yes
iOS Yes
macOS Yes
Linux Yes

Common use cases

  • IP cameras & surveillance — ONVIF/RTSP cameras streamed onto operator dashboards or video walls, including H.265 cameras.
  • Drones & robotics — live downlinks rendered into a Unity control or inspection interface.
  • Sports & broadcast — multi-angle camera feeds into analysis tools and simulators.
  • XR & VR — real-time camera feeds placed on surfaces inside an immersive scene.
  • Simulation & digital twins — live sensor/camera video composited into a 3D environment.

Troubleshooting

  • Stream won’t open — verify the URL plays in desktop VLC first. If it works there, it will work in VLC for Unity. Check credentials in the URL (rtsp://user:pass@host/...).
  • Stuttering or artifacts — raise --network-caching slightly, or switch to :rtsp-tcp on an unreliable network.
  • High latency — lower --network-caching, prefer UDP on a clean wired network, and disable clock jitter compensation.
  • No audio — confirm the camera actually publishes an audio track; many IP cameras are video-only.

Try it with your own camera

The fastest way to validate this is to point the trial at your actual RTSP source. If it plays in the trial, it will play in production, on every platform, with the same code.

Test VLC for Unity with your hardest media

Try your real RTSP streams, codecs, 360 videos, and target platforms before you commit.