on linux, UseShellExecute = true, means use the GUI shell to run the command, not the current process. this will not work in azure (as you have found). only when UseShellExecute = false can you can redirect input, output and error.
it is not clear why you want to use bash. just run the ffmpeg with redirected output, and stream the output to a file.
var ffmpeg = $"/home/site/wwwroot/ffmpeg";
var videoPath = Path.GetFullPath($"SampleVideo1.mp4");
var ffmpegCommand = $"-i \"{videoPath}\"";
var outPath = "somefile.mp4";
using Process process = new();
process.StartInfo.FileName = ffmpeg;
process.StartInfo.Arguments = ffmpegCommand;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardOutput = true;
process.StartInfo.RedirectStandardError = true;
process.Start();
using (var fileOut = new FileStream(outPath, FileMode.Create))
{
var outTask = process.StandardOutput.BaseStream.CopyToAsync(fileOut);
var errTask = process.StandardError.ReadToEndAsync();
await Task.WhenAll(outTask, errTask, process.WaitForExitAsync());
}
note: you could pass the output file name to the ffmpeg as a command line parameter instead.