News How to Build a Raspberry Pi Body Camera

bit_user

Titan
Ambassador
Wouldn't you be much better off with a 1-2 generation old cell phone, in a good case?

That Pi-based contraption looks fragile, bulky, burns a relatively large amount of power, lacks a screen... the camera is low resolution, it's got no ISP to clean up the image... need I go on?

And with a cell phone, you can stream over wifi, or even 4G (assuming you have service for it).
 
  • Like
Reactions: TJ Hooker

Stanto

Commendable
Jun 6, 2020
7
1
1,515
The casing is relative to how you design and build it. You could 3d print a slim enclosure, design a PCB, basically anything to make it smaller.

Also the Pi in question has WiFi, so if you have a phone then you have 4g connectivity because it can run as an access point.

1-2 generation old cell phone also limits your development options, you wouldn't be able to perform image recognition or change the file format of the video, with this you have a lot more control over what you do and how it can be stored or streamed.

As for the image resolution, it's 1080p 30fps video, and higher resolution still footage. Look up the hardware first before criticising it?
 
Last edited:

bit_user

Titan
Ambassador
1-2 generation old cell phone also limits your development options, you wouldn't be able to perform image recognition or change the file format of the video, with this you have a lot more control over what you do and how it can be stored or streamed.
I don't have a ton of experience with phone development, but I have done realtime video processing on one.

Also, a pi Zero doesn't have a lot of compute power and is much less energy-efficient than even 2-3 generation-old cell phones.

As for the image resolution, it's 1080p 60fps video, and higher resolution still footage. Look up the hardware first before criticising it?
It's an article, and I'm commenting on what it said.
17. Create a connection to the Raspberry Pi Camera, then set the resolution to 720p.
It made no mention of 1080p or 60fps. If it can do that, great. I figured the article would probably use the max resolution available, but I guess I was wrong. However, I'd expect at least some justification would be given for doing otherwise.

With a cell phone, you typically get at least 1080p/60, probably image stabilization, and some phones have features like a low-light mode.

Anyway, if you want to use a Pi for this, more power to you! I'm just pointing out that other options exist, with some significant potential advantages.

I should add: I support holding authorities to account, by any means -pi, phone, body cam, go pro, or whatever else you've got. Also, I think the Pi can make a lot more sense for a non- body-worn camera, in which case most the article still applies.
 
Last edited:
  • Like
Reactions: TJ Hooker

Stanto

Commendable
Jun 6, 2020
7
1
1,515
I don't have a ton of experience with phone development
It made no mention of 1080p or 30fps.

Unfortunately it appears you don't have experience with the Raspberry Pi either. The Raspberry Pi runs a VideoCore IV GPU, which performs hardware accelerated h264 encoding and decoding. Which it can do in realtime in hardware. There are some limitations on the type of camera used in the CSI port, which may make it 30fps, though there are now at least 4 different types of cameras available to use with the Raspberry Pi with different functionality.

probably image stabilization

While many phones /might/ do that in software, most likely do it slightly in hardware, which you could have a small gimbal if you wanted to in the design.

and some phones have features like a low-light mode

Easily done with parameters to the image/video capturing software, and/or using the 'noir' version of the camera, and/or adding GPIO controlled infrared LEDs.

Also, a pi Zero doesn't have a lot of compute power and is much less energy-efficient

I think you'll be surprised if you do a search for power benchmarks, and since it has a dedicated GPU the power requirements of the CPU for a camera which can be GPU accelerated isn't so important.

Anyway, if you want to use a Pi for this, more power to you! I'm just pointing out that other options exist, with some significant potential advantages.

Considering you're commenting on an article where the intent and purpose is to do it on a Raspberry Pi, then it's highly likely that yes, someone will want to be doing this with the Raspberry Pi and won't be doing it with other hardware and will be happy with the advantages given of doing it with the Pi than any other options.

I should add: I support holding authorities to account,

Then by all means ensure you do your research on the hardware and software capabilities when attempting to appraise them and compare them with others, else it's a bit moot offering other hardware when people probably come here intending on using the Pi.
 

bit_user

Titan
Ambassador
Unfortunately it appears you don't have experience with the Raspberry Pi either. The Raspberry Pi runs a VideoCore IV GPU, which performs hardware accelerated h264 encoding and decoding. Which it can do in realtime in hardware.
You have no idea what I have experience with.

Realtime video compression is far different from general image processing, and the Pi's GPU is vastly weaker than anything you'd find in a mobile phone - especially if we're talking about the Vidcore IV. That GPU supports neither OpenCL nor OpenGL ES Compute shaders, rendering it virtually useless for general-purpose image processing.

While many phones /might/ do that in software, most likely do it slightly in hardware, which you could have a small gimbal if you wanted to in the design.
I don't know how common mechanical stabilization is, in phones. However, they have accelerometers, which are often used to facilitate digital image stabilization algorithms. I have actually implemented image stabilization from first principles, so I know a bit about it.

Easily done with parameters to the image/video capturing software,
It's often more sophisticated than that. Phone SoC's usually have hardware Image Signal Processors (ISP) that exist for the express purpose of implementing advanced image processing algorithms in a power-efficient way. On the Pi, you're basically limited to using the CPU cores (for reasons discussed) and that + the Pi's poor power-efficiency limits what you can do. Also, you have to worry about heat - especially if this thing is sitting in a pocket and you're maxing all the CPU cores.

adding GPIO controlled infrared LEDs.
I was talking about passive night mode. I/R illumination is tricky to do well. Often, you get quite a bit of glare, and it blows out the AGC, leaving everything outside a relatively small radius even harder to see.

If you're worried about illumination, my recommendation would be to use a separate I/R illuminator that's physically separated from the body camera. If you can't get an I/R headlamp, maybe a good project would be to make or modify one with a relatively low-intensity I/R LED.
 
  • Like
Reactions: TJ Hooker

Stanto

Commendable
Jun 6, 2020
7
1
1,515
Pi's GPU is vastly weaker than anything you'd find in a mobile phone

https://www.phonebunch.com/phone-filter/gpu/broadcom-videocore-iv/page/1/
Since it's targeted at mobile devices, the Broadcom BCM2763 VideoCore IV is built using a 40nm process. Broadcom estimates that its reduced power consumption will lead to 4-6 hours of video recording and 8-10 hours of video playback on most mobile devices, and up 16 hours if the video is played over HDMI
https://www.gsmarena.com/broadcom_v... targeted at mobile,video is played over HDMI.

if we're talking about the Vidcore IV. That GPU supports neither OpenCL nor OpenGL ES Compute shaders

"OpenCL implementation running on the VideoCore IV GPU of the Raspberry Pi models"
https://github.com/doe300/VC4CL

"The GPU bundled with Raspberry Pi 4 is a VideoCore VI capable of OpenGL ES 3.2, a significant step above the VideoCore IV present in Raspberry Pi 3 which could only do OpenGL ES 2.0 "
https://www.raspberrypi.org/blog/vc4-and-v3d-opengl-drivers-for-raspberry-pi-an-update/

You have no idea what I have experience with.

Not the VideoCore IV, evidently.

It's often more sophisticated than that

We're talking about the Pi here. Don't be vague to prove a point.

I was talking about passive night mode

I was talking about both.
 

bit_user

Titan
Ambassador
Those phones are at least 5 years old, or else probably not ever sold in the US. Anyway, let's not make this a game to find the worst phone possible.

People can read the reviews of phones' video capabilities and hopefully find one that's suited to the task.

Certainly, anyone planning on doing anything interesting with its GPU is going to find a phone with a reasonable GPU.

... 4-6 hours of video recording ...
Right. Video recording. Just plain, vanilla recording. No fancy image stabilization or HDR processing or anything like that. And certainly not trying to do any kind of object recognition or other advanced image processing.

"OpenCL implementation running on the VideoCore IV GPU of the Raspberry Pi models"
https://github.com/doe300/VC4CL
... The most notable features, which are not supported by the VC4CL implementation are images ...

Oops...

But, the VideoCore IV is so bad that it's almost pointless.

Plus, we don't even know if you can run OpenCL simultaneously with video recording, or whether it'll impact the video recording, or how much of the GPU capability will be left to do anything in OpenCL.

"The GPU bundled with Raspberry Pi 4 is a VideoCore VI capable of OpenGL ES 3.2, a significant step above the VideoCore IV present in Raspberry Pi 3 which could only do OpenGL ES 2.0 "
First, don't change the subject. The article is not using a Pi v4. Second, the VideoCore 6 is only about 50% faster, which still leaves it in the dust of modern cell phones' GPUs. I mean they're literally like 10x as fast - no exaggeration!

With an older, lower-end phone, it should be no problem to find 2-5x. Let's take the Nexus 5X, which according to sold listings on ebay, can be had for < $100, in working condition (US seller). It used a Snapdragon 808 SoC, with an Adreno 418 GPU that could do 154 GFLOPS, Compare this with the VideoCore IV's 28 GFLOPS! It also supports OpenCL 1.2 full profile.

We're talking about the Pi here. Don't be vague to prove a point.
In fact, I was talking about the night-shooting modes of cell phones. The vagueness is by necessity, because they differ in capability. I cited it only as a potential advantage, meaning one could potentially find a phone that's proficient in low-light video. Unless we're going to start getting into the details of specific phone models (can we please not?), I can't be specific.

Like I said, do whatever you want. If you like building stuff, that's great! My point was just that a Pi really doesn't seem like the best solution, here. That doesn't mean nobody should do it, but I guess it depends on what your priorities are. Somebody might learn more by using a Pi, but then you can also learn quite a lot if you really get down & dirty with Android development and do some NDK-level stuff. However, if I wanted a body camera that would survive days' of use and maybe some impacts and me lying on top of it, I'd sure as heck trust a phone in a good case more than a home-built Pi contraption. If nothing else, it'd be less painful to lie on a phone in my shirt pocket than a bulky pi contraption.

I don't really understand why that's apparently such a controversial point. If you really don't agree with that, then I guess we'll have to agree to disagree.
 

Stanto

Commendable
Jun 6, 2020
7
1
1,515
Those phones are at least 5 years old

Still, it was used in a mobile phone, which was the point.

People can read the reviews of phones' video capabilities and hopefully find one that's suited to the task.

Again back to the previous point of the development cycle being very different on a phone and what you can have access to versus using a self-built solution on single board computer hardware. Android only breaks out so much on its API.

Just plain, vanilla recording

That goes for any hardware, even mobile phones. You're really picking and choosing what you're going on here aren't you?

Plus, we don't even know if you can run OpenCL simultaneously with video recording, or whether it'll impact the video recording, or how much of the GPU capability will be left to do anything in OpenCL.

You're welcome to perform benchmarks, rather than spouting something isn't possible.

First, don't change the subject. The article is not using a Pi v4.

the VideoCore IV present in ... could .. do OpenGL ES 2.0

Not changing the subject.

With an older, lower-end phone, it should be no problem to find 2-5x

You're forgetting people are reading this article to do a project with the Raspberry Pi. Not an old phone. Else I would have google searched for "How to make a body cam with an old phone" not "How to make a body cam with a Raspberry Pi".

The vagueness is by necessity, because they differ in capability

At this point I'm really not convinced you're aware of difference in capability here. You've admitted that you don't know what it would take to do this project on an old mobile phone, you're reluctant to admit that you don't know the features of the VideoCore IV (aside from saying 'oops'), and you're adamant in denouncing this blog post because you insist that a 'mobile phone would be better technology to do this with' without any comment on the specifics of which device would be better, why, and how you'd code it.

I think it's time to lay this to rest because you obviously take an objection with the intention of this blog post and frankly, I think we can say, this project isn't for you. It looks like it isn't even aimed at you, or intended for you. That's ok, however shutting it down because of your opinion based on the hardware used, isn't ok.

Take care.
 

bit_user

Titan
Ambassador
Still, it was used in a mobile phone, which was the point.
If you think that proves anything, it just shows you've lost the plot.


That goes for any hardware, even mobile phones. You're really picking and choosing what you're going on here aren't you?
No, many phones offer filters and other processing when you're recording video. So, it doesn't necessarily apply to phones.

You're welcome to perform benchmarks, rather than spouting something isn't possible.
What's not possible?

Not changing the subject.
Your quote was about VideoCore 6, which is only present in the Pi v4. That's what I meant about "changing the subject".

As for VideoCore 4 supporting OpenGL ES 2.0, that lacks compute shaders, which means you have to jump through additional hoops and are subject to much greater limitations, if you want to use the GPU for video processing.

You're forgetting people are reading this article to do a project with the Raspberry Pi. Not an old phone. Else I would have google searched for "How to make a body cam with an old phone" not "How to make a body cam with a Raspberry Pi".
Even if that's so (and it's certainly not the only way to land here), they might still be considering whether it's a good idea, or whether there could be better alternatives.

At this point I'm really not convinced you're aware of difference in capability here.
You're not the only one with doubts about the counterparty, in this discussion.

You've admitted that you don't know what it would take to do this project on an old mobile phone, you're reluctant to admit that you don't know the features of the VideoCore IV (aside from saying 'oops'), and you're adamant in denouncing this blog post because you insist that a 'mobile phone would be better technology to do this with' without any comment on the specifics of which device would be better, why, and how you'd code it.
Don't put words in my mouth. I was about to walk away from this, but it really bugs me when someone mischaracterizes my statements and expertise.

I have actually done video recording, processing, and compression, on an Android phone.

When I said "oops" about the VideoCore IV, it was my attempt at a cute way of pointing out that you seemed to have missed how their implementation lacked support for images, which I quote right above it.

I also allowed that the article was still useful in showing how to use a Pi for recording. And any Pi how-to article probably has some merit, in that someone can use portions of it for something else.

I think it's time to lay this to rest
If you want the last word, you'd better make it a nice one. You can't just lob a grenade over the fence and assume a response isn't in order.

because you obviously take an objection with the intention of this blog post
I take an issue with the intention of building a pi-based body camera. That's not only obvious, it's essentially what I said in my first post.

and frankly, I think we can say, this project isn't for you.
Even though I agree, it sounds somehow hostile when you put it that way.

It looks like it isn't even aimed at you, or intended for you.
That neither nullifies my right to weigh in on it, nor renders my opinion irrelevant.

That's ok, however shutting it down because of your opinion based on the hardware used, isn't ok.
In fact, it is 100% okay for us to comment on articles however we see fit. That's the point of the commenting system on this site.

You can disagree, as you've done. That's also okay.

However, suggesting that I can't voice a negative opinion of the article is actually sounding rather fascist. Good luck with that.
 
Mar 7, 2021
1
0
10
Okay, I am really late to this subject but the article was about building a body camera using a pi zero. I wanted something to do and this looked like an inexpensive time user and I really learning how much I don't know. But what I really don't know is why an article about pi zeros turns into a sort of nasty discussion about phone cameras. Sorry you have nothing better to do than.
Has anyone else built a body camera based on the article and, if so, what problems did you come across. The most vexing problem I have had so far is getting to trigger to work correctly. The pin wants to stay high. Comments pertaining to body cam and pi zero will be appreciated