原创 VTDecompressionSessionDecodeFrame -8969

解碼時候,需要用h264數據長度替換0x00 0x00 0x00 0x01,注意長度大小端,否則會出現-8969錯誤 -(int)decode:(char*)buf len:(int)len {     CVPixelBu

原创 Android7 mediacodec SEI

發現Android7使用mediacodec進行avc編碼,得到的第一個關鍵幀的h264數據中包含SEI這種nal。 如果我們不需要,或者加上之後對我們有影響,可以去掉。 private int findNextNalP

原创 CMSampleBufferRef獲取h264 char*數據及sps/pps

   直接看代碼: CMBlockBufferRef blockBuffer = CMSampleBufferGetDataBuffer(sampleBuf); size_t len_offset = 0 , len_to

原创 mediacodec surfaceview解碼失敗

原來在configure的時候設置了sps/pps(如下),發現有些機型解碼失敗,dequeueInputBuffer、queueInputBuffer這些老是異常 MediaFormat format = MediaForm

原创 AudioUnitRender -10876

iOS使用AudioUnit錄音,在錄音回調中使用AudioUnitRender播放錄製的人聲時, 返回-10876這個錯誤。 這裏https://www.osstatus.com/search/results?platform=all&

原创 Android bluetooth設備狀態監聽

public class BluetoothHeadsetBroadcastReceiver extends BroadcastReceiver { public BluetoothHeadsetBroadcastReceive

原创 學習OpenGL-ES: 2 - EGL解析

原文:http://www.cnblogs.com/kiffa/archive/2013/02/21/2921123.html 1, 前言 在前文(學習OpenGL-ES: 1 - 像素、顏色、顯存、環境初始化和EGL)中提到EG

原创 iOS 使用FFmpeg

原文:http://www.jianshu.com/p/ec432a8f5729 如何在iOS上集成 FFmpeg,來,博主帶大家往坑裏走了。 我們此次入坑需要的工具: 1、gas-preprocessor 2、yasm 1.2.0

原创 ios ffmpeg+libx264

1、編譯x264腳本: https://github.com/depthlove/x264-iOS-build-script 2、編譯ffmpeg腳本: https://github.com/kewlbear/FFmpeg-i

原创 ANDROID 高性能圖形處理 之 OPENGL ES

原文:http://tangzm.com/blog/?p=20 在之前的介紹中我們說到在Android 4.2上使用RenderScript有諸多限制,我們於是嘗試改用OpenGL ES 2.0來實現濾鏡。本文不詳細介紹OpenG

原创 ios build fdk-aac

1、下載fdk-aac https://github.com/mstorsjo/fdk-aac 2、需要安裝automake libtool,運行:brew install automake libtool 3、下載bui

原创 細數AVPlayer的那些坑

http://ivanyuan.farbox.com/post/shi-pin-bo-fang-de-na-xie-keng 最近一直在做視頻動態掛件以及一個視頻播放的功能,在開始做之前,先學習了蘋果的官方文檔RosyWriter,

原创 AVAssetWriter寫h264數據

AVAssetWriterInput按如下初始化: CMFormatDescriptionRef videoFormat = NULL; CMVideoFormatDescriptionCreate(kCFAllocatorDefa

原创 基於Surface的視頻編解碼與OpenGL ES渲染

http://blog.csdn.net/gh_home/article/details/52399959 1. 概述 這篇文章所做的事情是這樣的:  1. 從一個.mp4文件中解碼視頻流到surface上  2. 利用Open

原创 iOS獲取音頻設備信息

方法1:         CFDictionaryRef descDictRef = nil;         UInt32 refSize = sizeof(descDictRef);         status = Audi