Software Gimbal
In this post I’ll demonstrate how to stabilize and enhance low resolution video using FFMpeg. I will also discuss the pros and cons of hardware options available. From there the discussion will show examples of software options that have supplanted hardware. Lastly, I will introduce some examples of AI that others have used.
The Z51 660mm
Below is a side by side comparison of video taken from one of my fixed wing remote control (RC) planes.
Here is the script I used to process that video.
#!/bin/bash # Take a 40 second clip out of the original - this small sample will be uploaded to Youtube ffmpeg -ss 00:00:00 -i MINI0005.MOV -t 00:00:40 -c copy MINI0005_Segment.MOV # Increase the FPS and interpolate missing frames so the video appearance flows better ffmpeg -i MINI0005_Segment.MOV -vf minterpolate=fps=120 MINI0005_Int.MOV # Sharpen and lens correct the video based on the 808-16 720p camera ffmpeg -i MINI0005_Int.MOV -vf "unsharp=3:3:5, lenscorrection=cx=0.5:cy=0.5:k1=-0.222:k2=-0.0" Combine.MOV # Create a stabilization profile of the video ffmpeg -i Combine.MOV -vf vidstabdetect=shakiness=10:accuracy=15 -f null - # Apply video stabilization from the profile ffmpeg -i Combine.MOV -vf vidstabtransform=smoothing=240:input="transforms.trf" Combine_Stab_Extreme.MOV # Merge the source and processed videos together for a side by side view # Left is the original while right is the processed ffmpeg -i "MINI0005_Segment.MOV" -vf "[in] scale=iw:ih, pad=2*iw:ih [left];movie=Combine_Stab_Extreme.MOV, scale=iw:ih [right]; [left][right] overlay=main_w/2:0 [out]" "MINI0005_Youtube.MOV"
The video was shot with the 808-16 720p camera mounted inside the fuselage of a Z51 rc plane, featured here
The 808-16 was selected becuase of its size and weight (19 grams), as well as due to the limits of what the Z51 could handle. I had tested heaver devices, but the phugoid oscillations became more pronounced. Attempts to fly with both the camera and a barometric altimeter (total weight of 31 grams) repeatedly ended in a crash at take off.
The Volantex Ranger 600mm
Here is another side by side video. The script used to process the video was almost identical to the one listed above, since it used the same camera.
This time video was shot onboard a different plane, the Volantex Ranger 600 featured here.
I want to draw attention to the comment about FPV. Both of the fliers were prone to rolls and pitches in moderate wind. I can attest to this based on all of the video I shot. Since FPV is a live stream, the video stabilzation I have demonstrated here would not apply. Here is a list of pros and cons of software versus hardware gimbal stabilzation.
Hardware Limits
Weight is the biggest problem facing hardware. This is especially true for the planes I used. The Z51 was limited to 20 grams, where the Ranger 600 could handle more than double of that. Adding weight limits the operation of the plane by draining power for the batteries more quickly.
This leads us to power being another problem for hardware. Either that engery is coming from the onboard battery or a differnt power source is needed, which adds more weight.
Hardware gimbals aren’t free. Costs can range with the quality of the gimbal.
Hardware gimbals take up space and most are fitted on the exterior of the plane. Here is an example of a gimble that doesn’t include servos or the controller board and is fitted for the Mobius 1080p camera, https://www.amazon.com/dp/B07TGK8276/ref=cm_sw_em_r_mt_dp_QQ7HWVFMZJX8EG9EQST. If we were to mount this gimbal underneath the aircraft, it would stick out around 90mm. That surface area would be a lot of drag.
Software Limits
The software can not be used for FPV flight, as I pointed out earlier. There is no realtime stablizaion available to live streams, at least non feature here. My focus is purely recorded flight, not FPV.
Software processing is lossy, that means video from the original is either missing or distorted. Altough the distortion is mostly artifacts introduced from extreme stabilzation, the loss of the outer edge of video is noticable.
Software Replacing Hardware
Interestingly, software is being increasingly utilized as a means to replace tasks traditionly handled by hardware. My use of software was to attempted to overcome the inherint limitation of the 808-16 camera. Other examples of this can be found in music, photography, and radio. The SDR has replaced a significant amount of hardware radios had used in the past.
Advanced Processing
I had mentioned that FPV processing was a limit of software, however this is likely to change over time. Tasks done using cloud based processing have shown some remarkable results. Here is an example of footage with both limitaions but also age.
Side Note
I just wanted to finish this post with a return to an earlier subject. The Ranger 600 footage was calculated to be at an elevation of 550 feet at this location, 47.660393, -122.112908. Again, it was critical that I used un-process source footage to determine position.