ffmpeg from chrome native messaging host app not working

两盒软妹~` 提交于 2019-12-12 01:43:59

问题


OK, this is what I got, I'm using native messaging to fire a c++ program from a chrome extension in Windows.
This c++ program (ehost.exe) creates a ffmpeg process for recording the input audio and saving it to mp3.
I do this with the CreateProcess() function
This works perfect when I open ehost.exe myself (double clicking it) but when I open it from my chrome extension (chrome.runtime.connectNative() ), the ffmpeg process opens but ffmpeg writes no output file, as if it didn't have permissions...

Anybody knows why?
This is the ehost.exe code for starting ffmpeg.exe

static HANDLE startFFmpeg() { char cmd[] = "C:\Users\moizilla\Desktop\native\ffmpeg\bin\ffmpeg.exe -y -f dshow -i audio=\"Microphone (High Definition Aud\" -acodec libmp3lame C:\Users\moizilla\Desktop\native\kasdkddfodkadd.mp3"; PROCESS_INFORMATION pi = {0}; STARTUPINFO si={0}; si.cb = sizeof(STARTUPINFO); if(CreateProcess(NULL, cmd, NULL, NULL, TRUE, 0, NULL, NULL, &si, &pi)){ CloseHandle(pi.hThread); return pi.hProcess; } return NULL; }

来源:https://stackoverflow.com/questions/24108308/ffmpeg-from-chrome-native-messaging-host-app-not-working

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!