1
0

Compare commits

..

18 Commits

Author SHA1 Message Date
1bbe6653d2 fix pixel scale 2025-09-12 03:00:28 +02:00
d32778977c 4x4 subsampling 2025-09-10 13:56:31 +02:00
daa353e3ac remove 4:3 2025-09-06 03:32:57 +02:00
cf6ae78cd4 fix installation script 2025-09-06 03:32:42 +02:00
4b581de6c3 lanczos downscaling 8:7 2025-09-06 03:16:59 +02:00
48c1b43531 remove 8:7 denoiser 2025-09-06 03:11:44 +02:00
de4e7266a0 resize 4:3 to 8:7 2025-08-01 05:06:00 +02:00
00343ce52d fisheye removel for 4:3 max superview 2025-07-31 04:43:45 +02:00
142cf30662 remove QHD preset 2025-07-31 04:04:23 +02:00
0b96dbf448 update readme 2025-07-29 05:18:05 +02:00
24eb92378d add a preset for youtube 4k with high bitrate 2025-07-29 05:10:00 +02:00
39702c78ab keep original format and scale pixels instead 2025-07-29 05:09:28 +02:00
179ebc96d9 add a denoiser filter 2025-07-29 03:47:58 +02:00
bea1eaea17 fix installation script 2025-07-29 03:45:48 +02:00
e810812f93 update usage instructions 2025-06-20 05:38:42 +02:00
c08226952b update readme 2025-06-20 05:15:51 +02:00
b2af23bd2e add install script 2025-06-20 05:15:40 +02:00
4a9852dc4e add support for QHD, HD and 4K 2025-06-20 05:15:15 +02:00
9 changed files with 533 additions and 44 deletions

View File

@ -2,20 +2,42 @@
Shaders for Avidemux with OpenGL support Shaders for Avidemux with OpenGL support
## gopro_8:7 - Fisheye removal for GoPro 11+, 8:7 ratio ## GoPro fisheye removal
![Sample image](https://blog.rozk.net/wp-content/uploads/2025/07/compare.png)
### gopro_8:7 - Fisheye removal for GoPro 11+, 8:7 ratio, 60fps, HyperSmooth off
- unfish_gopro_8:7.glsl - unfish_gopro_8:7.glsl
Shader for fisheye removal Shader for fisheye removal
- preset_gopro_8:7_1080.py - preset_gopro_8:7_4K_youtube.py
Preset for mp4, 1656x1080, constant bitrate Preset for mp4, 4K, high bitrate
- preset_gopro_8:7_4K_2160p.py
Preset for mp4, 4K, constant bitrate
- preset_gopro_8:7_FullHD_1080p.py
Preset for mp4, FullHD, constant bitrate
- preset_gopro_8:7_HD_720p.py
Preset for mp4, HD, constant bitrate
- compute_gopro_8:7.py - compute_gopro_8:7.py
Script to compute output FOV and frame widening Script to compute output FOV and frame widening
### Installation for BSD/GNU-Linux systems: ### Installation for BSD/GNU-Linux systems:
- Copy the preset to ~/.avidemux6/custom/
- Copy the presets to ~/.avidemux6/custom/ or ~/.local/share/avidemux6/custom/
- Copy the shader to /opt/rk/avidemux/ (or edit the preset to set the path) - Copy the shader to /opt/rk/avidemux/ (or edit the preset to set the path)
_For commercial OS's, figure out the paths yourself :)_ Or just run the script install_gopro_8:7.sh
_For commercial OS's, figure out the paths yourself, then edit the presets to fix the path to the .glsl file_
### Usage: ### Usage:
Load and edit video(s), select "Custom/preset_gopro_8:7_1080" in the menu and save the video.
- Load and edit video(s)
- Select "Custom/preset_gopro..." in the menu
- Add filters
- Save the video

View File

@ -2,12 +2,14 @@
# Computes fisheye removal parameters for GoPro 11+, 8:7 ratio, without hypersmooth, # Computes fisheye removal parameters for GoPro 11+, 8:7 ratio, without hypersmooth,
# keeping the vertical FOV and widening the frame to preserve the diagonal FOV # keeping the vertical FOV and widening the frame to preserve the diagonal FOV
# https://www.bobatkins.com/photography/technical/field_of_view.html
# https://community.gopro.com/s/article/HERO11-Black-Mini-Digital-Lenses-FOV-Information?language=fr # https://community.gopro.com/s/article/HERO11-Black-Mini-Digital-Lenses-FOV-Information?language=fr
import math import math
frame_width = 8 frame_width = 8
frame_height = 7 frame_height = 7
input_ratio = frame_width / frame_height
input_vertical_fov = 108.0 input_vertical_fov = 108.0
input_diagonal_fov = 156.0 input_diagonal_fov = 156.0
@ -19,16 +21,16 @@ output_horizontal_length = math.sqrt((input_diagonal_length ** 2) / (input_verti
output_diagonal_length = math.hypot(output_horizontal_length, input_vertical_length) output_diagonal_length = math.hypot(output_horizontal_length, input_vertical_length)
output_diagonal_fov = math.degrees(math.atan(output_diagonal_length)) * 2.0 output_diagonal_fov = math.degrees(math.atan(output_diagonal_length)) * 2.0
output_ratio = output_horizontal_length / input_vertical_length output_ratio = 1.0 / (output_horizontal_length / input_vertical_length)
print("Output FOV = %f" % output_diagonal_fov) print("Output FOV = %f" % output_diagonal_fov)
print("Output Ratio = %f" % output_ratio) print("Output Ratio = %f" % output_ratio)
print("= Resolutions =====================") print("= Resolutions =====================")
def width_rounded_8(height): def width_rounded_8(height):
width = int(round(height * output_ratio)) width = int(round(height * input_ratio))
return ((width + 4) // 8) * 8 return ((width + 4) // 8) * 8
print("HD = %i x 720" % width_rounded_8(720)) print("HD = %i x 720" % width_rounded_8(720))
print("Full HD = %i x 1080" % width_rounded_8(1080)) print("Full HD = %i x 1080" % width_rounded_8(1080))
print("4K = %i x 2160" % width_rounded_8(2160)) print("4K = %i x 2160" % width_rounded_8(2160))

View File

@ -1,18 +0,0 @@
#PY <- Needed to identify #
# Custom preset for GoPro, 8:7 ratio, without hypersmooth, output widened scaled to Full HD (1080p)
adm = Avidemux()
adm.videoCodec("x264", "useAdvancedConfiguration=False", "general.params=CBR=16384", "general.threads=0", "general.preset=slow", "general.tuning=film", "general.profile=high", "general.fast_decode=False", "general.zero_latency=False"
, "general.fast_first_pass=True", "general.blueray_compatibility=False", "general.fake_interlaced=False", "level=-1", "vui.sar_height=1", "vui.sar_width=1", "vui.overscan=0", "vui.vidformat=5", "vui.fullrange=False"
, "vui.colorprim=2", "vui.transfer=2", "vui.colmatrix=2", "vui.chroma_loc=0", "MaxRefFrames=3", "MinIdr=25", "MaxIdr=250", "i_scenecut_threshold=40", "intra_refresh=False", "MaxBFrame=3", "i_bframe_adaptive=1"
, "i_bframe_bias=0", "i_bframe_pyramid=2", "b_deblocking_filter=True", "i_deblocking_filter_alphac0=0", "i_deblocking_filter_beta=0", "cabac=True", "interlaced=False", "constrained_intra=False", "tff=True"
, "fake_interlaced=False", "analyze.b_8x8=True", "analyze.b_i4x4=True", "analyze.b_i8x8=True", "analyze.b_p8x8=True", "analyze.b_p16x16=False", "analyze.b_b16x16=False", "analyze.weighted_pred=2", "analyze.weighted_bipred=True"
, "analyze.direct_mv_pred=1", "analyze.chroma_offset=0", "analyze.me_method=1", "analyze.me_range=16", "analyze.mv_range=-1", "analyze.mv_range_thread=-1", "analyze.subpel_refine=7", "analyze.chroma_me=True"
, "analyze.mixed_references=True", "analyze.trellis=1", "analyze.psy_rd=1.000000", "analyze.psy_trellis=0.000000", "analyze.fast_pskip=True", "analyze.dct_decimate=True", "analyze.noise_reduction=0", "analyze.psy=True"
, "analyze.intra_luma=11", "analyze.inter_luma=21", "ratecontrol.rc_method=0", "ratecontrol.qp_constant=0", "ratecontrol.qp_min=10", "ratecontrol.qp_max=51", "ratecontrol.qp_step=4", "ratecontrol.bitrate=0"
, "ratecontrol.rate_tolerance=1.000000", "ratecontrol.vbv_max_bitrate=0", "ratecontrol.vbv_buffer_size=0", "ratecontrol.vbv_buffer_init=1", "ratecontrol.ip_factor=1.400000", "ratecontrol.pb_factor=1.300000"
, "ratecontrol.aq_mode=1", "ratecontrol.aq_strength=1.000000", "ratecontrol.mb_tree=True", "ratecontrol.lookahead=40")
adm.addVideoFilter("shaderLoader", "shaderFile=/opt/rk/avidemux/unfish_gopro_8:7.glsl")
adm.addVideoFilter("swscale", "width=1656", "height=1080", "algo=1", "sourceAR=0", "targetAR=0", "lockAR=False", "roundup=2")
adm.setContainer("MP4", "muxerType=0", "optimize=1", "forceAspectRatio=False", "aspectRatio=1", "displayWidth=1280", "rotation=0", "clockfreq=0")

View File

@ -0,0 +1,109 @@
#PY <- Needed to identify #
# RozK
# Custom preset for GoPro, 8:7 ratio, without hypersmooth, output widened scaled to 4K (2160p)
adm = Avidemux()
adm.videoCodec(
"x264",
"useAdvancedConfiguration=False",
"general.params=CBR=32768",
"general.threads=0",
"general.preset=slow",
"general.tuning=film",
"general.profile=high",
"general.fast_decode=False",
"general.zero_latency=False",
"general.fast_first_pass=True",
"general.blueray_compatibility=False",
"general.fake_interlaced=False",
"level=-1",
"vui.sar_height=1",
"vui.sar_width=1",
"vui.overscan=0",
"vui.vidformat=5",
"vui.fullrange=False",
"vui.colorprim=2",
"vui.transfer=2",
"vui.colmatrix=2",
"vui.chroma_loc=0",
"MaxRefFrames=3",
"MinIdr=25",
"MaxIdr=250",
"i_scenecut_threshold=40",
"intra_refresh=False",
"MaxBFrame=3",
"i_bframe_adaptive=1",
"i_bframe_bias=0",
"i_bframe_pyramid=2",
"b_deblocking_filter=True",
"i_deblocking_filter_alphac0=0",
"i_deblocking_filter_beta=0",
"cabac=True",
"interlaced=False",
"constrained_intra=False",
"tff=True",
"fake_interlaced=False",
"analyze.b_8x8=True",
"analyze.b_i4x4=True",
"analyze.b_i8x8=True",
"analyze.b_p8x8=True",
"analyze.b_p16x16=False",
"analyze.b_b16x16=False",
"analyze.weighted_pred=2",
"analyze.weighted_bipred=True",
"analyze.direct_mv_pred=1",
"analyze.chroma_offset=0",
"analyze.me_method=1",
"analyze.me_range=16",
"analyze.mv_range=-1",
"analyze.mv_range_thread=-1",
"analyze.subpel_refine=7",
"analyze.chroma_me=True",
"analyze.mixed_references=True",
"analyze.trellis=1",
"analyze.psy_rd=1.000000",
"analyze.psy_trellis=0.000000",
"analyze.fast_pskip=True",
"analyze.dct_decimate=True",
"analyze.noise_reduction=0",
"analyze.psy=True",
"analyze.intra_luma=11",
"analyze.inter_luma=21",
"ratecontrol.rc_method=0",
"ratecontrol.qp_constant=0",
"ratecontrol.qp_min=10",
"ratecontrol.qp_max=51",
"ratecontrol.qp_step=4",
"ratecontrol.bitrate=0",
"ratecontrol.rate_tolerance=1.000000",
"ratecontrol.vbv_max_bitrate=0",
"ratecontrol.vbv_buffer_size=0",
"ratecontrol.vbv_buffer_init=1",
"ratecontrol.ip_factor=1.400000",
"ratecontrol.pb_factor=1.300000",
"ratecontrol.aq_mode=1",
"ratecontrol.aq_strength=1.000000",
"ratecontrol.mb_tree=True",
"ratecontrol.lookahead=40")
adm.clearVideoFilters()
adm.addVideoFilter(
"shaderLoader",
"shaderFile=/opt/rk/avidemux/unfish_gopro_8:7.glsl")
adm.addVideoFilter(
"swscale",
"width=2472",
"height=2160",
"algo=2",
"sourceAR=0",
"targetAR=0",
"lockAR=False",
"roundup=2")
adm.setContainer(
"MP4",
"muxerType=0",
"optimize=1",
"forceAspectRatio=False",
"aspectRatio=1",
"displayWidth=1280",
"rotation=0",
"clockfreq=0")

View File

@ -0,0 +1,109 @@
#PY <- Needed to identify #
# RozK
# Custom preset for GoPro, 8:7 ratio, without hypersmooth, output widened scaled to 4K (2160p), high bitrate
adm = Avidemux()
adm.videoCodec(
"x264",
"useAdvancedConfiguration=False",
"general.params=CBR=65536",
"general.threads=0",
"general.preset=slow",
"general.tuning=film",
"general.profile=high",
"general.fast_decode=False",
"general.zero_latency=False",
"general.fast_first_pass=True",
"general.blueray_compatibility=False",
"general.fake_interlaced=False",
"level=-1",
"vui.sar_height=1",
"vui.sar_width=1",
"vui.overscan=0",
"vui.vidformat=5",
"vui.fullrange=False",
"vui.colorprim=2",
"vui.transfer=2",
"vui.colmatrix=2",
"vui.chroma_loc=0",
"MaxRefFrames=3",
"MinIdr=25",
"MaxIdr=250",
"i_scenecut_threshold=40",
"intra_refresh=False",
"MaxBFrame=3",
"i_bframe_adaptive=1",
"i_bframe_bias=0",
"i_bframe_pyramid=2",
"b_deblocking_filter=True",
"i_deblocking_filter_alphac0=0",
"i_deblocking_filter_beta=0",
"cabac=True",
"interlaced=False",
"constrained_intra=False",
"tff=True",
"fake_interlaced=False",
"analyze.b_8x8=True",
"analyze.b_i4x4=True",
"analyze.b_i8x8=True",
"analyze.b_p8x8=True",
"analyze.b_p16x16=False",
"analyze.b_b16x16=False",
"analyze.weighted_pred=2",
"analyze.weighted_bipred=True",
"analyze.direct_mv_pred=1",
"analyze.chroma_offset=0",
"analyze.me_method=1",
"analyze.me_range=16",
"analyze.mv_range=-1",
"analyze.mv_range_thread=-1",
"analyze.subpel_refine=7",
"analyze.chroma_me=True",
"analyze.mixed_references=True",
"analyze.trellis=1",
"analyze.psy_rd=1.000000",
"analyze.psy_trellis=0.000000",
"analyze.fast_pskip=True",
"analyze.dct_decimate=True",
"analyze.noise_reduction=0",
"analyze.psy=True",
"analyze.intra_luma=11",
"analyze.inter_luma=21",
"ratecontrol.rc_method=0",
"ratecontrol.qp_constant=0",
"ratecontrol.qp_min=10",
"ratecontrol.qp_max=51",
"ratecontrol.qp_step=4",
"ratecontrol.bitrate=0",
"ratecontrol.rate_tolerance=1.000000",
"ratecontrol.vbv_max_bitrate=0",
"ratecontrol.vbv_buffer_size=0",
"ratecontrol.vbv_buffer_init=1",
"ratecontrol.ip_factor=1.400000",
"ratecontrol.pb_factor=1.300000",
"ratecontrol.aq_mode=1",
"ratecontrol.aq_strength=1.000000",
"ratecontrol.mb_tree=True",
"ratecontrol.lookahead=40")
adm.clearVideoFilters()
adm.addVideoFilter(
"shaderLoader",
"shaderFile=/opt/rk/avidemux/unfish_gopro_8:7.glsl")
adm.addVideoFilter(
"swscale",
"width=2472",
"height=2160",
"algo=2",
"sourceAR=0",
"targetAR=0",
"lockAR=False",
"roundup=2")
adm.setContainer(
"MP4",
"muxerType=0",
"optimize=1",
"forceAspectRatio=False",
"aspectRatio=1",
"displayWidth=1280",
"rotation=0",
"clockfreq=0")

View File

@ -0,0 +1,109 @@
#PY <- Needed to identify #
# RozK
# Custom preset for GoPro, 8:7 ratio, without hypersmooth, output widened scaled to Full HD (1080p)
adm = Avidemux()
adm.videoCodec(
"x264",
"useAdvancedConfiguration=False",
"general.params=CBR=16384",
"general.threads=0",
"general.preset=slow",
"general.tuning=film",
"general.profile=high",
"general.fast_decode=False",
"general.zero_latency=False",
"general.fast_first_pass=True",
"general.blueray_compatibility=False",
"general.fake_interlaced=False",
"level=-1",
"vui.sar_height=1",
"vui.sar_width=1",
"vui.overscan=0",
"vui.vidformat=5",
"vui.fullrange=False",
"vui.colorprim=2",
"vui.transfer=2",
"vui.colmatrix=2",
"vui.chroma_loc=0",
"MaxRefFrames=3",
"MinIdr=25",
"MaxIdr=250",
"i_scenecut_threshold=40",
"intra_refresh=False",
"MaxBFrame=3",
"i_bframe_adaptive=1",
"i_bframe_bias=0",
"i_bframe_pyramid=2",
"b_deblocking_filter=True",
"i_deblocking_filter_alphac0=0",
"i_deblocking_filter_beta=0",
"cabac=True",
"interlaced=False",
"constrained_intra=False",
"tff=True",
"fake_interlaced=False",
"analyze.b_8x8=True",
"analyze.b_i4x4=True",
"analyze.b_i8x8=True",
"analyze.b_p8x8=True",
"analyze.b_p16x16=False",
"analyze.b_b16x16=False",
"analyze.weighted_pred=2",
"analyze.weighted_bipred=True",
"analyze.direct_mv_pred=1",
"analyze.chroma_offset=0",
"analyze.me_method=1",
"analyze.me_range=16",
"analyze.mv_range=-1",
"analyze.mv_range_thread=-1",
"analyze.subpel_refine=7",
"analyze.chroma_me=True",
"analyze.mixed_references=True",
"analyze.trellis=1",
"analyze.psy_rd=1.000000",
"analyze.psy_trellis=0.000000",
"analyze.fast_pskip=True",
"analyze.dct_decimate=True",
"analyze.noise_reduction=0",
"analyze.psy=True",
"analyze.intra_luma=11",
"analyze.inter_luma=21",
"ratecontrol.rc_method=0",
"ratecontrol.qp_constant=0",
"ratecontrol.qp_min=10",
"ratecontrol.qp_max=51",
"ratecontrol.qp_step=4",
"ratecontrol.bitrate=0",
"ratecontrol.rate_tolerance=1.000000",
"ratecontrol.vbv_max_bitrate=0",
"ratecontrol.vbv_buffer_size=0",
"ratecontrol.vbv_buffer_init=1",
"ratecontrol.ip_factor=1.400000",
"ratecontrol.pb_factor=1.300000",
"ratecontrol.aq_mode=1",
"ratecontrol.aq_strength=1.000000",
"ratecontrol.mb_tree=True",
"ratecontrol.lookahead=40")
adm.clearVideoFilters()
adm.addVideoFilter(
"shaderLoader",
"shaderFile=/opt/rk/avidemux/unfish_gopro_8:7.glsl")
adm.addVideoFilter(
"swscale",
"width=1232",
"height=1080",
"algo=2",
"sourceAR=0",
"targetAR=0",
"lockAR=False",
"roundup=2")
adm.setContainer(
"MP4",
"muxerType=0",
"optimize=1",
"forceAspectRatio=False",
"aspectRatio=1",
"displayWidth=1280",
"rotation=0",
"clockfreq=0")

View File

@ -0,0 +1,109 @@
#PY <- Needed to identify #
# RozK
# Custom preset for GoPro, 8:7 ratio, without hypersmooth, output widened scaled to HD (720p)
adm = Avidemux()
adm.videoCodec(
"x264",
"useAdvancedConfiguration=False",
"general.params=CBR=12288",
"general.threads=0",
"general.preset=slow",
"general.tuning=film",
"general.profile=high",
"general.fast_decode=False",
"general.zero_latency=False",
"general.fast_first_pass=True",
"general.blueray_compatibility=False",
"general.fake_interlaced=False",
"level=-1",
"vui.sar_height=1",
"vui.sar_width=1",
"vui.overscan=0",
"vui.vidformat=5",
"vui.fullrange=False",
"vui.colorprim=2",
"vui.transfer=2",
"vui.colmatrix=2",
"vui.chroma_loc=0",
"MaxRefFrames=3",
"MinIdr=25",
"MaxIdr=250",
"i_scenecut_threshold=40",
"intra_refresh=False",
"MaxBFrame=3",
"i_bframe_adaptive=1",
"i_bframe_bias=0",
"i_bframe_pyramid=2",
"b_deblocking_filter=True",
"i_deblocking_filter_alphac0=0",
"i_deblocking_filter_beta=0",
"cabac=True",
"interlaced=False",
"constrained_intra=False",
"tff=True",
"fake_interlaced=False",
"analyze.b_8x8=True",
"analyze.b_i4x4=True",
"analyze.b_i8x8=True",
"analyze.b_p8x8=True",
"analyze.b_p16x16=False",
"analyze.b_b16x16=False",
"analyze.weighted_pred=2",
"analyze.weighted_bipred=True",
"analyze.direct_mv_pred=1",
"analyze.chroma_offset=0",
"analyze.me_method=1",
"analyze.me_range=16",
"analyze.mv_range=-1",
"analyze.mv_range_thread=-1",
"analyze.subpel_refine=7",
"analyze.chroma_me=True",
"analyze.mixed_references=True",
"analyze.trellis=1",
"analyze.psy_rd=1.000000",
"analyze.psy_trellis=0.000000",
"analyze.fast_pskip=True",
"analyze.dct_decimate=True",
"analyze.noise_reduction=0",
"analyze.psy=True",
"analyze.intra_luma=11",
"analyze.inter_luma=21",
"ratecontrol.rc_method=0",
"ratecontrol.qp_constant=0",
"ratecontrol.qp_min=10",
"ratecontrol.qp_max=51",
"ratecontrol.qp_step=4",
"ratecontrol.bitrate=0",
"ratecontrol.rate_tolerance=1.000000",
"ratecontrol.vbv_max_bitrate=0",
"ratecontrol.vbv_buffer_size=0",
"ratecontrol.vbv_buffer_init=1",
"ratecontrol.ip_factor=1.400000",
"ratecontrol.pb_factor=1.300000",
"ratecontrol.aq_mode=1",
"ratecontrol.aq_strength=1.000000",
"ratecontrol.mb_tree=True",
"ratecontrol.lookahead=40")
adm.clearVideoFilters()
adm.addVideoFilter(
"shaderLoader",
"shaderFile=/opt/rk/avidemux/unfish_gopro_8:7.glsl")
adm.addVideoFilter(
"swscale",
"width=824",
"height=720",
"algo=2",
"sourceAR=0",
"targetAR=0",
"lockAR=False",
"roundup=2")
adm.setContainer(
"MP4",
"muxerType=0",
"optimize=1",
"forceAspectRatio=False",
"aspectRatio=1",
"displayWidth=1280",
"rotation=0",
"clockfreq=0")

View File

@ -5,32 +5,61 @@
#extension GL_ARB_texture_rectangle: enable #extension GL_ARB_texture_rectangle: enable
// TODO: investigate
// precision highp float;
// uniforms
uniform sampler2DRect myTextureY; uniform sampler2DRect myTextureY;
uniform sampler2DRect myTextureU; uniform sampler2DRect myTextureU;
uniform sampler2DRect myTextureV; uniform sampler2DRect myTextureV;
uniform vec2 myResolution; uniform vec2 myResolution;
uniform float pts; uniform float pts;
const vec2 half_pixel = vec2(0.5, 0.5); // parameters
const float input_fov = 156.0; const float input_fov = 156.0;
const float output_fov = 119.789529; const float output_fov = 124.45;
const vec2 pixel_scale = vec2(0.652485, 1.0);
const int subsampling = 4;
vec2 unfish(vec2 coord) { // subsampling constants
float diameter = sqrt(dot(myResolution, myResolution)); const float substep = 1.0 / float(subsampling);
vec2 center = myResolution * 0.5; const float substart = substep * 0.5 - 0.5;
vec2 position = coord - center; const float subscale = 1.0 / float(subsampling * subsampling);
float input_distance = length(position);
float input_foc = diameter / radians(input_fov); // variables
float output_foc = diameter / (2.0 * tan(radians(output_fov) * 0.5)); vec2 center;
return center + position * (input_foc * atan(input_distance / output_foc) / input_distance); float diameter;
float input_len;
float inv_output_len;
vec4 unfish(const in vec2 coord) {
float len = max(0.001, length(coord));
vec2 y_coord = center + coord * ((input_len / len) * atan(len * inv_output_len));
vec2 uv_coord = y_coord * 0.5;
return vec4(
texture2DRect(myTextureY, y_coord).r,
texture2DRect(myTextureU, uv_coord).r,
texture2DRect(myTextureV, uv_coord).r,
1.0
);
} }
void main() { void main() {
vec2 y_coord = unfish(gl_TexCoord[0].xy + half_pixel); center = myResolution * 0.5;
vec2 uv_coord = y_coord * 0.5; diameter = length(myResolution);
vec4 y = texture2DRect(myTextureY, y_coord); input_len = diameter / radians(input_fov);
vec4 u = texture2DRect(myTextureU, uv_coord); inv_output_len = (2.0 * tan(radians(output_fov * 0.5))) / diameter;
vec4 v = texture2DRect(myTextureV, uv_coord);
gl_FragColor = vec4(y.r, u.r, v.r, 1.0); vec2 coord = gl_TexCoord[0].xy - center;
vec4 pixel = vec4(0.0, 0.0, 0.0, 0.0);
float x, y = substart;
for (int column = 0; column < subsampling; column++, y += substep) {
x = substart;
for (int row = 0; row < subsampling; row++, x += substep) {
pixel += unfish((coord + vec2(x, y)) * pixel_scale);
}
}
gl_FragColor = pixel * subscale;
} }

18
install_gopro_8:7.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
# RozK
if [ -d ~/.local/share/avidemux6 ]; then
mkdir -p ~/.local/share/avidemux6/custom
rm -f ~/.local/share/avidemux6/custom/preset_gopro*
cp gopro_8:7/preset_gopro* ~/.local/share/avidemux6/custom/
fi
if [ -d ~/.avidemux6 ]; then
mkdir -p ~/.avidemux6/custom
rm -f ~/.avidemux6/custom/preset_gopro*
cp gopro_8:7/preset_gopro* ~/.avidemux6/custom/
fi
sudo mkdir -p /opt/rk/avidemux
sudo rm -f /opt/rk/avidemux/*
sudo cp gopro_8:7/unfish_gopro_8:7.glsl /opt/rk/avidemux