Jump to content

After compile, Error: Subscript used on non-accessible variable.


Recommended Posts

 

#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#include <Constants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <MsgBoxConstants.au3>
#include <AutoItConstants.au3>
#include <StringConstants.au3>
#include <WindowsConstants.au3>
#include <_FileGetProperty.au3>
#include <ColorConstants.au3>
#include <ButtonConstants.au3>
#include <Date.au3>

Global $stop = 0
$DLL=DllOpen("MediaInfo.dll")
$hGUI = GUICreate("AV1-VMAF", 420, 450, -1, -1)
GUISetBkColor($COLOR_BLACK) ;Tüm GUI arkaplanı siyah olsun
GUICtrlSetDefColor(0xffffff) ;GUI deki tüm yazılar yeşil olsun
$dosyabutton = GUICtrlCreateButton("KAYNAK", 10, 9, 78, 28)
GUICtrlSetFont(-1, 12, 700)
GUICtrlSetTip(-1, "AV1 codec ile dönüştürülecek kaynak dosya")
GUICtrlSetBkColor($dosyabutton, $COLOR_BLACK) ;İlgi kontrolün arkaplanı siyah olsun
$dosyainput = GUICtrlCreateInput("", 88, 10, 322, 25,2048)
GUICtrlSetBkColor($dosyainput, $COLOR_BLACK)
GUICtrlSetFont(-1, 12)
; KAYNAK DOSYA LABEL
$kaynaklab = GUICtrlCreateLabel("KAYNAK DOSYA ÖZELLİKLERİ", 10, 45, 400,25, $SS_CENTER)
GUICtrlSetFont(-1, 10, 700)
$kaynak = GUICtrlCreateEdit("", 10, 65, 400,185, BitOR($WS_VSCROLL, $ES_AUTOVSCROLL, $ES_READONLY))
GUICtrlSetBkColor($kaynak, $COLOR_BLACK)
; HEDEF DOSYA LABEL VE İNPUTLAR
$vlabel = GUICtrlCreateLabel("Video Q Lvl:", 10, 283, 60, 20, $SS_RIGHT)
GUICtrlSetTip(-1, "Hedef Dosyanın kalite değeri(ELLE GİR)"&@CRLF&"0-63 arası bir değer girilmeli"&@CRLF&"40-55 arası düşük kbps.")
$vbitrate = GUICtrlCreateInput("", 80, 280, 50, 20)
GUICtrlSetBkColor($vbitrate, $COLOR_BLACK)
$alabel = GUICtrlCreateLabel("Ses KB/s:", 140, 283, 55, 20, $SS_RIGHT)
GUICtrlSetTip(-1, "Hedef Dosyanın ortalama ses bitrate değeri(ELLE GİR)")
$abitrate = GUICtrlCreateInput("", 200, 280,50, 20)
GUICtrlSetBkColor($abitrate, $COLOR_BLACK)
$fpslabel = GUICtrlCreateLabel("FPS:", 260, 283,50, 20, $SS_RIGHT)
GUICtrlSetTip(-1, "Hedef Dosyanın FPS değeri (Otomatik)"&@CRLF&"23.98 için 24000/1001"&@CRLF&"24 için 24000/1000"&@CRLF&"29.97 için 30000/1001 vb."&@CRLF&"(Otomatik)")
$fpsinput = GUICtrlCreateInput("", 315, 280, 65, 20)
GUICtrlSetBkColor($fpsinput, $COLOR_BLACK)
$keyframeinput = GUICtrlCreateInput("", 315, 310, 50, 20)
GUICtrlSetBkColor($keyframeinput, $COLOR_BLACK)
$genislabel = GUICtrlCreateLabel("Genişlik:", 10, 313, 60, 20, $SS_RIGHT)
GUICtrlSetTip(-1, "Hedef Dosyanın Genişliği(kaynak dosyayla aynı)"&@CRLF&"(Otomatik)")
$genisinput = GUICtrlCreateInput("", 80, 310, 50, 20)
GUICtrlSetBkColor($genisinput, $COLOR_BLACK)
$yukseklabel = GUICtrlCreateLabel("Yükseklik:", 140, 313, 55, 20, $SS_RIGHT)
GUICtrlSetTip(-1, "Hedef Dosyanın Yüksekliği(kaynak dosyayla aynı)"&@CRLF&"(Otomatik)")
$yuksekinput = GUICtrlCreateInput("", 200, 310, 50, 20)
GUICtrlSetBkColor($yuksekinput, $COLOR_BLACK)
$keyframelabel = GUICtrlCreateLabel("Keyframe:", 260, 313, 50, 20, $SS_RIGHT)
GUICtrlSetTip(-1, "Hedef Dosyanın Maksimum Keyframe Değeri"&@CRLF&"FPSx10 olmalı"&@CRLF&"23.98 ve 24 için 240"&@CRLF&"29.97 ve 30 için 300 vb."&@CRLF&"(Otomatik)")
$hedeflabel = GUICtrlCreateLabel("HEDEF DOSYA (FINAL.mkv) AYARLARI", 10, 258, 400, 20, $SS_CENTER)
GUICtrlSetFont(-1, 10, 700)
GUICtrlSetTip(-1, "Bazı ayarlar kaynak dosyadan otomatik alınır. Alınamayan ayarları ELLE GİR.")
; DURUM KISMI
$durumlabel = GUICtrlCreateLabel("Durum:", 10, 340, 60, 20, $SS_RIGHT)
GUICtrlSetFont(-1, 11, 700)
$durumlabel2 = GUICtrlCreateLabel("KAYNAK DOSYAYI SEÇ", 80, 340, 500, 20)
GUICtrlSetFont(-1, 10, 700)
GUICtrlSetColor ($durumlabel2, $COLOR_RED)
$durumlabel3 = GUICtrlCreateLabel("İPTAL EDİLDİ", 80, 340, 500, 20)
GUICtrlSetFont(-1, 10, 1000)
GUICtrlSetState($durumlabel3, $GUI_HIDE)
$timelabel = GUICtrlCreateLabel("Süre:", 10, 365, 60, 20, $SS_RIGHT)
GUICtrlSetFont(-1, 11, 700)
$timelabel2 = GUICtrlCreateLabel("00:00:00", 80, 365, 500, 20)
GUICtrlSetFont(-1, 10, 700)
GUICtrlSetColor ($timelabel2, 0x1af8f8)
; BUTONLAR
$vmafbutton = GUICtrlCreateButton("VMAF", 350, 400, 50, 30)
GUICtrlSetBkColor($vmafbutton, $COLOR_BLACK)
GUICtrlSetTip(-1, "Kaynak dosyaya göre kalite ölçme")
$reset = GUICtrlCreateButton("SIFIRLA", 20, 400, 50, 30)
GUICtrlSetBkColor($reset, $COLOR_BLACK)
GUICtrlSetTip(-1, "Ekrandaki herşeyi sıfırlar")
$cExecute = GUICtrlCreateButton("BAŞLA", 185, 390, 70, 50)
GUICtrlSetBkColor($cExecute, $COLOR_BLACK)
GUICtrlSetTip(-1, "Dönüştürme işlemini başlat")
GUICtrlSetFont(-1, 14, 700)
$iptal = GUICtrlCreateButton("İPTAL", 185, 390, 70, 50)
GUICtrlSetBkColor($iptal, $COLOR_BLACK)
GUICtrlSetFont(-1, 14, 700)
GUICtrlSetState($iptal, $GUI_HIDE)
GUICtrlSetState($vbitrate, $GUI_DISABLE)
GUICtrlSetState($abitrate, $GUI_DISABLE)
GUICtrlSetState($fpsinput, $GUI_DISABLE)
GUICtrlSetState($keyframeinput, $GUI_DISABLE)
GUICtrlSetState($cExecute, $GUI_DISABLE)
GUICtrlSetState($genisinput, $GUI_DISABLE)
GUICtrlSetState($yuksekinput, $GUI_DISABLE)
GUICtrlSetState($vmafbutton, $GUI_DISABLE)
GUISetState(@SW_SHOW)
Global $begin, $hour, $min, $sec
GUIRegisterMsg($WM_COMMAND, "_WM_COMMAND")



While 1
    Switch GUIGetMsg()
        Case -3
            FileDelete(@Scriptdir & "\*.ivf")
            FileDelete(@Scriptdir & "\*.opus")
            FileDelete(@Scriptdir & "\*.fpf")
            Exit
        Case $dosyabutton
                GUICtrlSetState($durumlabel3, $GUI_HIDE)
                GUICtrlSetData($timelabel2, "00:00:00")
        $file = FileOpenDialog("KAYNAK DOSYAYI SEÇ",@DesktopDir & "\","Video Dosyaları (*.avi;*.mpg;*.mkv;*.mp4;*.ogv;*.webm;*.ts;*.mov;*.wmv;*.flv;*.swf;*.f4v;.vob;*.mts;*.m2ts;*.yuv;*.mpg;*.mpeg;*.rm;*.rmvb)")
            If $file Then
                GUICtrlSetdata($dosyainput, $file)
            Else
                GUICtrlSetdata($dosyainput, "")
            EndIf
            If GuiCtrlRead($dosyainput) <> "" Then
                $folder = stringleft($file , StringInStr($file , "\" , 0, -1))
                $folder1 = FileGetShortName($file)
                $folder2 = stringleft($file , StringInStr($file , "\" , 0, -1))
                $folder3 = FileGetShortName($folder2)
                $prop = _FileGetProperty($file)
                GUICtrlSetData($durumlabel2, "DOSYA SEÇİLDİ. DEĞERLERİ DOLDURUN.")
                GUICtrlSetColor ($durumlabel2, $COLOR_RED)
                $frate=StringTrimRight($prop[316][1], 12)
                $fr1=StringTrimLeft(BinaryToString(StringToBinary($frate)), 1)
                GUICtrlSetState($vbitrate, $GUI_ENABLE)
                GUICtrlSetData($vbitrate, "51")
                GUICtrlSetState($abitrate, $GUI_ENABLE)
                GUICtrlSetData($abitrate, "32")
                GUICtrlSetState($vmafbutton, $GUI_ENABLE)
                GUICtrlSetState($cExecute, $GUI_ENABLE)
                $Handle=DllCall($DLL, "ptr", "MediaInfo_New")
                $Open_Result=DllCall($DLL, "int", "MediaInfo_Open", "ptr", $Handle[0], "wstr", $folder1)
                DllCall($DLL, "wstr", "MediaInfo_Option", "ptr", 0, "wstr", "Complete", "wstr", "")
                $Inform=DllCall($DLL, "wstr", "MediaInfo_Inform", "ptr", $Handle[0], "int", 0)
                GUICtrlSetData($kaynak, $Inform[0])
                $search = GUICtrlRead($kaynak)
                If Not StringInStr($search, "Channel") Then
                    GUICtrlSetState($abitrate, $GUI_DISABLE)
                    GUICtrlSetData($abitrate, "")
                EndIf
                    If $fr1 = 24.00 Then
                        GUICtrlSetData($fpsinput, "24000/1000")
                        GUICtrlSetData($keyframeinput, "240")
                    ElseIf $fr1 = 25.00 Then
                        GUICtrlSetData($fpsinput, "25000/1000")
                        GUICtrlSetData($keyframeinput, "250")
                    ElseIf $fr1 = 30.00 Then
                        GUICtrlSetData($fpsinput, "30000/1000")
                        GUICtrlSetData($keyframeinput, "300")
                    ElseIf $fr1 = 23.98 Then
                        GUICtrlSetData($fpsinput, "24000/1001")
                        GUICtrlSetData($keyframeinput, "240")
                    ElseIf $fr1 = 29.97 Then
                        GUICtrlSetData($fpsinput, "30000/1001")
                        GUICtrlSetData($keyframeinput, "300")
                    ElseIf $fr1 = 60.00 Then
                        GUICtrlSetData($fpsinput, "60000/1000")
                        GUICtrlSetData($keyframeinput, "600")
                    ElseIf $fr1 = 59.40 Then
                        GUICtrlSetData($fpsinput, "60000/1001")
                        GUICtrlSetData($keyframeinput, "600")
                    Else
                        GUICtrlSetData($fpsinput, "Elle Gir")
                        GUICtrlSetData($keyframeinput, "FPS x 10")
                    EndIf
                GUICtrlSetData($genisinput, $prop[317][1])
                GUICtrlSetData($yuksekinput, $prop[315][1])
                GUICtrlSetState($fpsinput, $GUI_ENABLE)
                GUICtrlSetState($keyframeinput, $GUI_ENABLE)
                GUICtrlSetState($genisinput, $GUI_ENABLE)
                GUICtrlSetState($yuksekinput, $GUI_ENABLE)
            Else
                GUICtrlSetState($vbitrate, $GUI_DISABLE)
                GUICtrlSetState($abitrate, $GUI_DISABLE)
                GUICtrlSetState($cExecute, $GUI_DISABLE)
                GUICtrlSetState($vmafbutton, $GUI_DISABLE)
                GUICtrlSetState($fpsinput, $GUI_DISABLE)
                GUICtrlSetState($keyframeinput, $GUI_DISABLE)
                GUICtrlSetdata($dosyainput, "")
                GUICtrlSetData($durumlabel2, "KAYNAK DOSYA SEÇİLMEDİ!")
                GUICtrlSetColor ($durumlabel2, $COLOR_RED)
                GUICtrlSetState($genisinput, $GUI_DISABLE)
                GUICtrlSetState($yuksekinput, $GUI_DISABLE)
                GUICtrlSetData($vbitrate, "")
                GUICtrlSetData($abitrate, "")
                GUICtrlSetData($fpsinput, "")
                GUICtrlSetData($keyframeinput, "")
                GUICtrlSetData($genisinput, "")
                GUICtrlSetData($yuksekinput, "")
                GUICtrlSetData($kaynak, "")
                $timelabel2 = GUICtrlCreateLabel("00:00:00", 80, 365, 500, 20)
                GUICtrlSetFont($timelabel2, 10, 700)
                GUICtrlSetColor ($timelabel2, 0x1af8f8)
            EndIf

        Case $reset
                GUICtrlSetState($cExecute, $GUI_DISABLE)
                GUICtrlSetState($vmafbutton, $GUI_DISABLE)
                GUICtrlSetState($abitrate, $GUI_ENABLE)
                GUICtrlSetdata($dosyainput, "")
                GUICtrlSetData($vbitrate, "")
                GUICtrlSetData($abitrate, "")
                GUICtrlSetdata($genisinput, "")
                GUICtrlSetData($yuksekinput, "")
                GUICtrlSetData($keyframeinput, "")
                GUICtrlSetData($fpsinput, "")
                GUICtrlSetData($kaynak, "")
                GUICtrlSetData($durumlabel2, "KAYNAK DOSYAYI SEÇ")
                GUICtrlSetColor ($durumlabel2, $COLOR_RED)
                GUICtrlSetData($timelabel2, "00:00:00")
                GUICtrlSetState($iptal, $GUI_HIDE)
                GUICtrlSetState($cExecute, $GUI_SHOW)
                GUICtrlSetState($durumlabel3, $GUI_HIDE)
                GUICtrlSetState($dosyabutton, $GUI_ENABLE)

        Case $cExecute
                GUICtrlSetState($durumlabel3, $GUI_HIDE)
                GUICtrlSetData($timelabel2, "00:00:00")
                GUICtrlSetState($dosyabutton, $GUI_DISABLE)
                $vb = GuiCtrlRead($vbitrate)
                $ab = GuiCtrlRead($abitrate)
                $fps = GuiCtrlRead($fpsinput)
                $kf = GuiCtrlRead($keyframeinput)
                $gi = GuiCtrlRead($genisinput)
                $yi = GuiCtrlRead($yuksekinput)
            Local $iFileExists = FileExists(@DesktopDir & "\FINAL.mkv")
                If $iFileExists Then
                    GUICtrlSetData($durumlabel2, "Masaüstünde FINAL.mkv mevcut.")
                    GUICtrlSetColor ($durumlabel2, $COLOR_RED)
                    GUICtrlSetData($cExecute, "BAŞLA")
                    GUICtrlSetState($abitrate, $GUI_ENABLE)
                    GUICtrlSetState($dosyabutton, $GUI_ENABLE)
                Else
        If $vb <> "" And $ab = "" And $fps <> "" And $gi <> "" And $yi <> "" And $kf <> "" Then
            GUICtrlSetState($iptal, $GUI_SHOW)
            GUICtrlSetState($cExecute, $GUI_HIDE)
            GUICtrlSetState($vbitrate, $GUI_DISABLE)
            GUICtrlSetState($abitrate, $GUI_DISABLE)
            GUICtrlSetState($vmafbutton, $GUI_DISABLE)
            GUICtrlSetState($fpsinput, $GUI_DISABLE)
            GUICtrlSetState($genisinput, $GUI_DISABLE)
            GUICtrlSetState($yuksekinput, $GUI_DISABLE)
            GUICtrlSetState($keyframeinput, $GUI_DISABLE)
            GUICtrlSetState($reset, $GUI_DISABLE)
            GUICtrlSetState($dosyabutton, $GUI_DISABLE)
            GUICtrlSetData($durumlabel2, "SES OLMADAN DÖNÜŞTÜRÜLÜYOR...")
            GUICtrlSetColor ($durumlabel2, $COLOR_RED)
            GUICtrlSetState($iptal, $GUI_ENABLE)
            $begin = TimerInit()
            AdlibRegister("SetTime", 1000)
            _Sessizwmaf($kaynak)
            AdlibUnRegister("SetTime")
            GUICtrlSetState($vbitrate, $GUI_ENABLE)
            GUICtrlSetState($abitrate, $GUI_ENABLE)
            GUICtrlSetState($cExecute, $GUI_ENABLE)
            GUICtrlSetState($vmafbutton, $GUI_ENABLE)
            GUICtrlSetState($reset, $GUI_ENABLE)
            GUICtrlSetState($fpsinput, $GUI_ENABLE)
            GUICtrlSetState($genisinput, $GUI_ENABLE)
            GUICtrlSetState($yuksekinput, $GUI_ENABLE)
            GUICtrlSetState($keyframeinput, $GUI_ENABLE)
            GUICtrlSetState($iptal, $GUI_HIDE)
            GUICtrlSetState($cExecute, $GUI_SHOW)
            GUICtrlSetState($dosyabutton, $GUI_ENABLE)
            GUICtrlSetData($kaynak, "")
            WinActivate($hGUI)
        ElseIf $vb <> "" And $ab <> "" And $fps <> "" And $gi <> "" And $yi <> "" And $kf <>  "" Then
            GUICtrlSetState($iptal, $GUI_SHOW)
            GUICtrlSetState($cExecute, $GUI_HIDE)
            GUICtrlSetState($dosyabutton, $GUI_DISABLE)
            GUICtrlSetState($vbitrate, $GUI_DISABLE)
            GUICtrlSetState($abitrate, $GUI_DISABLE)
            GUICtrlSetState($vmafbutton, $GUI_DISABLE)
            GUICtrlSetState($fpsinput, $GUI_DISABLE)
            GUICtrlSetState($genisinput, $GUI_DISABLE)
            GUICtrlSetState($yuksekinput, $GUI_DISABLE)
            GUICtrlSetState($keyframeinput, $GUI_DISABLE)
            GUICtrlSetState($reset, $GUI_DISABLE)
            GUICtrlSetData($durumlabel2, "DÖNÜŞTÜRÜLÜYOR...")
            GUICtrlSetColor ($durumlabel2, $COLOR_RED)
            GUICtrlSetState($iptal, $GUI_ENABLE)
            $begin = TimerInit()
            AdlibRegister("SetTime", 1000)
            _Sesliwmaf($kaynak)
            AdlibUnRegister("SetTime")
            GUICtrlSetState($vbitrate, $GUI_ENABLE)
            GUICtrlSetState($abitrate, $GUI_ENABLE)
            GUICtrlSetState($cExecute, $GUI_ENABLE)
            GUICtrlSetState($vmafbutton, $GUI_ENABLE)
            GUICtrlSetState($reset, $GUI_ENABLE)
            GUICtrlSetState($fpsinput, $GUI_ENABLE)
            GUICtrlSetState($genisinput, $GUI_ENABLE)
            GUICtrlSetState($yuksekinput, $GUI_ENABLE)
            GUICtrlSetState($keyframeinput, $GUI_ENABLE)
            GUICtrlSetState($iptal, $GUI_HIDE)
            GUICtrlSetState($cExecute, $GUI_SHOW)
            GUICtrlSetState($dosyabutton, $GUI_ENABLE)
            GUICtrlSetData($kaynak, "")
            WinActivate($hGUI)
        Else
            GUICtrlSetData($durumlabel2, "AYARLAR DOLDURULMADI!")
            GUICtrlSetColor ($durumlabel2, $COLOR_RED)
            GUICtrlSetState($iptal, $GUI_HIDE)
            GUICtrlSetState($cExecute, $GUI_SHOW)
        EndIf
                EndIf

        Case $vmafbutton
                GUICtrlSetData($timelabel2, "00:00:00")
                $file4 = FileOpenDialog("KALİTESİ KONTROL EDİLECEK DOSYA",@DesktopDir & "\","Video Dosyaları (*.avi;*.mpg;*.mkv;*.mp4;*.ogv;*.webm;*.ts;*.mov;*.wmv;*.flv;*.swf;*.f4v;.vob;*.mts;*.m2ts;*.yuv;*.mpg;*.mpeg;*.rm;*.rmvb)")
                $folder1 = FileGetShortName($file)
                $folder4 = FileGetShortName($file4)
                $vmaffile = stringright($folder4 , StringLen($folder4) - StringInStr($folder4 , "\" , 0, -1))
                $vmaforj = stringright($folder1 , StringLen($folder1) - StringInStr($folder1 , "\" , 0, -1))
                    If $file4 Then
                    $begin = TimerInit()
                    AdlibRegister("SetTime", 1000)
                    _wmaf($kaynak)
                    AdlibUnRegister("SetTime")
                    Else
                        GUICtrlSetData($durumlabel2, "KALİTESİ ÖLÇÜLECEK DOSYA SEÇİLMEDİ.")
                        GUICtrlSetColor ($durumlabel2, $COLOR_RED)
                    EndIf
    EndSwitch
WEnd

Func _WM_COMMAND($hWnd, $Msg, $wParam, $lParam)
 #forceref $hWnd, $Msg, $lParam
   If BitAND($wParam, 0xFFFF) = $iptal Then $stop = 1
  Return 'GUI_RUNDEFMSG'
EndFunc

Func _wmaf($kaynak)
            Local $cmd2 = Run(@ComSpec & " /c " & "ffmpeg -hide_banner -nostats -i " & $folder4 & " -i " & $folder1 & " -lavfi libvmaf=model='path=vmaf_v0.6.1neg.json':n_threads=8 -f null -", @ScriptDir, @SW_HIDE, $STDERR_MERGED)
            Local $Output2
            GUICtrlSetData($durumlabel2, "KALİTE ÖLÇÜMÜ GERÇEKLEŞTİRİLİYOR...")
            GUICtrlSetColor ($durumlabel2, $COLOR_RED)
    While 1
        GUICtrlSetData($kaynak, $Output2)
        $Output2 &= StdoutRead($cmd2)
        If @error Then ExitLoop
        Sleep(50)
    WEnd
    GUICtrlSetFont($kaynak, 12)
    GUICtrlSetData($kaynak, $vmaffile & " dosyasinin " & $vmaforj & " dosyasina gore kalitesi:" &@CRLF&@CRLF&@CRLF&StringRight($Output2, 11))
    GUICtrlSetData($durumlabel2, "KALİTE ÖLÇÜLDÜ.")
    GUICtrlSetColor ($durumlabel2, $COLOR_GREEN)
EndFunc

Func _Sessizwmaf($kaynak)
            Local $cmd1 = Run(@ComSpec & " /c " & "@echo off && cls && echo Video 1. pass && ffmpeg -i " & $folder1 & " -f rawvideo -pix_fmt yuv420p -loglevel quiet - | aomenc -q -w " & $gi & " -h "& $yi & " --fps=" & $fps & " --passes=2 --pass=1 --psnr=0 --bit-depth=10 --ivf --threads=8 --end-usage=q --cq-level=" & $vb & " --kf-max-dist=" & $kf & " --cpu-used=2 --auto-alt-ref=1 --static-thresh=0 --tile-columns=1 --tile-rows=0 --enable-tpl-model=1 --coeff-cost-upd-freq=0 --mode-cost-upd-freq=0 --mv-cost-upd-freq=0 --enable-dnl-denoising=0 --fpf=1.fpf -o " & @DesktopDir & "\FINAL.mkv - NUL && echo 1. pass bitti! && echo Video 2. pass && ffmpeg -i " & $folder1 & " -f rawvideo -pix_fmt yuv420p -loglevel quiet - | aomenc -q -w " & $gi & " -h "& $yi & " --fps=" & $fps & " --passes=2 --pass=2 --psnr=0 --bit-depth=10 --ivf --threads=8 --end-usage=q --cq-level=" & $vb & " --kf-max-dist=" & $kf & " --cpu-used=2 --auto-alt-ref=1 --static-thresh=0 --tile-columns=1 --tile-rows=0 --enable-tpl-model=1 --coeff-cost-upd-freq=0 --mode-cost-upd-freq=0 --mv-cost-upd-freq=0 --enable-dnl-denoising=0 --fpf=1.fpf -o " & @DesktopDir & "\FINAL.mkv - && echo Hedef dosya FINAL.mkv masaustunde hazirdir. && echo KALITESI OLCULUYOR... && echo . && echo . && echo . && echo . && ffmpeg -hide_banner -nostats -i " & @DesktopDir & "\FINAL.mkv  -i " & $folder1 & " -lavfi libvmaf=model='path=vmaf_v0.6.1neg.json':n_threads=8 -f null -", @ScriptDir, @SW_HIDE, 8)
            Local $Output1
    While 1
        If $stop = 1 Then
            GUICtrlSetState($durumlabel3, $GUI_SHOW)
            ProcessClose("aomenc.exe")
            ProcessClose("mkvmerge.exe")
            ProcessClose("ffmpeg.exe")
            Exitloop
        EndIf
        GUICtrlSetData($kaynak, $Output1)
        $Output1 &= StdoutRead($cmd1)

        If @error Then ExitLoop
        Sleep(50)
    WEnd
    GUICtrlSetData($kaynak, $Output1)
    GUICtrlSetData($durumlabel2, "BİTTİ. Kalite: " & StringRight($Output1, 11))
    GUICtrlSetColor ($durumlabel2, $COLOR_GREEN)
    $stop = 0
EndFunc

Func _Sesliwmaf($kaynak)
            Local $cmd3 = Run(@ComSpec & " /c " & "@echo off && cls && echo Video 1. pass && ffmpeg -i " & $folder1 & " -f rawvideo -pix_fmt yuv420p -loglevel quiet - | aomenc -q -w " & $gi & " -h "& $yi & " --fps=" & $fps & " --passes=2 --pass=1 --psnr=0 --bit-depth=10 --ivf --threads=8 --end-usage=q --cq-level=" & $vb & " --kf-max-dist=" & $kf & " --cpu-used=2 --auto-alt-ref=1 --static-thresh=0 --tile-columns=1 --tile-rows=0 --enable-tpl-model=1 --coeff-cost-upd-freq=0 --mode-cost-upd-freq=0 --mv-cost-upd-freq=0 --enable-dnl-denoising=0 --fpf=1.fpf -o out.ivf - NUL && echo 1. pass bitti! && echo Video 2. pass... && ffmpeg -i " & $folder1 & " -f rawvideo -pix_fmt yuv420p -loglevel quiet - | aomenc -q -w " & $gi & " -h "& $yi & " --fps=" & $fps & " --passes=2 --pass=2 --psnr=0 --bit-depth=10 --ivf --threads=8 --end-usage=q --cq-level=" & $vb & " --kf-max-dist=" & $kf & " --cpu-used=2 --auto-alt-ref=1 --static-thresh=0 --tile-columns=1 --tile-rows=0 --enable-tpl-model=1 --coeff-cost-upd-freq=0 --mode-cost-upd-freq=0 --mv-cost-upd-freq=0 --enable-dnl-denoising=0 --fpf=1.fpf -o out.ivf - NUL && echo 2. pass bitti! && echo Ses dosyasi hazirlaniyor... && ffmpeg -loglevel quiet -i "& $folder1 & " -c:a libopus -vbr off -b:a " & $ab & "k -ac 2 -y out.opus && echo Ses dosyasi hazirlandi! && echo Video ve ses dosyasi birlestiriliyor... && mkvmerge -q -o " & @DesktopDir & "\FINAL.mkv out.ivf out.opus && echo Hedef dosya FINAL.mkv masaustunde hazirdir. && echo KALITESI OLCULUYOR... && echo . && echo . && echo . && echo . && ffmpeg -hide_banner -nostats -i " & @DesktopDir & "\FINAL.mkv  -i " & $folder1 & " -lavfi libvmaf=model='path=vmaf_v0.6.1neg.json':n_threads=8 -f null -", @ScriptDir, @SW_HIDE, 8)
            Local $Output3
    While 1
        If $stop = 1 Then
            GUICtrlSetState($durumlabel3, $GUI_SHOW)
            ProcessClose("aomenc.exe")
            ProcessClose("mkvmerge.exe")
            ProcessClose("ffmpeg.exe")
            Exitloop
        EndIf
        GUICtrlSetData($kaynak, $Output3)
        $Output3 &= StdoutRead($cmd3)

        If @error Then ExitLoop
        Sleep(50)
    WEnd
    GUICtrlSetData($kaynak, $Output3)
    GUICtrlSetData($durumlabel2, "BİTTİ. Kalite: " & StringRight($Output3, 11))
    GUICtrlSetColor ($durumlabel2, $COLOR_GREEN)
    $stop = 0
EndFunc

Func SetTime()
    Local $time = _TicksToTime(Int(TimerDiff($begin)), $hour, $min, $sec)
    ControlSetText($hGUI, "", $timelabel2, StringFormat("%02i:%02i:%02i", $hour, $min, $sec))
EndFunc

 

It's ffmpeg based AVI converter. (Video to AV1)

My code works perfectly when I press F5 from Scite window but, when I convert it with Aut2exe(32 bit), builded exe starts normal, but when I select a file it gives error in attachment. I'm using AutoIt 3.3.16. Windows 10 64-bit Pro. My script doesn't have 8680 lines and I don't understand why builded exe doesn't work.

 

NOTE: When I press Build(F7) on Scite, it builds exe and it works perfectly again. What is the problem? Why builded exe from aut2exe doesn't work normal? 

Adsız.jpg

Edited by Atakanbasturk
Link to post
Share on other sites
  • Developers
Posted (edited)

Run au3stripper with parameter /mo to merge your script together and you can check the output file around line 8680 whether that tells you anything, as this script is way to big & complex for others to debug for you. ;) 

Jos

 

Edited by Jos

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

I tried and it creates xx_striped.au3 file and it contains just "ണ". Thats it. Nothing else.

 

AU3Stripper.exe /mo
- 2.36 Iteration 1 Strip Functions result: Output  1 lines, stripped 0 Func lines and 402 Commentlines
- 2.36 Iteration 2 Strip Variables result: Output  1 lines and stripped 0 lines
+> Au3Stripper v19.1127.1402.0 finished merging 403 lines of code, stripped 402 comment lines and Merged 0 Continuation lines.
+>        Created:C:\Users\xxxx\Desktop\a_stripped.au3 with 1 lines.

Adsız.jpg

Link to post
Share on other sites
Quote

 Error: Subscript used on non-accessible variable.

 

All functions which return array must be checked after their calling by:

"If @error Then ..." or

"If UBound($a_ret) Then ..." or 

"If IsArray($a_ret) Then ..."

 

In your script it's only at these few lines:

                $prop = _FileGetProperty($file)
                If @error Then ...
                GUICtrlSetData($durumlabel2, "DOSYA SEÇİLDİ. DEĞERLERİ DOLDURUN.")
                GUICtrlSetColor ($durumlabel2, $COLOR_RED)
                $frate=StringTrimRight($prop[316][1], 12)

 

                $Handle=DllCall($DLL, "ptr", "MediaInfo_New")
                If @error Then ...
                $Open_Result=DllCall($DLL, "int", "MediaInfo_Open", "ptr", $Handle[0], "wstr", $folder1)
                DllCall($DLL, "wstr", "MediaInfo_Option", "ptr", 0, "wstr", "Complete", "wstr", "")
                If @error Then ...
                $Inform=DllCall($DLL, "wstr", "MediaInfo_Inform", "ptr", $Handle[0], "int", 0)
                If @error Then ...
                GUICtrlSetData($kaynak, $Inform[0])

 

Edited by Zedna
Link to post
Share on other sites
  • Developers

Should work fine also when it contains a BOM, when ran from SciTE with AutoIt3Wrapper.
Just add these to your SciTEUser.properties: 

command.46.$(au3)="$(SciteDefaultHome)\..\AutoIt3.exe" "$(SciteDefaultHome)\AutoIt3Wrapper\AutoIt3Wrapper.au3" /Prod /AU3Stripper /in "$(FilePath)"
#~ command.46.*="$(SciteDefaultHome)\TextEncodingDetect.exe" "$(FilePath)"
command.name.46.*=Au3Stripper
command.save.before.46.*=1
command.is.filter.46.*=1
command.shortcut.46.*=Ctrl+Shift+O

... and this line to the source:

#Au3Stripper_Parameters = /mo

...and hit Ctrl+Shift+O to run au3stripper.

Show the Console output in case it doesn't work. 

Jos :)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to post
Share on other sites

Problem about different behaviour when running compiled/uncomplied can be (maybe) different implicit 32/64 bit mode.

32/64 bit mode is important when you call external DLL functions by DllCall(). Your EXE must be the same 32/64 bit type as external DLL.

To avoid this problem use explicit compilator option (force 32bit compilation when using 32bit DLL) :

#AutoIt3Wrapper_UseX64=n

or

#pragma compile(x64, False)
Edited by Zedna
Link to post
Share on other sites
Posted (edited)

Thanks everybody. The problem is, like Zedna says, 32-64 bit mode choice. When I use 64-bit mode compile with aut2exe, builded exe works fine. But 32-bit builded.exe gives that error. I think problem is 64-bit MediaInfo.dll. But my problem solved. Thank you guys so much. I love this forum.

 

Edit: Yes, I downloaded 32-bit MediaInfo and put script folder, 32-bit builded exe worked flawlessly.

Edited by Atakanbasturk
Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...