-
Notifications
You must be signed in to change notification settings - Fork 113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
high (~1s) latency when running on localhost #81
Comments
Hi Andres, Thank you for reaching out. Off the top of my head, one major problem is the input format for the sender program ( The most preferable input format for us is If you wanna make it work, I can think of a few ways to do that:
Please let me know if you had any other questions! Best, |
Thanks, that was it. Suggestion 4 got me down to latencies around ~150ms and ~250ms (localhost and over wifi, rough measurements by syncing my hand waving to the webcam output at 180-degree phase and counting that frequency). Thanks for your help. |
The root cause here is that the Thinkpad's webcam can only do 10 fps in YUYV422 mode, and to get 30fps, we'd require a JPEG decoder in Salsify. (Which is doable and probably easy, but not done.) For the performance evaluation in the paper, we were using a 60fps YUV420 webcam which Salsify can handle directly. I think our performance on these 10fps YUYV webcams should be a lot better after 2723268 , though -- because of the way we were using the V4L2 API (with only a single buffer), I think we were only getting 5fps with these webcams. I don't think our swizzling from YUYV(422) to YUV420 is the problem -- I timed it and this takes us less than 1 ms. With the 2723268 patch, we can get 10 fps with basically no latency. (Try the For anything performance-critical, though, the real solution is probably going to require linking in a JPEG decoder. The Thinkpad's webcam can only do 10 fps in YUYV422 mode, and 30fps in MJPEG mode. So if you want anything better than 10 fps, I think we need our own JPEG decoder in the loop. I'm skeptical that ffmpeg's virtual device is not introducing added latency... |
Also -- when testing Salsify over localhost, you probably want to limit the speed somehow (e.g. |
You might check if this helps -- Salsify now supports MJPEG webcams directly. |
Hi,
I tried out using
salsify-receiver
andsalsify-sender
on my laptop, and encountered unexpectedly high latency.I set a 300ms metronome and counted ticks from when I moved my hand and saw the result. I estimate 3x300ms, that is around 1s of delay. The rest of the setup was as follows:
ssim
patched toreturn 8
(no x264).Integrated C (usb-0000:00:14.0-8)
) that otherwise achieves nice (~100ms?) latency incheese
./src/salsify/salsify-receiver 1234 1280 720
./src/salsify/salsify-sender -p YUYV --device /dev/video0 127.0.0.1 1234 1337
Linux ashryn 5.1.4-arch1-1-ARCH #1 SMP PREEMPT Wed May 22 08:06:56 UTC 2019 x86_64 GNU/Linux
Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz
(and cpu usage according totop
was around 50% for the sender and 25% for the receiver).Similar issues were confirmed when streaming to a different laptop over ethernet (and again over wifi).
Given that the paper reports better than 300ms latency in figure 6d ("intermittent link"), I am figuring there must be something that I am doing differently. What do you think could be going on?
Thanks,
Andres
The text was updated successfully, but these errors were encountered: