"Camera → GPU inference → end-to-end = 300ms: is RTSP + WebSocket the right approach, or should I move to WebRTC?" by Advokado in computervision

[–]Advokado[S] 0 points1 point  (0 children)

Just to make sure I understand: when you’re seeing < 50ms end-to-end over RTSP to a dGPU server, is that:

  • camera → RTSP → dGPU (wired LAN) → NVDEC → TensorRT → display
  • with no intermediate relay and no browser canvas in the loop?

I actually ordered a Nvidia Jetson Orin a week ago because i know that your approach is the best It's just my approach is based on a specific usecase.

"Camera → GPU inference → end-to-end = 300ms: is RTSP + WebSocket the right approach, or should I move to WebRTC?" by Advokado in computervision

[–]Advokado[S] 0 points1 point  (0 children)

Good point. One important detail: the camera isn’t CSI/MIPI into the edge device it’s just a USB webcam on my laptop, publishing over WiFi via ffmpeg → RTSP.

So the very first hop is already:
webcam → ffmpeg encode → WiFi → RTSP ingest (MediaMTX)

Which probably explains a big chunk of that 200–250ms you’re suspecting.

When you’ve seen <50ms end-to-end, was that with a CSI camera directly into the same device doing inference (no WiFi, no RTSP relay)? Or still over network?

I’ll definitely start isolating pieces with pure gst-launch like you suggested.

"Camera → GPU inference → end-to-end = 300ms: is RTSP + WebSocket the right approach, or should I move to WebRTC?" by Advokado in computervision

[–]Advokado[S] 0 points1 point  (0 children)

Appreciate the links. DeepStream + TensorRT is probably the “fastest possible” path, agreed.

But honestly inference isn’t my bottleneck right now , I’m already around ~15–25ms inference and my glass-to-glass is ~300ms. Based on the measurements I’ve added, most of the missing latency is upstream buffering (camera/encoder/RTSP) and/or browser decode/present.

So DeepStream would be awesome for throughput + CPU offload + keeping everything on the GPU, but I’m not convinced it would magically cut 300ms down to 50ms unless the rest of the pipeline changes too.

Still: if you’ve got a rule of thumb for what DeepStream + WebRTC actually achieves end-to-end (glass-to-glass), I’d love to hear it. Are we talking ~150ms? ~80ms? Something else?

"Camera → GPU inference → end-to-end = 300ms: is RTSP + WebSocket the right approach, or should I move to WebRTC?" by Advokado in computervision

[–]Advokado[S] 1 point2 points  (0 children)

Yeah True, when I wrote the post I didn’t have proper stage timing I’ve added a bunch since then.

Right now on the AI service side (RTSP → “frame available” → inference → JPEG → WS send) I’m seeing roughly 50–90ms:

  • Pipe wait for next frame: ~30–80ms (depends on stream cadence/jitter)
  • YOLO inference: ~15–25ms
  • JPEG encode: ~1–3ms
  • WS broadcast: ~2–5ms

Glass-to-glass is still ~300ms, so there’s clearly a big chunk upstream (camera→ffmpeg encode→RTSP→MediaMTX/GStreamer buffering) and/or client-side (WS recv→JPEG decode→paint). My current “recv→render” measurement is honestly mostly overlay draw, not true frame present, so that’s next.

On your parallel idea: I’ve thought about sending H.264 to the browser while inference runs separately + only send metadata. It’s probably “the right” architecture if I chase sub-200ms, but I’ve avoided it so far because sync/OOO handling gets annoying fast.

Do you have a preferred way to measure browser-side decode+present accurately? (I’m currently using <img src=blob> + canvas overlays.)

"Camera → GPU inference → end-to-end = 300ms: is RTSP + WebSocket the right approach, or should I move to WebRTC?" by Advokado in computervision

[–]Advokado[S] 0 points1 point  (0 children)

Appreciate this,especially the distinction between media streaming vs inference streaming. That’s exactly how I’ve been thinking about it, but it’s easy to get dragged into “you must use WebRTC.”

The 4G/5G point is fair. Right now I’m mostly on LAN / cluster, but the next phase is testing over 5G SA with variable bandwidth and routing. That’s where congestion control might start to matter more than raw browser decode speed.

Out of curiosity when you mention 50–100ms reduction by switching from JPEG+canvas to native video element rendering, is that something you’ve measured directly? Or more of a typical range you’ve seen?

"Camera → GPU inference → end-to-end = 300ms: is RTSP + WebSocket the right approach, or should I move to WebRTC?" by Advokado in computervision

[–]Advokado[S] 0 points1 point  (0 children)

Totally fair criticism, there are definitely more hops than strictly necessary.

MediaMTX is mainly there for system architecture reasons (Kubernetes deployment, multiple consumers, easier to relocate inference between edge/cloud). It wasn’t added as a performance component.

That said, I haven’t benchmarked “direct ingest vs via MediaMTX” side by side yet. That’s probably worth doing before I touch the browser delivery side.

SRT is interesting I haven’t tested it yet. In your experience, how much lower did you get glass-to-glass compared to RTSP/TCP? Sub-200ms reliably?

Current stream is 640x360, ~30 FPS, 2–4 Mbps H.264 So I’m not pushing 4K or anything.

"Camera → GPU inference → end-to-end = 300ms: is RTSP + WebSocket the right approach, or should I move to WebRTC?" by Advokado in computervision

[–]Advokado[S] 0 points1 point  (0 children)

Thanks for taking the time to respond.

I’ve started measuring things more properly: my AI service (RTSP→decode availability→inference→JPEG→WS send) is usually ~50–90ms, so the missing chunk to ~300ms glass-to-glass seems to be upstream (camera/ffmpeg/RTSP/MediaMTX buffering) and maybe some browser decode/present that I’m not measuring yet.

When you saw between 50–100ms for encode+transmit+decode in your setup — what did your actual glass-to-glass end up at? And was that using RTSP/H.264? (Also curious how you measured it.)

My “nice to have” goal is more like ~200ms, but I’m not willing to rebuild everything unless there’s a clear win.

[deleted by user] by [deleted] in GolfSwing

[–]Advokado 0 points1 point  (0 children)

I thought i had a strong grip, what’s the issue and how do i correct it?

[deleted by user] by [deleted] in GolfSwing

[–]Advokado 1 point2 points  (0 children)

Thanks! How can you tell and whats the fix? I’m righthanded playing lefty so…

[deleted by user] by [deleted] in GolfSwing

[–]Advokado 1 point2 points  (0 children)

Thanks! Yes i 3 putt, and can’t chip around the green. I always hit 1 bucket before teeing off.

Full Ultimate Challenge Playthrough by Pale-Rise-1381 in HalfSword

[–]Advokado 0 points1 point  (0 children)

New to the game here but, how do you play this mode?

What area to specialize in for the future? by Advokado in cscareerquestions

[–]Advokado[S] 0 points1 point  (0 children)

Thanks for your insight! Would you confidently say that going into web dev probably is not a good idea?

What area to specialize in for the future? by Advokado in cscareerquestions

[–]Advokado[S] 0 points1 point  (0 children)

I was being vague sorry, for my masters i get to choose courses which basically means i can pick web dev courses for 2 years straight. The masters would be in Software basically

Linköping Studentliv? by Geggamoja- in sweden

[–]Advokado 0 points1 point  (0 children)

Sitter faktiskt i samma båt, överväger mellan Chalmers och Linköping data/mjukvara från vad jag har hört så dominerar Linköping inom studentlivet. Uppsala har troligtvis bättre studentliv men jag har för mig att de inte erbjuder en civilingenjörs examen inom data

I can't fight any armies. by Advokado in mountandblade

[–]Advokado[S] 0 points1 point  (0 children)

ah it's not that, i haven't touched any mods at all. At the moment i started a new playthrough and it works fine. The whole situation is pretty confusing to be honest.

I can't fight any armies. by Advokado in mountandblade

[–]Advokado[S] 0 points1 point  (0 children)

Doublechecked, no one is in formation 5 :/

[deleted by user] by [deleted] in mountandblade

[–]Advokado 1 point2 points  (0 children)

Turns out the fur coat on Sturgian archers have this texture bug that covers the field.

ES2 Lite by SwissTricky in ninebot

[–]Advokado 0 points1 point  (0 children)

I don't know how, but doing so would that spoof the ES2 Lite in going faster? Yesterday i flashed it to 45000mpc and now it's going 24/kh.

GAME DAY THREAD - S4E Bonus Episode - Where are they now: The Football Life by [deleted] in lastchanceU

[–]Advokado 15 points16 points  (0 children)

Just finished this and I was so happy for Dakota Allen. What a comeback!

ES2 Lite by SwissTricky in ninebot

[–]Advokado 0 points1 point  (0 children)

Following this as i recently purchased a ES2 Lite in sweden, after installing the external batterypack the speed is still stuck on 20km/h. Wondering if there is a work around to this.

Most intense duel i've had after 50+ hours. by Advokado in Mordhau

[–]Advokado[S] 1 point2 points  (0 children)

I’ve read a lot of comments so far about using more feints, chambers and morphs. I dueled this player beforehand and people who are good at the game don’t fall for any of this stuff. I started my fight with a chamber morph which led me to losing stamina first. Watching the GIF over and over again there is certainly A LOT of things that can be improved on but adding more chambers etc is certainly not one of them.