久了没更新NDK,今天下载了r10d,惊讶的发现多了个native-codec这个sample。
应该就是API 16那个JAVA版MediaCodec的native版
限制就是 最低 api 21 就是Android 5.0
这限制基本上近期都没戏了,先去刷个5.0的系统再来测试。
=============2015年2月10日,测试结果来了======================
久了没更新NDK,今天下载了r10d,惊讶的发现多了个native-codec这个sample。
应该就是API 16那个JAVA版MediaCodec的native版
限制就是 最低 api 21 就是Android 5.0
这限制基本上近期都没戏了,先去刷个5.0的系统再来测试。
=============2015年2月10日,测试结果来了======================
下载最新x264源码 ftp://ftp.videolan.org/pub/x264/snapshots/last_x264.tar.bz2
下载gas-preprocessor https://github.com/libav/gas-preprocessor 并copy到 /usr/local/bin/gas-preprocessor.pl
继续阅读“转一段 Xcode6 下编译x264的脚本”
最近在做全志A20的Android系统开发,经常需要调试script.fex文件中的参数。
会经常用到sunxi-tools中的几个工具
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
fexc: `.fex` file (de)compiler Usage: ./fexc [-vq] [-I <infmt>] [-O <outfmt>] [<input> [<output>]] infmt: fex, bin (default:fex) outfmt: fex, bin (default:bin) bin2fex: compatibility shortcut to call `fexc` to decompile an script.bin blob back into `.fex` format used by allwinner's SDK to configure the boards. fex2bin: compatiblity shortcut to call `fexc` to compile a `.fex` file into the binary form used by the sun4i kernel. |
后来需要在windows下工作 切换环境很麻烦 所以用cygwin编译了sunxi-tools 并写了几个脚本文件,方便多了
阅读ffmpeg串流的手册FFmpeg Streaming Guide
当进行点对点串流时
如果视频编码为H.264时,payload type 为 96
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
$ ffmpeg -re -i sample1.mp4 -an -c copy -f rtp rtp://127.0.0.1:12345 Output #0, rtp, to 'rtp://127.0.0.1:12345': Metadata: major_brand : isom minor_version : 512 compatible_brands: isomiso2avc1mp41 encoder : Lavf55.48.100 Stream #0:0(eng): Video: h264 (avc1 / 0x31637661), yuv420p, 424x240, q=2-31, 420 kb/s, 24 fps, 90k tbn, 24 tbc (default) Metadata: handler_name : VideoHandler Stream mapping: Stream #0:0 -> #0:0 (copy) SDP: v=0 o=- 0 0 IN IP4 127.0.0.1 s=No Name c=IN IP4 127.0.0.1 t=0 0 a=tool:libavformat 55.48.100 m=video 12345 RTP/AVP 96 b=AS:420 a=rtpmap:96 H264/90000 a=fmtp:96 packetization-mode=1; sprop-parameter-sets=Z0LAHpZiA2P8vCAAAAMAIAAABgHixck=,aMuMsg==; profile-level-id=42C01E |
此时会自动输出一段SDP的代码,这时候如果直接播放 继续阅读“使用ffmpeg进行rtp串流h.264时关于sdp的一些分析”
官方源码:http://code.google.com/p/libyuv/
简介:
1 2 3 4 5 6 7 8 |
libyuv is an open source project that includes YUV scaling and conversion functionality. Scale YUV to prepare content for compression, with point, bilinear or box filter. Convert to YUV from webcam formats. Convert from YUV to formats for rendering/effects. Rotate by 90/180/270 degrees to adjust for mobile devices in portrait mode. Optimized for SSE2/SSSE3/AVX2 on x86/x64. <strong>Optimized for Neon on Arm.</strong> Optimized for DSP R2 on Mips. |
YUV层的缩放,色彩空间转换(nv21/nv12 to i420,i420 to rgb565/rgb888),针对ARMv7使用NEON指令集优化.实际项目使用中测试,缩放/转换性能秒杀ffmpeg的libswscale
按官方的编译方法太麻烦,需要装depot tools,ninja
这里直接用android make 方便的多.
继续阅读“使用 NDK 编译 libyuv”
安装配置Red5 Server 1.0 RC1 (一)中提到过一个Publisher 工具,非常好用。但是Red5官方一直没更新,只能使用flv和nellymoser编码。而现在大多使用H.264和Speex了。
近期为了方便调试,修改了下源码,可以在https://github.com/illuspas/Red5-Publisher找到。
直接使用Flash builder 4.6导入项目即可。
也可以直接下载release.zip使用
直接打开:http://www.nodemedia.cn/uploads/files/Red5-Publisher.swf
在使用flash cs/builder开发rtmp视频应用时,我们时常会在nc.connect的时候再传递一个对象作为连接信息发送给服务端。用于验证,确认连接用户,获取用户信息等等操作。
当我们使用ffmpeg来开发android,ios,pc版的rtmp应用时,已经为我们提供了非常方便的传参来实现。
先来看源代码:定位到libavformat/rtmpproto.c文件 继续阅读“使用FFmpeg连接rtmp时发送自定义AMF DATA”
移动设备上的H.264实时视频编码,需要考虑到cpu占用与带宽这2个限制因素,使用X264软编码,开启neon指令集优化,即使是在arm处理器下,依然可以通过优化配置达到满意的性能.
以下测试环境 一段352×288@15fps的视频,模拟摄像头采集到的数据。ipod touch4 和昨天编译出的X264:
Touch-future:~ root# ./x264 -o video_1.h264 video_1.y4m –profile baseline –preset ultrafast –fps 15
baseline
ultrafast
encoded 467 frames, 48.17 fps, 865.45 kb/s 3368054(压缩后的文件大小,单位字节) 继续阅读“Android,IOS平台上x264编码实时视频参数设置与优化”
我的测试环境 Xcode 4.6 iPod Touch 4
1 2 |
Touch-future:~ root# uname -a Darwin Touch-future 11.0.0 Darwin Kernel Version 11.0.0: Sun Apr 8 21:51:26 PDT 2012; root:xnu-1878.11.10~1/RELEASE_ARM_S5L8930X iPod4,1 arm N81AP Darwin |
设置环境变量
1 2 3 4 |
export CC=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc export AS='gas-preprocessor.pl /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc' export CFLAGS='-arch armv7' export LDFLAGS='-L/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/usr/lib/system/ -arch armv7' |
配置
1 |
./configure --sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.1.sdk/ --host=arm-apple-darwin --enable-static --enable-strip --disable-avs --chroma-format=420 --enable-pic --disable-opencl |