Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Last chunks in encode never complete #905

Open
Ironclad17 opened this issue Dec 31, 2024 · 2 comments
Open

Last chunks in encode never complete #905

Ironclad17 opened this issue Dec 31, 2024 · 2 comments

Comments

@Ironclad17
Copy link

Ironclad17 commented Dec 31, 2024

A recurring issue I've seen with svt-av1, is that av1an will stop processing new frames near the end of an encode occasionally. The program will not freeze as the timer and fps counter will continue to update, but there is no cpu load and no new frames completed for many hours. This only appears to occur with .vpy files as inputs and when the last set of chunks for each worker are being processed.
av1an.log
Update: The problem does appear to be due to vspipe processes hanging, not av1an itself. Ending one in task manager allows av1an to continue processing chunks.

@Ironclad17
Copy link
Author

Ironclad17 commented Dec 31, 2024

I should rule out if this is due to any background applications I have. It may be due to a thread scheduling program.
Update: No even without any other programs affecting process priority or cpu pinning, the issue persists.

@Ironclad17
Copy link
Author

A workaround is to run a service in task scheduler that ends any vspipe instances that remain open for too long.

# Check if av1an.exe is running
$av1anProcess = Get-Process -Name "av1an" -ErrorAction SilentlyContinue

if ($null -eq $av1anProcess) {
    Write-Output "av1an.exe is not running. Exiting script."
    exit
}

# Define the maximum allowed runtime in seconds (10 minutes = 600 seconds)
$maxRuntime = 300

# Get the current date and time
$currentTime = Get-Date

# Get all instances of vspipe.exe
$vspipeProcesses = Get-Process -Name "vspipe" -ErrorAction SilentlyContinue

foreach ($process in $vspipeProcesses) {
    # Calculate the runtime of the process
    $processStartTime = $process.StartTime
    $runtime = ($currentTime - $processStartTime).TotalSeconds

    # Check if the runtime exceeds the maximum allowed time
    if ($runtime -ge $maxRuntime) {
        # Terminate the process
        try {
            Stop-Process -Id $process.Id -Force
            Write-Output "Terminated vspipe.exe (PID $($process.Id)) running for $runtime seconds."
        } catch {
            Write-Output "Failed to terminate vspipe.exe (PID $($process.Id)). Error: $_"
        }
    }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant