Skip to content

Commit

Permalink
Keep ffmpeg log file if test fails
Browse files Browse the repository at this point in the history
  • Loading branch information
froschgrosch committed Jun 20, 2024
1 parent 1e5b4a3 commit 6e04e04
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions scripts/record.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,16 @@ function Write-RecordInfo {

function Test-RecordingMode ($id) {
if ($config.skipTest.mode) { return $true }
$filepath = "$($config.path.record)\test.mkv"
$arguments = '-hide_banner', '-y', '-t 1' + $config.modes.record[$id].data + $filepath
$arguments = '-hide_banner', '-y', '-t 1' + $config.modes.record[$id].data + "$($config.path.record)\test.mkv"

$proc = Start-Process -PassThru -Wait -FilePath 'ffmpeg' -ArgumentList $arguments
$Env:FFREPORT = 'file=test.ff.log:level=48'
$proc = Start-Process -PassThru -Wait -FilePath 'ffmpeg' -WindowStyle Hidden -ArgumentList $arguments -WorkingDirectory $config.path.record
$Env:FFREPORT = ''

if(Test-Path -PathType leaf $filepath) {
Remove-Item $filepath
if($success = $proc.ExitCode -eq 0) {
Remove-Item "$($config.path.record)\test.*"
}
return $proc.ExitCode -eq 0
return $success
}

# === INITIALIZATION ===
Expand Down

0 comments on commit 6e04e04

Please sign in to comment.