1
0

Compare commits

..

23 Commits

Author SHA1 Message Date
e950314ca1 no rotate 2025-10-01 00:57:18 +02:00
702d80b9a2 update readme 2025-10-01 00:51:20 +02:00
8dcfd2d52d fix python script 2025-10-01 00:51:08 +02:00
213ea05243 add patch 2025-10-01 00:50:38 +02:00
8474d73ac1 update readme 2025-10-01 00:31:47 +02:00
c91c9d44d9 remove chroma decoding 2025-10-01 00:13:06 +02:00
d346c69f69 focal length and remove cropping 2025-10-01 00:11:30 +02:00
8c60a46945 fix unlikely division by zero 2025-09-27 05:26:34 +02:00
b5d9b30ee9 non linear yuv texture filtering 2025-09-27 04:58:23 +02:00
a0cba047e5 4:3 output ratio 2025-09-26 05:54:05 +02:00
71cca0589e cleanup 2025-09-23 05:46:58 +02:00
67b60b0e69 cleanup 2025-09-23 05:46:38 +02:00
79b66d47ee black border color 2025-09-23 05:46:21 +02:00
64e693fe4a rotate 2025-09-21 05:29:45 +02:00
f5b429217c focal length 2025-09-21 04:06:34 +02:00
d74f3dfe67 linear conversion 2025-09-21 03:35:56 +02:00
f7540d5bca license, readme 2025-09-20 13:08:44 +02:00
676e63eae5 focal length, preset and license 2025-09-20 12:53:45 +02:00
acd59515aa remove old presets 2025-09-20 12:04:31 +02:00
d7f0cb427d version, precison and rotate 2025-09-18 07:37:25 +02:00
95175afb5d frame widening maths, cleanup 2025-09-18 06:08:05 +02:00
1385b3e6f3 pixel scale for frame widening 2025-09-17 20:59:34 +02:00
e6c417f0f6 new method based on sensor dimensions and focal length 2025-09-17 05:58:41 +02:00
4 changed files with 15 additions and 13 deletions

View File

@ -4,7 +4,7 @@ Shaders for Avidemux with OpenGL support
## GoPro fisheye removal v2.0
![Sample image](https://blog.rozk.net/wp-content/uploads/2025/10/preview_fisheye_removal.jpg)
![Sample image](https://blog.rozk.net/wp-content/uploads/2025/07/compare.png)
### gopro_8:7 - Fisheye removal for GoPro 11+, 8:7 ratio, 4K, HyperSmooth off
@ -13,12 +13,12 @@ Shaders for Avidemux with OpenGL support
- New method based on sensor size and focal length
- Accurate frame widening
- Fisheye aware subsampling
- Rec.709 colorspace conversion
- Rec.709 colorspace conversion _(requires to patch and rebuild Avidemux)_
#### Content
- avidemux.patch
Optional patch to use GL_NEAREST instead of GL_LINEAR for the luminance channel (the shader is implementing bilinear interpolation with colorspace conversion).
A patch to use GL_NEAREST instead of GL_LINEAR for the luminance channel (the shader is implementing bilinear interpolation with colorspace conversion).
- unfish_gopro_8:7.py
Script to compute the parameters
@ -44,9 +44,3 @@ _For commercial OS's, figure out the paths yourself, then edit the preset to fix
- Select "Custom/preset_gopro_8:7" in the menu
- Modify and/or add filters
- Save the video
#### Shader options
- #define color_conversion: comment out to disable gamma correction for the luminance channel
- #define texture_filtering: comment out to disable custom bilinear filtering for the luminance channel
- #define rotate_180: uncomment to rotate the image by 180 degrees

View File

@ -103,7 +103,7 @@ adm.addVideoFilter(
"shaderLoader", "shaderFile=/opt/rk/avidemux/unfish_gopro_8:7.glsl")
adm.addVideoFilter(
"swscale",
"width=2468",
"width=2832",
"height=2160",
"algo=2",
"sourceAR=0",

View File

@ -37,6 +37,7 @@ uniform float pts;
// parameters
const vec2 sensor_size = vec2(5.949440, 5.205760);
const vec2 rectilinear_scale = vec2(1.147370, 1.0);
const float equidistant_focal_length = 2.920000;
const float rectilinear_focal_length = 2.102263;
@ -55,7 +56,7 @@ vec2 sensor_to_texture;
void initialize() {
texture_center = myResolution * 0.5;
texture_to_sensor = (sensor_size / myResolution);
texture_to_sensor = (sensor_size / myResolution) * rectilinear_scale;
#ifdef rotate_180
texture_to_sensor *= -1.0;
#endif

View File

@ -87,19 +87,26 @@ print("linear fov : horizontal = %7.3f, vertical = %7.3f, diagonal = %7.3f (deg
print("\n--- shader parameters ---\n")
output_size_horizontal = 2.0 * rectilinear_radius(gopro_fov_horizontal * 0.5)
output_size_vertical = gopro_size_vertical
output_scale_horizontal = output_size_horizontal / gopro_size_horizontal
print("""// parameters\n
const vec2 sensor_size = vec2(%.6f, %.6f);
const vec2 rectilinear_scale = vec2(%.6f, 1.0);
const float equidistant_focal_length = %.6f;
const float rectilinear_focal_length = %.6f;""" % (
gopro_size_horizontal, gopro_size_vertical,
output_scale_horizontal,
gopro_focal_length,
rectilinear_focal_length_vertical)
)
print("\n--- output size ---\n")
print("\n--- filters parameters ---\n")
def print_output_array(array_vertical):
array_horizontal = (array_vertical / gopro_array_vertical) * gopro_array_horizontal
array_horizontal = (array_vertical / gopro_array_vertical) * gopro_array_horizontal * output_scale_horizontal
print("resize: width = %d, height = %d" % (
round(array_horizontal / 4.0) * 4,
array_vertical))