No se puede encontrar un formato de salida adecuado para '&&' en FFMPEG para

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;
                                if (b == false)

preguntado el 28 de agosto de 12 a las 11:08

1 Respuestas

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

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

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.