0

Per the suggestion from mklement0 I have shortened the output here to just the relevant code and error. Additionally, as he pointed out, I have changed how I am constructing the arguments (now passing as an array).

Additionally, the comment from kesh, I removed the "-filter_complex" and changed to just several "-map" 's.

$TEMPDIR = "E:\MediaConversions\BitLadder"
$FOLDER = 'White.Boy.Rick.2018.1080p.WEB-DL.H264.AC3-EVO'
$OUTPUTDIR = $TEMPDIR + '\' + $FOLDER

# Mux the 8 Bitrate Ladder steps into a single file, with a common audio stream
$STEPS = @(Get-ChildItem -Path $OUTPUTDIR -Name)
$INPUT_FILES = @()
$MAP = @()
$COUNT = 0
ForEach ($STEP in $STEPS){
    $INPUT_FILES += ('-i', "$STEP")
    $MAP += ('-map ' + "$COUNT" + ':v', '-map ' + "$COUNT" + ':a') 
    $COUNT++
}

$OPTIONS = ('-' + "$INPUT_FILES", "$MAP")
#$OPTIONS
D:\Applications\ffmpeg\bin\ffmpeg.exe "$OPTIONS" -f matroska "E:\MediaConversions\White.Boy.Rick.2018_MultiStreamTest_AAC.H264.mkv"

But Sadly, I still get the same frustrating error:

Unrecognized option '-i White.Boy.Rick.2018.1080p.WEB-DL.H264.AC3-EVO_STEP1.mp4 -i White.Boy.Rick.2018.1080p.WEB-DL.H264.AC3-EVO_STEP2.mp4 -i White.Boy.Rick.2018.1080p.WEB-DL.H264.AC3-EVO_STEP3.mp4 -i White.Boy.Rick.2018.1080p.WEB-DL.H264.AC3-EVO_STEP4.mp4 -i White.Boy.Rick.2018.1080p.WEB-DL.H264.AC3-EVO_STEP5.mp4 -i White.Boy.Rick.2018.1080p.WEB-DL.H264.AC3-EVO_STEP6.mp4 -i White.Boy.Rick.2018.1080p.WEB-DL.H264.AC3-EVO_STEP7.mp4 -i White.Boy.Rick.2018.1080p.WEB-DL.H264.AC3-EVO_STEP8.mp4 -map 0:v -map 0:a -map 1:v -map 1:a -map 2:v -map 2:a -map 3:v -map 3:a -map 4:v -map 4:a -map 5:v -map 5:a -map 6:v 
-map 6:a -map 7:v -map 7:a'.
Error splitting the argument list: Option not found
misteralexander
  • 448
  • 2
  • 7
  • 19
  • 1
    That's a lot of information and code to go through. One thing to note: In order to programmatically pass arguments to external programs, construct an _array_, with each parameter (option) name and parameter value / positional argument (operand) becoming its own element. E.g., to execute `foo -o "bar baz"`, use `$a = '-o', 'bar baz'; foo $a` – mklement0 Aug 15 '22 at 21:59
  • The problem I pointed out in my previous comment persists in your updated question. You need to create a flat array of tokens, with each option name and value becoming its own element, as demonstrated in the linked duplicate. – mklement0 Aug 16 '22 at 21:46

1 Answers1

0

You don't need -complex_filter just to map input streams to output file. You just need to use -map as many times as you have streams:

... -map 0:v -map 1:v ... -map 0:a -map 1:a ...
kesh
  • 4,515
  • 2
  • 12
  • 20