├── lib ├── gtab_log.ahk ├── gtab_test.ahk ├── gdrop_file.ahk ├── gsetting.ahk ├── r_framei.ahk ├── gtab_framei.ahk ├── save_setting.ahk ├── media_load.ahk ├── decode_test.ahk ├── gtab_media.ahk ├── gtab_w2x.ahk ├── gupdate.ahk ├── load_env.ahk ├── test_check.ahk ├── r_ffmpeg.ahk ├── r_w2x.ahk └── lib.ahk ├── .github └── ISSUE_TEMPLATE │ ├── feature_request.md │ └── bug_report.md ├── README.md └── N4A-V2.ahk /lib/gtab_log.ahk: -------------------------------------------------------------------------------- 1 | Gui, Tab, Console Log 2 | Gui, Add, ListView, x12 y29 w880 h500 gconsole_log, Command 3 | Gui, Add, CheckBox, x12 y534 w100 h20 vlog_enable Checked ggui_update, Enable Log 4 | Gui, Add, Text, x142 y537 w60 h20 , Log Limit : 5 | Gui, Add, Edit, x202 y534 w60 h20 vlog_limit number ggui_update, 26 -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Desktop (please complete the following information):** 27 | - OS: [e.g. iOS] 28 | - Browser [e.g. chrome, safari] 29 | - Version [e.g. 22] 30 | 31 | **Smartphone (please complete the following information):** 32 | - Device: [e.g. iPhone6] 33 | - OS: [e.g. iOS8.1] 34 | - Browser [e.g. stock browser, safari] 35 | - Version [e.g. 22] 36 | 37 | **Additional context** 38 | Add any other context about the problem here. 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # N4A-V2 2 | N4A Video Tools 3 | 4 | This GUI Tools for Windows 5 | packs everything you need for video or picture Waifu2X upscaling. 6 | 7 | ### Feature 8 | - Extension support 9 | - Video (avi mp4 mkv wmv ts mov) 10 | - Audio (aac ogg mp3 pcm) 11 | - Image (jpg png bmp) 12 | - ffmpeg features 13 | - Decoding Test 14 | - Convert files video > image, image > video 15 | - Mux & Demux Video & Audio 16 | - Remove Duplicate Frame 17 | - Create Thumbnail 18 | - Resize Video 19 | - ~~Deinterlace~~ 20 | - Trim 21 | - VSFilter 22 | - Deinterlace 23 | - Image Upscale with Waifu2X (CUDA & Vulkan) 24 | - Support Multi GPU 25 | 26 | # Download Release Version : https://github.com/aaaboypop/N4A-V2/releases 27 | 28 | ### Sample / Guide 29 | ![1](https://files.catbox.moe/ajt32t.png) 30 | 31 | ### Library 32 | - FFmpeg : https://ffmpeg.org/ 33 | - Waifu2X Vulkan : https://github.com/nihui/waifu2x-ncnn-vulkan 34 | - Waifu2X CUDA : https://github.com/lltcggie/waifu2x-caffe 35 | - Autohotkey : https://www.autohotkey.com/ 36 | - Hybrid http://www.selur.de/ 37 | -------------------------------------------------------------------------------- /lib/gtab_test.ahk: -------------------------------------------------------------------------------- 1 | Gui, Tab, Test Mode 2 | Gui, Add, GroupBox, x12 y309 w590 h200 , Check Files Setting 3 | Gui, Add, CheckBox, x22 y329 w130 h20 Checked Disabled venable_check_bad ggui_update, Bad File 4 | Gui, Add, CheckBox, x22 y349 w130 h20 venable_check_res Checked Disabled ggui_update, Mismatch Resolution 5 | Gui, Add, DropDownList, x162 y349 w100 h20 r2 vcheck_res_mode ggui_update, First File|| 6 | Gui, Add, Edit, x382 y349 w80 h20 vcheck_custom_w ggui_update, 7 | Gui, Add, Text, x362 y349 w10 h10 , X 8 | Gui, Add, Edit, x272 y349 w80 h20 vcheck_custom_h ggui_update, 9 | Gui, Add, CheckBox, x22 y369 w130 h20 venable_check_ssim ggui_update, SSIM (Slow) 10 | Gui, Add, Edit, x162 y369 w100 h20 vcheck_bad_ssim ggui_update, 90 11 | Gui, Add, Text, x272 y369 w20 h20 , `% 12 | Gui, Add, Text, x42 y419 w100 h20 , Action : 13 | Gui, Add, DropDownList, x162 y419 w100 h20 r3 vcheck_action ggui_update, Delete|Move|Nothing|| 14 | Gui, Add, Text, x42 y449 w100 h20 , Move to : 15 | Gui, Add, Edit, x162 y449 w220 h20 vcheck_action_move_path ggui_update, 16 | Gui, Add, Text, x22 y+30 w110 h20 , (Experiment Function) 17 | Gui, Add, button, x182 y529 w80 h20 vb_check gcheck_file, Check File -------------------------------------------------------------------------------- /lib/gdrop_file.ahk: -------------------------------------------------------------------------------- 1 | GuiDropFiles: 2 | { 3 | StringSplit, drop_filepath, A_GuiEvent, `n 4 | SplitPath, drop_filepath1,, dir, ext 5 | 6 | if(ext="") 7 | { 8 | drop_folderpath := drop_filepath1 9 | } 10 | else 11 | { 12 | drop_folderpath := dir 13 | } 14 | drop_focus = %A_GuiControl% 15 | 16 | if(drop_focus = "in_path") 17 | dd_path("d") 18 | else if(drop_focus = "out_path") 19 | dd_path("d") 20 | else if(drop_focus = "in_path") 21 | dd_path("d") 22 | else if(drop_focus = "out_path") 23 | dd_path("d") 24 | else if(drop_focus = "vp_out_path") 25 | dd_path("d") 26 | else if(drop_focus = "audio_out_path") 27 | dd_path("d") 28 | else if(drop_focus = "in_path1") 29 | dd_path("d") 30 | else if(drop_focus = "out_path1") 31 | dd_path("d") 32 | 33 | else if(drop_focus = "add_audio_path") 34 | dd_path("f") 35 | else if(drop_focus = "vp_in_path") 36 | { 37 | dd_path("f") 38 | sleep, 30 39 | goto, media_load 40 | } 41 | } 42 | Return 43 | 44 | dd_path(var1) 45 | { 46 | global drop_focus 47 | global drop_filepath1 48 | global drop_folderpath 49 | if(var1 = "f") 50 | { 51 | GuiControl,,%drop_focus%,%drop_filepath1% 52 | } 53 | else 54 | { 55 | GuiControl,,%drop_focus%,%drop_folderpath% 56 | } 57 | } -------------------------------------------------------------------------------- /lib/gsetting.ahk: -------------------------------------------------------------------------------- 1 | ;==== Control ==== 2 | GuiControl,,nlv%noise_level%, 1 3 | GuiControl,,log_enable,% log_enable 4 | GuiControl, Hide,mgpu_text 5 | GuiControl, Hide,convert_custom 6 | GuiControl, Hide,custom_fps 7 | GuiControl, Hide,custom_fps_num 8 | GuiControl, Hide,custom_fps_den 9 | GuiControl, ChooseString, config_ext, %config_ext% 10 | GuiControl, ChooseString, model, %model% 11 | GuiControl, ChooseString, sleep_time, %sleep_time% 12 | GuiControl,,skip_exist, %skip_exist% 13 | GuiControl,,by_scale, %by_scale% 14 | GuiControl,,by_width, %by_width% 15 | GuiControl,,by_height, %by_height% 16 | GuiControl,,by_w_h, %by_w_h% 17 | GuiControl,,log_limit, %log_limit% 18 | GuiControl, ChooseString, t_scale,% t_scale 19 | i:=1 20 | while(i<=8) 21 | { 22 | GuiControl, ChooseString, config_gpu%i%,% config_gpu%i% 23 | GuiControl,,enable_process%i%,% enable_process%i% 24 | i++ 25 | } 26 | 27 | i:=1 28 | while(i<=7) 29 | { 30 | if(t_model%i% = 1) 31 | { 32 | GuiControl,,t_model%i%, 1 33 | } 34 | else 35 | { 36 | GuiControl,,t_model%i%, 0 37 | } 38 | i++ 39 | } 40 | 41 | i:=0 42 | while(i<=3) 43 | { 44 | if(t_nlv%i% = 1) 45 | { 46 | GuiControl,,t_nlv%i%, 1 47 | } 48 | else 49 | { 50 | GuiControl,,t_nlv%i%, 0 51 | } 52 | 53 | i++ 54 | 55 | if(mode%i% = 1) 56 | { 57 | GuiControl,,mode%i%, 1 58 | } 59 | else 60 | { 61 | GuiControl,,mode%i%, 0 62 | } 63 | } -------------------------------------------------------------------------------- /lib/r_framei.ahk: -------------------------------------------------------------------------------- 1 | run_starti: 2 | Gosub, gui_update 3 | If (model1 = "CAIN") 4 | { 5 | if(Use_CPU|UHD_Mode|TTA_Mode) 6 | { 7 | MsgBox, 0x10, Error, "CPU Only" , "UHD" , "TTA" now support only RIFE 8 | Return 9 | } 10 | command = -i "%in_path1%" -o "%out_path1%" -t %config_t_size1% -g %config_gpu_fi% -f %config_ext1% 11 | run_command = cain-ncnn-vulkan.exe %command% 12 | run, %comspec% /c cd "%A_WorkingDir%\frame_Interpolation\cain-ncnn" & %run_command%,, 13 | } 14 | else If (model1 = "DAIN") 15 | { 16 | if(Use_CPU|UHD_Mode|TTA_Mode) 17 | { 18 | MsgBox, 0x10, Error, "CPU Only" , "UHD" , "TTA" now support only RIFE 19 | Return 20 | } 21 | command = -i "%in_path1%" -o "%out_path1%" -t %config_t_size1% -g %config_gpu_fi% -f %config_ext1% 22 | run_command = dain-ncnn-vulkan.exe %command% 23 | run, %comspec% /c cd "%A_WorkingDir%\frame_Interpolation\dain-ncnn" & %run_command%,, 24 | } 25 | else 26 | { 27 | UHD := "" 28 | TTA := "" 29 | if(Use_CPU) 30 | config_gpu_fi := -1 31 | if(UHD_Mode) 32 | UHD := "-u " 33 | if(TTA_Mode) 34 | TTA := "-x " 35 | command = -i "%in_path1%" -o "%out_path1%" -m "%config_model%" -g %config_gpu_fi% %UHD% %TTA% -f %config_ext1% 36 | run_command = rife-ncnn-vulkan.exe %command% 37 | run, %comspec% /c cd "%A_WorkingDir%\frame_Interpolation\rife-ncnn" & %run_command%,, 38 | } 39 | gosub,log_console 40 | Return -------------------------------------------------------------------------------- /lib/gtab_framei.ahk: -------------------------------------------------------------------------------- 1 | Gui, Tab, Frame Interpolation 2 | Gui, Add, Text, x22 y29 w80 h20 , Input Folder : 3 | Gui, Add, Edit, x112 y29 w180 h20 vin_path1 ggui_update, %in_path1% 4 | Gui, Add, Text, x22 y49 w80 h20 , Output Folder : 5 | Gui, Add, Edit, x112 y49 w180 h20 vout_path1 ggui_update, %out_path1% 6 | Gui, Add, Button, x292 y29 w30 h20 gin_folderi, ... 7 | Gui, Add, Button, x292 y49 w30 h20 gout_folderi, ... 8 | Gui, Add, Text, x22 y209 w80 h20 , Interpolation : 9 | Gui, Add, DropDownList, x112 y209 w180 h21 vmodel1 r10 galt_guiupdate, CAIN|DAIN|RIFE|| 10 | 11 | Gui, Add, Text, x22 y239 w90 h20 , Model : 12 | Gui, Add, DropDownList, x112 y239 w70 h20 vconfig_model r4 ggui_update, rife|rife-HD|rife-UHD|rife-anime|| 13 | Gui, Add, Checkbox, x202 y239 w50 h20 vUHD_Mode ggui_update, UHD 14 | Gui, Add, Checkbox, x262 y239 w50 h20 vTTA_Mode ggui_update, TTA 15 | Gui, Add, Text, x22 y269 w90 h20 , File Extension : 16 | Gui, Add, DropDownList, x112 y269 w50 h20 vconfig_ext1 r4 ggui_update, png||jpg 17 | Gui, Add, Text, x22 y299 w90 h20 , GPU : 18 | Gui, Add, DropDownList, x112 y299 w50 h20 vconfig_gpu_fi r9 ggui_update, 0||1|2|3|4|5|6|7|8 19 | Gui, Add, Checkbox, x202 y299 w90 h20 vUse_CPU ggui_update, CPU Only 20 | Gui, Add, Text, x202 y269 w90 h20 , Tile Size : 21 | Gui, Add, Edit, x262 y269 w50 h20 vconfig_t_size1 ggui_update, 512 22 | Gui, Add, button, x22 y359 w80 h20 vb_starti grun_starti, Run -------------------------------------------------------------------------------- /lib/save_setting.ahk: -------------------------------------------------------------------------------- 1 | save: 2 | { 3 | IniWrite, %in_path%, %A_WorkingDir%\setting.ini, main, in_path 4 | IniWrite, %out_path%, %A_WorkingDir%\setting.ini, main, out_path 5 | IniWrite, %noise_level%, %A_WorkingDir%\setting.ini, main, noise_level 6 | IniWrite, %scale%, %A_WorkingDir%\setting.ini, main, scale 7 | IniWrite, %win_mode%, %A_WorkingDir%\setting.ini, main, win_mode 8 | IniWrite, %config_ext%, %A_WorkingDir%\setting.ini, main, config_ext 9 | IniWrite, %model%, %A_WorkingDir%\setting.ini, main, model 10 | IniWrite, %width%, %A_WorkingDir%\setting.ini, main, width 11 | IniWrite, %width1%, %A_WorkingDir%\setting.ini, main, width1 12 | IniWrite, %height%, %A_WorkingDir%\setting.ini, main, height 13 | IniWrite, %height1%, %A_WorkingDir%\setting.ini, main, height1 14 | IniWrite, %by_scale%, %A_WorkingDir%\setting.ini, main, by_scale 15 | IniWrite, %by_width%, %A_WorkingDir%\setting.ini, main, by_width 16 | IniWrite, %by_height%, %A_WorkingDir%\setting.ini, main, by_height 17 | IniWrite, %by_w_h%, %A_WorkingDir%\setting.ini, main, by_w_h 18 | IniWrite, %skip_exist%, %A_WorkingDir%\setting.ini, main, skip_exist 19 | IniWrite, %sleep_time%, %A_WorkingDir%\setting.ini, main, sleep_time 20 | IniWrite, %split_size%, %A_WorkingDir%\setting.ini, main, split_size 21 | IniWrite, %t_scale%, %A_WorkingDir%\setting.ini, main, t_scale 22 | IniWrite, %log_enable%, %A_WorkingDir%\setting.ini, main, log_enable 23 | IniWrite, %log_limit%, %A_WorkingDir%\setting.ini, main, log_limit 24 | 25 | i:=0 26 | while(i<=3) 27 | { 28 | var1 := t_nlv%i% 29 | IniWrite, %var1%, %A_WorkingDir%\setting.ini, main, t_nlv%i% 30 | i++ 31 | var2 := mode%i% 32 | IniWrite, %var2%, %A_WorkingDir%\setting.ini, main, mode%i% 33 | } 34 | 35 | i:=1 36 | while(i<=7) 37 | { 38 | var1 := t_model%i% 39 | IniWrite, %var1%, %A_WorkingDir%\setting.ini, main, t_model%i% 40 | i++ 41 | } 42 | 43 | i:=1 44 | while(i<=8) 45 | { 46 | var1 := config_gpu%i% 47 | var2 := enable_process%i% 48 | IniWrite, %var1%, %A_WorkingDir%\setting.ini, main, config_gpu%i% 49 | IniWrite, %var2%, %A_WorkingDir%\setting.ini, main, enable_process%i% 50 | i++ 51 | } 52 | ToolTip, Setting is Saved 53 | SetTimer, RemoveToolTip, -3000 54 | } 55 | return -------------------------------------------------------------------------------- /lib/media_load.ahk: -------------------------------------------------------------------------------- 1 | media_load: 2 | { 3 | Gui, 1:+Disabled 4 | Gui, 3:Add,Text,w200 r3 cRed center vload_text, `nLoading.. 5 | Gui, 3:Show,, Media Info 6 | Gui, 3:+Disabled 7 | Gui, 3:Default 8 | media_load := 1 9 | image_input := 0 10 | load_image_count := 0 11 | SplitPath, vp_in_path, load_name, load_fullpath, load_ext, in_name_no_ext 12 | if(load_ext="png"||load_ext="jpg") 13 | { 14 | ifExist, %load_fullpath%\image000001.* 15 | { 16 | Loop, Files, %load_fullpath%\image*.* , F 17 | { 18 | load_image_count++ 19 | } 20 | image_input := 1 21 | video_n_frame := load_image_count 22 | 23 | Gui, 4:Add, ListView,, General|Info 24 | Gui, 4:Default 25 | LV_Add("", "Input Type", load_ext) 26 | LV_Add("", "Frame", load_image_count) 27 | 28 | LV_ModifyCol() 29 | Gui, 4:-Resize -MaximizeBox -MinimizeBox +ToolWindow 30 | Gui, 4:Show,, Media Info 31 | 32 | 33 | } 34 | else If (FileExist(load_fullpath "\000001.*")) 35 | { 36 | Loop, Files, %load_fullpath%\*.* , F 37 | { 38 | load_image_count++ 39 | } 40 | image_input := 2 41 | video_n_frame := load_image_count 42 | 43 | Gui, 4:Add, ListView,, General|Info 44 | Gui, 4:Default 45 | LV_Add("", "Input Type", load_ext) 46 | LV_Add("", "Frame", load_image_count) 47 | 48 | LV_ModifyCol() 49 | Gui, 4:-Resize -MaximizeBox -MinimizeBox +ToolWindow 50 | Gui, 4:Show,, Media Info 51 | 52 | 53 | } 54 | else 55 | { 56 | msgbox,0x2000, Media Info,% "Not Found Image Format ""image%06d""" 57 | Gui, 4:destroy 58 | Gui, 1:-Disabled 59 | } 60 | } 61 | else if(load_ext="mkv"||load_ext="mp4"||load_ext="mov"||load_ext="wmv"||load_ext="ts"||load_ext="m4v") 62 | { 63 | GuiControl,,load_text, Loading..`nMedia Infomation 64 | Gui, 4:Add, ListView, r32 w600, General|Info 65 | Gui, 4:Default 66 | 67 | var1 = mediainfo --Output=XML "%vp_in_path%" 68 | c4 := "" 69 | c4 := StdOutToVar(comspec . " /c " . A_WorkingDir . "\ffmpeg\" . var1) 70 | 71 | add_row := 0 72 | Loop, parse, c4, `r, 73 | { 74 | If RegExMatch(A_LoopField,"(<[^\/].*?>)",get_txt) 75 | { 76 | If RegExMatch(get_txt,"") 77 | add_row := 1 78 | 79 | If(add_row=0) 80 | continue 81 | 82 | If RegExMatch(get_txt,"") 83 | { 84 | LV_Add("") 85 | LV_Add("", "