Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/141.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/jpa/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在visual studio c+中调用ffmpeg.exe+; 我只是一个C++新手。 我试图在VisualStudio 2012中的C++项目中使用FFMPEG,通过调用它里面的FFMPEG.EXE文件。_C++_Visual Studio 2012_Ffmpeg - Fatal编程技术网

在visual studio c+中调用ffmpeg.exe+; 我只是一个C++新手。 我试图在VisualStudio 2012中的C++项目中使用FFMPEG,通过调用它里面的FFMPEG.EXE文件。

在visual studio c+中调用ffmpeg.exe+; 我只是一个C++新手。 我试图在VisualStudio 2012中的C++项目中使用FFMPEG,通过调用它里面的FFMPEG.EXE文件。,c++,visual-studio-2012,ffmpeg,C++,Visual Studio 2012,Ffmpeg,这就是我迄今为止所尝试的: //FFMPEG CALLING char ffmpeg2[BUFSIZ]; strcpy(ffmpeg2,"..\bin\ffmpeg.exe"); strcat(ffmpeg2,"-f s16le -ar 8K -ac -ss"); strcat(ffmpeg2,buffers); //string hh:mm:ss strcat(ffmpeg2,"-t"); strcat (ffmpeg2,buffer); //string hh:mm:ss str

这就是我迄今为止所尝试的:

//FFMPEG CALLING
char ffmpeg2[BUFSIZ];
strcpy(ffmpeg2,"..\bin\ffmpeg.exe");
strcat(ffmpeg2,"-f s16le -ar 8K -ac -ss");
strcat(ffmpeg2,buffers);    //string hh:mm:ss
strcat(ffmpeg2,"-t");
strcat (ffmpeg2,buffer);    //string hh:mm:ss
strcat(ffmpeg2,"-i ..\\rec.pcm ..\Desktop\newFolder\filename");
if(system(ffmpeg2) !=0) 
{
    ft =fopen("ffmpeg_err.txt","a");
    fprintf( ft,"my command failed...\n" );
    fclose(ft);
}
else
{system(ffmpeg2);}
它在文本文件中不断生成my命令fail。
你们有没有关于如何修复它的提示。

在调用strcat之前或之后,你们没有添加任何空格,所以最后的命令类似于
。\bin\ffmpeg.exe-f s16le-ar 8K-ac-ss-i..\\rec.pcm..\Desktop\newFolder\filename
在ffmpeg.exe之后、在-ss之后、在-t之前和在-i之前添加一个空格,以便 最终命令将变为
。\bin\ffmpeg.exe-f s16le-ar 8K-ac-ss-i..\\rec.pcm..\Desktop\newFolder\filename


这会解决您的问题

非常感谢您的帮助。当我试图写入文本文件以查看输出时,它似乎读入了开始时间和持续时间。如果它解决了您的问题,请接受我的答案。如果您的代码中有任何其他问题,请详细说明。