누구나 ffmpeg를 오디오 대기열로 사용할 수있게 만들었습니다. 대기열을 만들려고 할 때 오류가 발생합니다. 단지 나는 오디오 큐가 작동하도록하는 방법을 알아낼 수 있다면ffmpeg 오디오 및 iphone
ret = avcodec_open(enc, codec);
if (ret < 0) {
NSLog(@"Error: Could not open video decoder: %d", ret);
av_close_input_file(avfContext);
return;
}
if (audio_index >= 0) {
AudioStreamBasicDescription audioFormat;
audioFormat.mFormatID = -1;
audioFormat.mSampleRate = avfContext->streams[audio_index]->codec->sample_rate;
audioFormat.mFormatFlags = 0;
switch (avfContext->streams[audio_index]->codec->codec_id) {
case CODEC_ID_MP3:
audioFormat.mFormatID = kAudioFormatMPEGLayer3;
break;
case CODEC_ID_AAC:
audioFormat.mFormatID = kAudioFormatMPEG4AAC;
audioFormat.mFormatFlags = kMPEG4Object_AAC_Main;
break;
case CODEC_ID_AC3:
audioFormat.mFormatID = kAudioFormatAC3;
break;
default:
break;
}
if (audioFormat.mFormatID != -1) {
audioFormat.mBytesPerPacket = 0;
audioFormat.mFramesPerPacket = avfContext->streams[audio_index]->codec->frame_size;
audioFormat.mBytesPerFrame = 0;
audioFormat.mChannelsPerFrame = avfContext->streams[audio_index]->codec->channels;
audioFormat.mBitsPerChannel = 0;
if (ret = AudioQueueNewOutput(&audioFormat, audioQueueOutputCallback, self, NULL, NULL, 0, &audioQueue)) {
NSLog(@"Error creating audio output queue: %d", ret); <
오디오 만 가진 문제,
비디오는 완벽합니다.
http://web.me.com/cannonwc/Site/Photos_6.html
I remoteio의 생각하지만에 많은 문서가 is'nt.
완전한 수업을위한 코드를 다른 사람들과 공유해 나에게 도움이 될 것입니다.
아이디어는 전달 된 모든 스트리밍 비디오를 재생하는 단일보기 컨트롤러를 사용하는 것입니다. 아이폰에서는 ffplay와 유사하지만 sdl 오버 헤드는 없습니다.