惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
有赞技术团队
有赞技术团队
宝玉的分享
宝玉的分享
雷峰网
雷峰网
Hugging Face - Blog
Hugging Face - Blog
V
V2EX
大猫的无限游戏
大猫的无限游戏
博客园 - 司徒正美
D
Docker
T
The Blog of Author Tim Ferriss
罗磊的独立博客
博客园 - 叶小钗
酷 壳 – CoolShell
酷 壳 – CoolShell
Blog — PlanetScale
Blog — PlanetScale
月光博客
月光博客
J
Java Code Geeks
Jina AI
Jina AI
博客园 - 【当耐特】
C
Check Point Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
腾讯CDC
Last Week in AI
Last Week in AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
V
Visual Studio Blog

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
RTSP black screen troubleshooting: what to check when VLC...
宛涵 · 2026-06-23 · via DEV Community

An IP camera stream failure is rarely just “RTSP does not work”. The useful question is more specific:

  • Did RTSP authentication succeed?
  • Did DESCRIBE return the SDP you expected?
  • Did SETUP choose TCP interleaved or UDP RTP?
  • Is media arriving after PLAY?
  • Are RTP sequence numbers continuous?
  • Does the codec profile match what the client can decode?
  • Is ONVIF handing the VMS a different URI than the one you tested in VLC?

When a camera plays in VLC but not in an NVR/VMS, the failure is usually in the gap between “the stream exists” and “this client can negotiate, receive, and decode it reliably”.

Start with the exact URI

Do not compare two different tests.

Write down the full RTSP URL used by each client:

rtsp://user:pass@camera.local:554/path

Check for differences in:

  • profile path
  • channel number
  • stream subtype
  • query parameters
  • username/password encoding
  • transport settings
  • ONVIF-generated URI vs manually copied URI

Many cameras expose multiple profiles. VLC may be opening the main stream while the VMS is using a substream, or vice versa.

Check the RTSP control flow

A normal session usually looks like this:

OPTIONS
DESCRIBE
SETUP video
SETUP audio (optional)
PLAY
TEARDOWN

Useful failure patterns:

401 loop

Authentication is not being accepted. Check digest/basic auth, clock drift on some devices, special characters in passwords, and whether the VMS encodes credentials differently.

DESCRIBE succeeds, SETUP fails

The client can read metadata but cannot negotiate media transport. Check UDP/TCP mode, client ports, firewall/NAT, and multicast settings.

PLAY succeeds, black screen

The control session succeeded, but media or decoding failed. Now inspect RTP and codec details.

Read the SDP instead of guessing

The DESCRIBE response should return SDP similar to:

m=video 0 RTP/AVP 96
a=rtpmap:96 H264/90000
a=control:trackID=1
a=fmtp:96 packetization-mode=1; profile-level-id=...

Check:

  • codec: H.264, H.265, MJPEG
  • payload type
  • control attribute
  • SPS/PPS availability for H.264
  • profile-level-id compatibility
  • audio track that may confuse weaker clients

A stream can be valid but still use a profile or packetization mode the receiving system handles poorly.

Verify RTP actually arrives

If RTSP SETUP selected UDP, confirm that RTP packets arrive on the negotiated ports.

Symptoms of blocked media:

  • RTSP commands return 200 OK
  • PLAY succeeds
  • no RTP packets arrive
  • no RTCP receiver reports
  • client shows black screen or timeout

This often means firewall, NAT, VLAN, routing, or client port negotiation is the real issue.

If TCP interleaved works but UDP does not, you have a transport path problem, not necessarily a camera problem.

Inspect RTP continuity

When packets arrive but playback freezes or breaks, look for:

  • sequence gaps
  • timestamp jumps
  • marker bit behavior
  • payload type changes
  • RTCP sender reports
  • jitter patterns

A few packet losses may be tolerable. Repeated gaps around keyframes can make a stream look like a decode failure.

ONVIF handoff can hide the real URI

Many VMS products discover cameras through ONVIF, then request stream URIs from the device.

That URI may not match the one you tested manually.

Compare:

  • ONVIF profile token
  • returned media URI
  • transport protocol requested by ONVIF client
  • main/sub stream selection
  • authentication behavior after handoff

If VLC uses a hand-written URI and the VMS uses an ONVIF URI, you have not tested the same thing yet.

What to hand to support

A useful report should include:

Camera model / firmware
Client name and version
RTSP URL path (without password)
Transport mode: TCP or UDP
RTSP request/response summary
SDP video/audio details
RTP arrival status
Packet loss or sequence gap notes
Codec profile notes
Exact failure symptom

That is much more actionable than “camera does not play”.

Where RTSP Inspector fits

You can do parts of this manually with VLC logs, Wireshark, ONVIF tools, and packet captures. The hard part is turning those pieces into a compact handoff that a camera vendor, installer, or VMS support team can understand.

I build RTSP Inspector for that workflow. It is a local desktop tool for RTSP, RTP, RTCP, SDP, ONVIF handoff, packet loss, and codec-readiness diagnostics. It is not a VMS, NVR, surveillance recorder, or media player; it is meant to explain why a stream does or does not work.

A practical workflow is:

  1. Reproduce the failure with the same URI the client uses.
  2. Capture RTSP control messages and SDP.
  3. Confirm transport mode and media arrival.
  4. Inspect RTP/RTCP evidence.
  5. Export a report for support handoff.

Disclosure: I build RTSP Inspector.

Quick checklist

[ ] Same RTSP URI in both clients
[ ] Authentication result known
[ ] DESCRIBE response saved
[ ] SDP codec/profile inspected
[ ] SETUP transport mode known
[ ] RTP arrival confirmed
[ ] RTP sequence gaps checked
[ ] ONVIF media URI compared
[ ] Report prepared for support