How I made my very own 3D printed movie video digicam

0
81




I’ve made an costly and unreliable strategy to report low high quality movies!Should you haven’t observed from my previous few weblog posts, I’ve been fairly obsessive about movie stuff not too long ago. Specifically, I’ve been obsessive about the nice and cozy & fuzzy look of movie movies. Perhaps its simply my gen z mind being nostalgic of a time earlier than I used to be born, however movie actually does simply really feel particular in comparison with the sterile digital movies of at this time.Nevertheless, there undoubtedly is a motive why nobody makes use of movie as a medium for recording movies anymore. Movement image movie is in brief provide and it’s nearly unattainable to search out somebody prepared to develop and scan your movies. All in all, you’d in all probability want to attend months and pay ~$250 for simply 10 minutes of footage – not precisely the perfect worth proposition!My IdeaSince movement image movie is so uncommon and costly, my thought was to construct a movie video digicam that makes use of regular photographic movie canisters, that are far simpler to purchase and develop. The one subject is that these movie canisters can solely take 36 footage, which equates to a measly 3 seconds of video! Not nice.To strive squeeze extra footage into these rolls of movie, I decreased the picture measurement by an element of 8, giving us 36*8 = 288 pictures per roll. This brings us to about 16 seconds of video per roll of movie, at a value of ~$600 for 10 minutes. That’s over 2 occasions worse than simply utilizing a conventional movement image movie digicam however I didn’t trouble to do the maths earlier than beginning this undertaking and by the point I realised how costly it was going to be I used to be already too far in to cease, oops.The pictures captured on a strip of 35mm movie. Try that sick Portra 400 rug I made!AdvertisementsThe MechanicsQuite a variety of elements!A video is just a bunch of pictures proven one after one other quick sufficient to offer the phantasm of movement. So all we actually should do is take a bunch of pictures. Movie cameras do that this by intermittently knocking down the movie, exposing a single body at a time. The video under doesn’t present it, however we additionally must have a shutter to cease mild from hitting the movie whereas it’s being pulled down, in any other case the picture would get all smeared.All a movie digicam does is take a bunch of imagesPulldown Mechanism4 Bar Linkage?My first thought was to create a 4 bar linkage mechanism to drag the movie down.Advertisements4 bar linkage pulldown mechanism. You’ll be able to see that the hook would come up, hook into the movie, after which pull it down.I kinda went all in with this concept, implementing my very own 4 bar linkage simulator in Python utilizing Freudenstein’s equation (which is a very cool use of imaginary numbers! Try this pdf for extra particulars). I then wrote a gradient descent optimiser to search out the perfect 4 bar linkage parameters to observe a given path.4 bar linkage simulator and optimiser2 Tooth Gear & CamBut anyway, I ended up scrapping all of labor I did with 4 bar linkages in order that was a fairly large waste of time. I realised that the mechanism could be far too small and complicated to fabricate utilizing 3D printing, so I as a substitute pivoted this rather more easy pulldown mechanism.Less complicated pulldown mechanismThis design is just a gear with two tooth, which permits it pull the movie down as soon as per rotation. There are additionally two alignment pins which maintain the movie stationary whereas a picture is being uncovered however launch when the movie is being pulled down.Sadly, this mechanism was plagued with points. The gear tooth should be simply lengthy sufficient to seize the movie however not so lengthy that it jams. The tolerances listed below are on the order of 0.1mm, which is de facto far an excessive amount of to ask for out of a FDM 3D printer, and might be what result in a variety of my reliability points.I messed round with the tooth size, spacing and profile for weeks earlier than it began to work semi reliably however I might by no means get it to work completely. There are simply too many variables to regulate, with issues similar to movie inventory thickness and movie canister friction having a big impact on efficiency.Perhaps I’m being a bit too hash on the design although, as a result of in spite of everything, it did find yourself producing some fairly good outcomes. But when I have been to do it once more, the pulldown design could be the very first thing I might change.ShutterFor my digicam, I selected a fairly typical 150 diploma shutter (which means the movie is uncovered 150°/360° = 41% of the time). As talked about above, the shutter has to dam mild from hitting the movie whereas it’s being pulled down to forestall picture smearing, so the shutter must be mechanically linked to the pulldown mechanism. That is achieved by way of just a few gt2 belts and a forty five diploma gear.Right here you’ll be able to see the timing belt which retains the shutter in sync with the movie pulldown mechanismThe shutter itself is 3D printed stainless-steel as a result of it must be shiny (see “Viewfinder” part under for clarification). The shutter additionally has a counterweight on one aspect to stability it, as a result of an unbalanced shutter rotating at 1000rpm would shake the digicam round and blur the picture. On a aspect be aware, it’s kinda unimaginable how low-cost metallic 3D printing is now-days. This metallic half price solely $10 together with transport and was at my door only one week after I ordered it.The shiny metallic shutter contained in the cameraThe last model of the pulldown & shutter mechanism in motion. Should you slowly scrub by way of the video you’ll be able to see that the movie is just being pulled down when the shutter is protecting it. You might have observed that the shutter doesn’t totally cowl the movie gate – this is because of house constraints which I’ll discuss within the part under.ViewfinderOne of my goals for the digicam was for it to have a through-the-lens (TTL) viewfinder, which suggests that you’re seeing precisely what’s being recorded. This was primarily as a result of TTL cameras can help you see in case your video is in focus or not (moderately essential).There are two methods of doing this:The primary is to make use of a beam splitter prism, which sends half of the sunshine to the movie and the opposite half to the viewfinder. That is what super8 and client super16 digicam’s do, due to its mechanical simplicity. Nevertheless, the draw back is that you just lose a half of the sunshine and the prism can degrade the picture high quality.Beam splitter shutter designThe different possibility is to angle the shutter 45°, in order that when the shutter is obstructing the movie it’s redirecting the sunshine to the viewfinder. Which means no mild is misplaced and the picture high quality isn’t degraded.45° shutter designThe picture is then despatched right into a pentaprism, which flips the picture horizontally (so it’s the proper orientation) and places the picture into your eye. For this, I used a substitute viewfinder half for Canon 1000D which I purchased on Aliexpress. Actually, getting a viewfinder from a spare elements store was certainly one of my smartest strikes, attempting to assemble my very own viewfinder with lenses and a pentaprism would have been a nightmare.Anyway, for the sunshine redirection I selected the second possibility of a forty five° shutter. Nevertheless, this technique ended up being far harder than I initially thought. Listed here are just a few of the problems I confronted:The shutter must be angled at 45° but it surely’s actually exhausting to search out 45° bevel gears on-line. I ended up having to design and order 3D printed nylon gears.Bodily, there may be nearly no house to suit a forty five° shutter between the movie aircraft and lens. It’s a critically tight match. I don’t understand how skilled 35mm movie film cameras handle to effortlessly match the shutter into the digicam.The shutter must be utterly flat and have a mirror end. After hours of sanding and sharpening I received fairly shut, however the picture within the viewfinder remains to be kinda blurry.This can be very exhausting to regulate the shutter’s place, which suggests the main focus you see by way of the viewfinder can’t be calibrated to be the identical as what’s being recorded. Kinda defeats the entire goal of a TTL digicam 🤦‍♂️.So yeah, it wasn’t precisely a easy course of.LensI used the Canon EFS 18-55mm lens for this digicam, just because it was the most affordable lens I might discover on-line. Like most issues with my digicam, this ended up being a horrible thought! The lens has no focus scale, and for the reason that viewfinder was not capable of assist me focus, a spotlight scale was the one manner I might pull focus. This meant I had to attract my very own very janky focus scale on the lens. It appears sketchy however then once more my entire digicam appears sketchy.My barely legible focus scale drawn on a strip of inexperienced tapeEven extra annoyingly, this lens isn’t parfocal, and even near it. A parfocal lens signifies that its focus gained’t change as you zoom out and in. So since my lens wasn’t parfocal, in case you change the zoom of the lens mid shot the scene will exit of focus! This may be remedied by merely stopping down the lens to round f/11 (a smaller aperture will increase the depth of area sufficient that the non-parfocal nature of the lens isn’t noticeable, particularly with low res movie).Lastly, the lens allows much less mild once you zoom wherein means the picture publicity modifications as you alter the zoom. So yeah, perhaps shopping for a $40 lens was a foul thought.To summarise, don’t be silly like me! Get a lens that:Has a spotlight scaleIs parfocal (or near it)Doesn’t change publicity when zoomingElectronics & ProgrammingMicrocontrollerI selected to make use of the an ESP32 microcontroller with an built-in LCD display screen for this undertaking. The ESP32 has rapidly change into certainly one of my favorite microcontroller; it solely prices just a few {dollars}, has loads of energy and even has two cores for operating code in parallel!The easy interface used to regulate the digicam settingsThe Lens (once more)Yeah this silly lens precipitated me much more issues. The one strategy to change the aperture is thru the digital interface connecting the lens and the digicam, nonetheless the Canon lens communication protocol is totally closed sourced. That is moderately annoying – altering the aperture is like 1/3 of a lens’ job!There are nearly no assets on-line in regards to the Canon lens protocol. I spent hours looking the web however solely discovered janky, half working protocol specs. Nevertheless, ultimately I stumbled throughout the holy grail of Canon lens protocol documentation: this 100 web page pdf written by jp79dsfr.free.fr. Nothing even comes near the extent of element on this pdf, the writer will need to have spent 100’s of hours painstakingly reverse engineering the protocol’s directions.Nevertheless there’s one subject – it’s all in French.So I despatched the pdf by way of Google translate and browse over all 100 pages of poorly translated documentation. There may be additionally a companion doc with some code examples which is one other extraordinarily helpful useful resource, nonetheless all of the code is written throughout pages of a pdf which might be the worst strategy to share code lol.With these assets, I used to be capable of write my very own implementation of the Canon lens protocol in C++ to regulate the aperture and lively picture stabilisation of the lens. You’ll be able to try the code on the GitHub repoMicrocontroller studying the lens focal lengthControlling the lens aperture from the microcontrollerI can’t thank the writer sufficient for dedicating a lot time into such an absurdly area of interest subject. I completely love the blurb on the prime of the their web site. It says (in French):You who enter right here, lose all hope.Welcome to technical hell … no picture or wallpaper will likely be present in these locations, even the inventive facet of the taking pictures won’t be or nearly not addressed.This man is on the very same wavelength as me, appreciating the technical aspect of images way over the precise composition strategies or artistry.Movie Jam SensorA cool characteristic on this digicam is that it has an optical sensor to detect if the movie has jammed. I used slightly opto-interrupter sensor to depend what number of sprocket holes have handed by. This could then be used to mechanically cease the motor if the sensor detects that the movie has stopped shifting by way of the digicam correctly.Opto-interrupter sensorNow you’re in all probability like “wait an opto-interrupter actually makes use of mild, gained’t that smash the movie?” however the sensor works within the infrared vary, which color movie isn’t delicate to. This could be an issue in case you use Aerochrome (an infrared delicate movie) within the digicam however like why on earth would you place an extremely uncommon $300 roll of movie by way of this extremely unreliable digicam??? (btw you must completely try my weblog publish on recreating Aerochrome)Controlling the motorI used a Nema 17 stepper motor to drive the digicam together with a A4489 stepper driver. I cranked the stepper driver present as much as its most setting, for the reason that motor solely runs for 10 seconds at a time.Anyway I someway managed to explode like 10 of those stepper drivers all through the undertaking. I couldn’t determine why they saved exploding however they’re so low-cost that it was simpler to simply purchase a ton and maintain changing them than to strive debug why they saved breaking.The motor velocity is restricted by the velocity that the microcontroller can ship step pulses to the stepper motor driver. Since I examine the opto-interrupter sensor each step, the max velocity the digicam can shoot is just round 24fps. I might undoubtedly enhance this by utilising each of the ESP32’s cores, however the digicam pulldown mechanism barely works correctly at 18fps not to mention 24fps.Creating the VideoConverting Analog Movie to Digital ImagesIf every little thing has gone correctly, the developed movie ought to comprise a pair hundred thumbnail sized pictures. Now we now have to do essentially the most tedious step: digitally scanning all of those photosNegative pictures on a strip of developed filmTo do that, I positioned the movie on prime of a robust backlight and used a macro lens to take pictures of the movie with my digital digicam. That is basically a DSLR scanning setup, which is kind of frequent within the movie images world. The pictures are far smaller than regular 35mm frames nonetheless, which suggests it’s essential to use a macro lens with a really excessive magnification issue and a digicam with a small sensor measurement. Be certain that to additionally set the digicam publicity to handbook so it isn’t altering from picture to picture.Right here’s the gear I usedIronically, I had to purchase my first ever digital digicam for this undertaking!My DSLR scanning setupAnyway this course of is fairly tedious as you’ll be able to think about. Every roll of movie has ~280 pictures which takes about half-hour to scan. I might have constructed a machine to mechanically scan the movie however I simply wasn’t scanning sufficient movie to justify it.Unfavorable InversionFilm negatives are, because the identify implies, negatives of the particular picture. There are some costly “slide movie” shares which present constructive pictures, however we’ll ignore that for now.Inverting a movie adverse is extra of an artwork than a science, and as somebody who is much better at science than artwork this was a little bit of a problem. Like most picture primarily based issues, I attempted throwing OpenCV at it however I might by no means get the inverted colors to look right.I ended up caving in and going with the gold customary for adverse inversion: Unfavorable Lab Professional (NLP). Sadly, that is fairly an costly route. NLP is a one time buy of $100 and it additionally requires Lightroom which is about $10 per 30 days. The outcomes from NLP are undeniably nice although, and Lightroom can also be an extremely great tool once you’re working with 1000s of pictures so the funding is value it for my part.The colors from Unfavorable Lab Professional are unbeatableMachine Imaginative and prescient Picture AlignmentSince we manually took all these pictures, the frames are all going to be misaligned. If we have been to easily string the pictures right into a video it will be a jumpy mess. Subsequently, we have to align the pictures so the sprocket holes are at all times in the identical place.I wrote slightly OpenCV Python script to do that. The code is within the GitHub repo, and it explains find out how to run this system. The code high quality is fairly horrific (I threw it collectively in a day), but it surely works!Sprocket gap identification and alignmentStitching Frames TogetherAt this level, you must have a folder containing all of the inverted and aligned pictures. Now all we have to do is string the pictures collectively right into a video! You might put the ~150 pictures right into a powerpoint and flip by way of it actually quick however right here’s a better technique that makes use of FFmpeg.Run this command within the folder with all of the imagesffmpeg -framerate 18 -pattern_type glob -i ‘*.jpg’ -c:v libx264 -pix_fmt yuv420p out.mp4This might not be needed for you, however I wanted to make use of handbrake to re-encode mp4because my Mac refuses to learn the .mp4 file outputted by FFmpegYou also can use FFmpeg to stabilise the videoCrop out the movie borderffmpeg -i out.mp4 -filter:v “crop=in_w/2:in_h/2:in_w/8:in_h/4” -c:a replica out_crop.mp4Calculate stabilisation knowledge primarily based on cropped fileffmpeg -i out_crop.mp4 -vf vidstabdetect=stepsize=32:shakiness=10:accuracy=15:outcome=transforms.trf -f null –Apply the stabilisation knowledge to the un-cropped fileffmpeg -i out.mp4 -y -vf vidstabtransform=enter=transforms.trf:maxangle=0:smoothing=4:optzoom=0 -vcodec libx264 -tune movie -an stabilized.mp4And now you have to be left with a completed video! Not precisely a easy workflow but it surely works.ConclusionThis was undoubtedly certainly one of my greatest initiatives but. I spent 4 months and a whole bunch of {dollars} on movie and elements, so I’m extraordinarily pleased that I used to be capable of get such nice outcomes in the long run.This movie digicam undertaking mixed all of my pursuits: CAD modelling, 3D printing, embedded programming, movie images, digicam design, machine imaginative and prescient and a lot extra. It’s actually fairly unimaginable how effectively this undertaking aligned with my moderately random skillset. At each section of the undertaking I used to be engaged on one thing new which is actually the one motive I used to be capable of work on it for 4 months straight.My preliminary sketches for the design of the digicam – drawn throughout the center of my examination season in June!So so so many failuresThis digicam was removed from excellent. Truly it was fairly shit. Over the course of the summer time it in all probability solely labored about half of the time. I might at all times find yourself lugging this large bomb wanting contraption to seaside days, hikes and events just for it to not work after I received there. It might at all times be some silly subject, like a motor driver dying or wire snapping, however there have been so many shifting elements and completely no redundancy so even the smallest failure would render the whole digicam ineffective.These failures have been so frequent that I ended up bringing alongside a mini workshop with me every time I used to be planning on utilizing the digicam, which actually was ridiculous however I used to be actually determined to get some footage at that time.ImprovementsExcluding the silly failures, the commonest subject was the movie not being pulled down correctly. Both the pictures weren’t aligned with the sprocket holes inflicting a jumpy video or the movie didn’t get pulled down in any respect. As I discussed within the “Pulldown Mechanism” part, the design had such stupidly tight tolerances that even the distinction in thickness between movie shares might throw it off. If I have been to make one other digicam, I might undoubtedly use a unique design.Additionally, as I discussed within the “Viewfinder” part, I wouldn’t use a forty five° shutter once more. It might have been a lot simpler to simply use a shutter parallel with the movie aircraft and a splitting prism to get mild to the viewfinder. The 1 cease lack of mild actually isn’t even that unhealthy, and it will enable me to focus precisely by way of the viewfinder and in addition simply make the general design of the digicam a lot easier.I additionally remorse cheaping out on my lens. I ought to have gotten a lens which was parfocal, didn’t change publicity when zooming and had a spotlight scale – it will have made the digicam much more usable.So what’s nextAs a lot because it saddens me, I actually don’t see myself utilizing this digicam once more. Maybe I’ll use it to movie some clips with me and my associates in my dorm or one thing like that, however I might by no means carry it with me on a vacation like I as soon as envisioned. It sounds kinda silly, however utilizing this digicam was simply unbearably nerve-racking. There have been so many occasions over the summer time the place I used to be out doing one thing enjoyable with my associates or household, however all I might take into consideration was whether or not my movie digicam would work or not. I don’t wan’t that further little bit of stress hanging over me every time I’m speculated to having enjoyable, it merely isn’t value it.I nonetheless do love the look of movie movies nonetheless, and I’ll in all probability purchase myself a small tremendous 8 digicam to carry with me on journeys. I had beforehand prevented tremendous 8 as a result of I assumed that it was ludicrously costly, however at ~$40 per minute it’s actually half the value of utilizing my digicam lol.I completely don’t remorse constructing the digicam although. A few of my favorite reminiscences from final summer time have been captured by it, and the truth that they have been painstakingly shot on my fragile movie digicam makes them much more particular.You’ll discover the Github Repo with code & 3D information right here.In regards to the AuthorJoshua Fowl is an novice photographer and avid maker presently learning Pc Science on the College of Cambridge. You’ll be able to try his different images and programming initiatives on his web site. This text was additionally printed right here and shared with permission.