You can hack up a quick release camera tripod mount using a discarded bike light quick release mount and a 1/4″ bolt, or you can buy this ready made Minoura Camera Mount.
I don’t know if it will hold up to the weight of a full sized DSLR while your bike is bouncing over stairs and potholes, but the quick release looks beefy enough for smaller point-and-shoots.
More about this at SOMAfeed, which says to contact your LBS for price and availability. Suggested retail is $24.95.
(Or you can buy online. There’s a 22-29mm size and a 28-35 mm. The “standard” handlebar diameters historically ranged from 22mm to 26mm at the stem, depending on the style of bikes you use. Newer “oversized” bars range from 25.4mm to 31.8 mm. )
H/T – Andy.
Even if the clamp is sturdy enough for bicycle use, the tripod socket in your camera likely is not. Don’t be surprised if the tripod socket strips on your first day of use. These mounts are fine for stationary use, but if you want action videos, get a lightweight action camera with a mount designed for action use.
I’ve used something like http://www.adorama.com/BG386B.html with an ordinary tripod head and a Canon ELPH camera on many road bike rides and haven’t had issues with the tripod socket on my camera. Can’t say if it’s sturdy enough for trail riding though.
Available at Amazon.com