I’m a huge fan of this Prusa i3 Raspberry Pi Camera Mount for the Raspberry Pi Camera Module 2*. It’s a clever design that makes for incredibly stable video. I’ve been using this one for ages. There’s no vibration visible in the mount at all, making it ideal for keeping a close eye on the nozzle as you print.
Or, at least it would be, if it was just a little bit higher.
So I made this one just a little bit higher.
While I was at it, I made it a little bit chunkier to further improve stability. Then I went a little bit overboard and added a focus mechanism to make setting up the focus of the camera a breeze even after it’s all installed.
Note however that the dimensions of the focus ring on the front of the camera are just too tiny for your average 3D printer to cope with. Having said that, I’ve managed to print it with a 0.4mm nozzle and it just managed to engage the focus ring. It would no doubt work better with a smaller nozzle, or printing on a resin printer. In any case, it should work well enough provided you aren’t constantly adjusting it.
Be careful which side up you print the gears. They both will only print correctly one side up.
You will need support around the ball head of the arm, but don't allow any in the actual ball socket.

Install the small gear and gear holder first and then drop the larger gear in the hole. (See image above.) Then place the camera on the posts on top of that. You will probably need to spin the gears a little to get them to engage the focus ring correctly. Once that is done, just clip on the back cover.
The ribbon cable slips through the arm and comes out next to the stepper motor.
Pop the ball into the socket and you are all done. You can then mount it using one of the spare 20mm screws that came with the printer, point the camera where you want it and adjust the focus.
* Note that the Raspberry Pi Camera Module 3 will not work in this design. The autofocus mech is extremely sensitive to vibration, making the image unwatchable.
The author remixed this model.
Increased the height of the camera and added a focus mechanism.