Note that there are some explanatory texts on larger screens.

plurals
  1. POffmpeg audio and the iphone
    primarykey
    data
    text
    <p>has anyone been able to make ffmpeg work with audio queues, I get an error when I try to create the queue.</p> <blockquote> <p>ret = avcodec_open(enc, codec);</p> <p>if (ret &lt; 0) {</p> <p>NSLog(@"Error: Could not open video decoder: %d", ret);</p> <p>av_close_input_file(avfContext);</p> <p>return;</p> <p>}</p> <p>if (audio_index >= 0) {</p> <p>AudioStreamBasicDescription audioFormat;</p> <p>audioFormat.mFormatID = -1;</p> <p>audioFormat.mSampleRate = avfContext->streams[audio_index]->codec->sample_rate;</p> <p>audioFormat.mFormatFlags = 0;</p> <p>switch (avfContext->streams[audio_index]->codec->codec_id) {</p> <p>case CODEC_ID_MP3:</p> <p>audioFormat.mFormatID = kAudioFormatMPEGLayer3;</p> <p>break;</p> <p>case CODEC_ID_AAC:</p> <p>audioFormat.mFormatID = kAudioFormatMPEG4AAC;</p> <p>audioFormat.mFormatFlags = kMPEG4Object_AAC_Main;</p> <p>break;</p> <p>case CODEC_ID_AC3:</p> <p>audioFormat.mFormatID = kAudioFormatAC3;</p> <p>break;</p> <p>default:</p> <p>break;</p> <p>}</p> <p>if (audioFormat.mFormatID != -1) {</p> <p>audioFormat.mBytesPerPacket = 0;</p> <p>audioFormat.mFramesPerPacket = avfContext->streams[audio_index]->codec->frame_size;</p> <p>audioFormat.mBytesPerFrame = 0;</p> <p>audioFormat.mChannelsPerFrame = avfContext->streams[audio_index]->codec->channels;</p> <p>audioFormat.mBitsPerChannel = 0;</p> <p>if (ret = AudioQueueNewOutput(&amp;audioFormat, audioQueueOutputCallback, self, NULL, NULL, 0, &amp;audioQueue)) {</p> <p>NSLog(@"Error creating audio output queue: %d", ret); &lt;</p> </blockquote> <p>The issues only with the audio ,</p> <p>Video is perfect if only I can figure out how to get audio queues to work.</p> <p><a href="http://web.me.com/cannonwc/Site/Photos_6.html" rel="nofollow noreferrer">http://web.me.com/cannonwc/Site/Photos_6.html</a></p> <p>I though of remoteio but there is'nt much doc on that.</p> <p>I will share the code for the complete class with anyone that helps me get it to work.</p> <p>The idea is to have a single view controller that plays any streaming video passed to it, similar to ffplay on the iphone but without the sdl overhead.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload