on linux x86 system, command line terminal,
music on,
“ffmpeg -f pulse -i xxxx(audio dev name,is a loudspeaker) /tmp/xxxx.wav” run perfect ,
“aplay -i /tmp/xxxx.wav” can play Captured speaker sound,
but,
in cpp code,
{
...
AVInputFormat * fmt = av_find_input_format("pluse");
if(!fmt)
return -1;
AVFormatContext *ctx = avformat_alloc_context();
if(!ctx)
return -1;
int ret = avformat_open_input(&ctx,"xxxx dev name",fmt,NULL); //block.......
...
}
why ternimal not,code blocking,Does anyone know?
New contributor
ZhangKun is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.