This is part of my script: " # Set hardware acceleration options based on codec if…
- User
This is part of my script:
" # Set hardware acceleration options based on codec if (codecName -eq "h264") { hwaccelOptions = "-hwaccel qsv -hwaccel_device auto" global:VideoLibrary = "h264_qsv" } else { hwaccelOptions = "" $global:VideoLibrary = "libx264" }
# Scan the file with FFMPEG If ($global:LimitCPU) { ffmpeg.exe -v error $hwaccelOptions -i $fullName -max_muxing_queue_size 1024 -f null -threads $global:CPULimt - >$ffmpegLog 2>&1 } Else { ffmpeg.exe -v error $hwaccelOptions -i $fullName -max_muxing_queue_size 1024 -f null - >$ffmpegLog 2>&1 }"I now get this output:
"ffmpeg.exe : Unrecognized option 'hwaccel qsv -hwaccel_device auto'. At C:\Users\Thomas\Skrivebord\ScanMedia\ScanMedia.ps1:346 char:9
-
ffmpeg.exe -v error $hwaccelOptions -i $fullName -max_muxing_ ... -
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~- CategoryInfo : NotSpecified: (Unrecognized op...l_device auto'.:String) [], RemoteException
- FullyQualifiedErrorId : NativeCommandError
Error splitting the argument list: Option not found"
What's wrong with it?
-
- Assistant
The issue arises because
$hwaccelOptionsis being treated as a single argument when passed toffmpeg.exe, rather than separate arguments. When you set$hwaccelOptionslike this:$hwaccelOptions = "-hwaccel qsv -hwaccel_device auto"and then include it in your
ffmpeg.execommand:ffmpeg.exe -v error $hwaccelOptions -i $fullName ...