title: ffmpeg does not produce result with C# process
body: <p>So, I'm facing a really strange issue. When I run &quot;ffmpeg&quot; through C# process, it doesn't work for multiple commands (concatenated with &amp;). However, it works for simple/single command and even produces output. I checked the logs through &quot;Standard Error&quot; and it appears that it fails in &quot;concat&quot; command.</p>
  <p>This line specifically indicates the error in the ffmpeg created log:
  <code>concat:CoverImage_Video_Landscape_fd8dbbb5-63c0-4ff0-b0c6-e6c3c8f590aa.ts|Downloaded_Video_fd8dbbb5-63c0-4ff0-b0c6-e6c3c8f590aa.ts: No such file or directory</code></p>
  <p>Now, the code snippet is as follows:</p>
  <pre><code>string arguments = $&quot;-loop 1 -i \&quot;{physicalPath}bin\\CoverImage_Video_Landscape_{guid}.png\&quot; -f lavfi -i anullsrc -t 3 -c:v libx264 -c:a aac -b:a 160k -t 3 -pix_fmt yuv420p -vf scale={videoWidth}:{videoHeight} -y \&quot;{physicalPath}bin\\CoverImage_Video_Landscape_{guid}.ts\&quot;&quot; 
  + $&quot; &amp; -i \&quot;{physicalPath}bin\\{objectNameWithoutExtension}.mp4\&quot; -c:v libx264 -c:a aac -b:a 160k -f mpegts \&quot;{physicalPath}bin\\{objectNameWithoutExtension}.ts\&quot;&quot; 
  + $&quot; &amp; -i \&quot;concat:CoverImage_Video_Landscape_{guid}.ts|{objectNameWithoutExtension}.ts\&quot; -c copy \&quot;{fileAssetRootPath}\\Video\\Output\\{outputVideoName}.mp4\&quot;&quot;;
  
              process = new Process();
              process.StartInfo.FileName = ffmpegPath;
              process.StartInfo.Arguments = arguments;
              process.StartInfo.CreateNoWindow = true;
              process.StartInfo.UseShellExecute = false;
              process.StartInfo.RedirectStandardOutput = true;
              process.StartInfo.RedirectStandardError = true;
  
              process.EnableRaisingEvents = true;
              process.Exited += new EventHandler(process_Exited);
              process.Start();
              string stResult = process.StandardOutput.ReadToEnd();
              string erResult = process.StandardError.ReadToEnd();
              process.WaitForExit();
  </code></pre>
  <p>&quot;Physical Path&quot; -&gt; Application directory (bin) folder
  &quot;File Asset Path&quot; -&gt; The directory in which I'm storing uploaded resources</p>
  <p>Now, the strange part. During debugging, if I just copy the &quot;arguments&quot; variable value and execute it in CMD directly in &quot;bin&quot; folder, I get perfect results. Everything works. Here's the actual query generated:</p>
  <pre><code>ffmpeg -loop 1 -i &quot;E:\Projects\Freelance\UP - Inspire3 (Karl)\AWS S3 Bucket Editing Routine\Code\AWSAPI\AWSAPI\bin\CoverImage_Video_Landscape_fd8dbbb5-63c0-4ff0-b0c6-e6c3c8f590aa.png&quot; -f lavfi -i anullsrc -t 3 -c:v libx264 -c:a aac -b:a 160k -t 3 -pix_fmt yuv420p -vf scale=1920:964 -y &quot;E:\Projects\Freelance\UP - Inspire3 (Karl)\AWS S3 Bucket Editing Routine\Code\AWSAPI\AWSAPI\bin\CoverImage_Video_Landscape_fd8dbbb5-63c0-4ff0-b0c6-e6c3c8f590aa.ts&quot; &amp; ffmpeg -i &quot;E:\Projects\Freelance\UP - Inspire3 (Karl)\AWS S3 Bucket Editing Routine\Code\AWSAPI\AWSAPI\bin\Downloaded_Video_fd8dbbb5-63c0-4ff0-b0c6-e6c3c8f590aa.mp4&quot; -c:v libx264 -c:a aac -b:a 160k -f mpegts &quot;E:\Projects\Freelance\UP - Inspire3 (Karl)\AWS S3 Bucket Editing Routine\Code\AWSAPI\AWSAPI\bin\Downloaded_Video_fd8dbbb5-63c0-4ff0-b0c6-e6c3c8f590aa.ts&quot; &amp; ffmpeg -i &quot;concat:CoverImage_Video_Landscape_fd8dbbb5-63c0-4ff0-b0c6-e6c3c8f590aa.ts|Downloaded_Video_fd8dbbb5-63c0-4ff0-b0c6-e6c3c8f590aa.ts&quot; -c copy &quot;E:\Projects\Freelance\UP - Inspire3 (Karl)\AWS S3 Bucket Editing Routine\Code\AWSAPI\AWSAPI\FileAssets\Video\Output\Downloaded_Video_fd8dbbb5-63c0-4ff0-b0c6-e6c3c8f590aa.mp4&quot;
  </code></pre>
  <p><em><strong>I have added &quot;ffmpeg&quot; keyword before every actual query otherwise I can't run it in CMD. Rest of the query is exactly the same</strong></em></p>
  <p>This query doesn't produce anything when running through C# process and throws the &quot;concat&quot; error I just mentioned above.</p>
  <p>FYI, all files needed for conversion are present in the &quot;bin&quot; directory (temp files) and output file is supposed to be placed in another directory. I did that, because concat command apparently has issues with paths, so I just placed ffmpeg.exe along with all files needed directly in &quot;bin&quot; folder.</p>
  <p>Also, the code explanation is that it's a 3-step process. It's supposed to convert a png image to ts, then another video to ts, and then combine the 2 and produce output.</p>
  <p>Any help would be highly appreciated, thanks!!</p>