hi all, i capture auido buffer. These are PCM data. And whenany have new PCM buffer, will be encoding to MPEG 1 audio frame(s). These frame will be write to file. Now is i have to create AVCodecContext pointer, so that later, i can use avcodec_decode_audio() before call avcodec_encode_audio(). But have inconvenient when init AVCodecContext pointer: /* code to init AVCodecContext pointer argv[1] = "temp.wav"; if(av_open_input_file(&pFormatCtx, argv[1], NULL, 0, NULL)!=0) return -1; // Couldn't open file // Retrieve stream information if(av_find_stream_info(pFormatCtx)<0) return -1; // Couldn't find stream information // Find the first audio stream audioStream=-1; for(i=0; i<pFormatCtx->nb_streams; i++) if(pFormatCtx->streams[i]->codec->codec_type==CODEC_TYPE_AUDIO) { audioStream=i; break; } if(audioStream==-1) return -1; // Didn't find a audio stream // Get a pointer to the codec context for the audio stream pCodecCtx=pFormatCtx->streams[audioStream]->codec; */ You can see that i open one available wav file first... i think this no good. But i donot know if i donot use one available .wav , have different way to init AVCodecContext pointer and can call avcodec_decode_audio() later without no error? If i need to hard code some value when init AVCodecContext pointer , I donnot know what are need to set for AVCodecContext pointer? Can any help me?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4