No se puede encontrar un formato de salida adecuado para '&&' en FFMPEG para C#.net
Frecuentes
Visto 1,653 veces
3
I am trying to convert and delete the source file using FFMPEG, what i want is to convert video file from one format to other, and delete the first one which is uploaded means source file, the command works fine if we use && operator after conversion syntax and write del command, it works well on command line but when we try using c#, it gives the error Unable to find a suitable output format for '&&' I have checked with debugger, and its the same line which we are writing on command line, command line does not have any problem. What's the issue with c#?
ffmpeg.StartInfo.Arguments = " -i \"" + v.FilePath + "\" -r 20 -ar 44100 -ab 196 -b 300k -aspect 4:3 -s 800x600 \"" + convertToMp4 + "\" && del \"" + v.FilePath + "\"";
ffmpeg.StartInfo.FileName = Server.MapPath("ffmpeg/ffmpeg.exe");
//ffmpeg.StartInfo.UseShellExecute = false;
ffmpeg.StartInfo.CreateNoWindow = false;
ffmpeg.BeginErrorReadLine();
ffmpeg.Start();
if (b == false)
{
ffmpeg.WaitForExit();
}
1 Respuestas
0
The problem is that your convertToMp4 variable is coming out to be nil and hence it is thinking && is the output file name
EDIT: Will this lead to a shell execution? Because && belongs to the bash shell. So if ffmpeg is being executed from C# directly without and intermediate bash shell I am not sure how && will work. This is why ffmpeg thinks && is an output file desired because && is not interpreted here for the shell. You should then execute two seperate commands.
Respondido 28 ago 12, 16:08
No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas c# .net command-line ffmpeg or haz tu propia pregunta.
convertToMp4 is not nill, it is filename of the mp4 target file. - Muhammad Atif Agha
Did this get solved? Does the && being part of bash make sense to you - av501