BenzW
Posts: 2
Joined: Wed Jun 05, 2019 8:52 am

Cam output on Monitor without Latency

Wed Jun 05, 2019 8:57 am

My goal:
-Live Preview of the Rasperry Pi Camera (Without Network/Stream)
-Latency ~10ms

My hardware:
-Raspberry Pi 2
-Raspberry Pi Camera

Question:
Is is possible to achieve the goals with the mentioned hardware?
I tried die python "camera.start_preview" script, but the delay was way to high (~100ms).

Greetings! :D

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23366
Joined: Sat Jul 30, 2011 7:41 pm

Re: Cam output on Monitor without Latency

Wed Jun 05, 2019 9:06 am

raspivid is about as fast as you can get with regard to latency. Note though that at 30fps, each frame is 33ms, and I think there is one frame delay before it gets to the display. You could reduce the resolution, and up the frame rate to decrease latency.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

User avatar
RaTTuS
Posts: 10412
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK

Re: Cam output on Monitor without Latency

Wed Jun 05, 2019 9:06 am

use the rpi hdmi ?
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

BenzW
Posts: 2
Joined: Wed Jun 05, 2019 8:52 am

Re: Cam output on Monitor without Latency

Wed Jun 05, 2019 9:45 am

jamesh wrote:
Wed Jun 05, 2019 9:06 am
raspivid is about as fast as you can get with regard to latency. Note though that at 30fps, each frame is 33ms, and I think there is one frame delay before it gets to the display. You could reduce the resolution, and up the frame rate to decrease latency.
I tried it, but I get a strange phenomenon:
If I type "raspivid -t 10000 -w 400 -h 400 -fps 60 -vf -hf -o test1.h264" I get a perfect video with nearly no latency. But thats not exactly what I want.
This Command "raspivid -t 0 -w 400 -h 400 -fps 60 -vf -hf" just gives me the cam-output and doesn't save it. But there is more latency and the image in general looks very different.

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 23366
Joined: Sat Jul 30, 2011 7:41 pm

Re: Cam output on Monitor without Latency

Wed Jun 05, 2019 11:38 am

BenzW wrote:
Wed Jun 05, 2019 9:45 am
jamesh wrote:
Wed Jun 05, 2019 9:06 am
raspivid is about as fast as you can get with regard to latency. Note though that at 30fps, each frame is 33ms, and I think there is one frame delay before it gets to the display. You could reduce the resolution, and up the frame rate to decrease latency.
I tried it, but I get a strange phenomenon:
If I type "raspivid -t 10000 -w 400 -h 400 -fps 60 -vf -hf -o test1.h264" I get a perfect video with nearly no latency. But thats not exactly what I want.
This Command "raspivid -t 0 -w 400 -h 400 -fps 60 -vf -hf" just gives me the cam-output and doesn't save it. But there is more latency and the image in general looks very different.

I just tried that, looked OK to me. No difference in the two commands that I could tell. What differences are you seeing?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

Return to “Beginners”