《Android音视频开发》勘误


这里写图片描述

经历了两年多,我的著作终于和大家见面了,写书是一件很磨练人耐力的事情 ,从打算写一本书开始后,心里无时不刻有一块大石头压在头顶。一来要保证专业性,二来要保证质量,同时还要兼具备怎么表达,才能让别人明白所说的意思。所以看起来没有那么简单。近年来,直播,短视频行业相关业务发展迅猛。Android音视频开发门槛相对高些,很多有特色或者核心模块基本都是NDK开发而NDK开发很多实际上都是C/C++写的Code,那么同时也要学习C/C++,而Android应用开发,很多时候用Java就能开发大部分应用。所以音视频有特色都是C/C++开发。这让很多不少做Java开发的朋友望而却步了。但音视频更多是和产品结合起来,所以肯定有很多业务需求是上层来配合做的。不然光写逻辑,没有数据或其他UI展示,这样的产品也是不好玩的。但是如果在做应用层又了解一些音视频相关逻辑,那么配合起来就会事半功倍了。之前很多同学和我反馈要是能写一本书这么详细介绍内容就好了。其实我一直在写,只是没有写好的那一天还不想通知大家,不过现在好了。我的著作:《Android音视频开发》一书终于能和大家见面了。也欢迎大家购买。先到先得,首次印刷数量有限,希望这个封面大家喜欢:

这里写图片描述

下面就来和大家简单说一下本书内容吧,本书主要分为11大篇章,每章要学的东西不少:

  • 第一章:介绍了常用音视频术语,了解一些音视频的基础概念,对音视频一些理论进行分类,让读者更好的系统有条理掌握这些基础概念。

  • 第二章:介绍了Android应用层使用的系统播放器-MediaPlayer,从上到下的源码分析与介绍,通过某个点,向下深入。

  • 第三章:介绍了Android多媒体管理调度的服务者- MediaPlayerService,以及如何为多媒体播放提供服务。

  • 第四章:介绍了Android系统中的StagefrightPlayer,在Android 系统5.1 版本之前,这个扮演了重要的角色。有必要对它进行了解

  • 第五章:介绍了Android系统中的NuPlayer-流媒体播放的新生力量,在Android 系统5.1 版本之后(包含5.1版本),NuPlayer基于StagefrightPlayer的基础类构建,利用了更底层的ALooper/AHandler机制来异步解码播放。

  • 第六章:介绍了OpenMAX (OMX)框架相关,OpenMAX是一个多媒体应用程序的标准,涉及OpenMAX IL API 能够在Android应用程序、多媒体框架和编解码库,以及其支持的组件(比如,sources 和 sinks)之间建立统一的接口。

  • 第七章:介绍了FFmpeg库在Windows,mac OS,以及Linux下编译并移植。同时介绍了FFmpeg常用的命令进行处理音视频。

  • 第八章:介绍了FFmpeg源码分析及实战开发案例,对做音视频开发,会使用FFmpeg库,以及了解源码是基本功。通过案例来感受FFmpeg库的魅力。

  • 第九章:介绍了直播开发的技术,主要涉及直播原理、采集数据、编码、推流、播放等。同时写了一个Android推流器案例,来实现一个简单直播app。也介绍了直播过程中一些优化点,帮助提升直播体验。

  • 第十章:介绍了H.264码流结构及H.265码流结构,在音视频开发中,可以分析数据有无特殊性问题及异常问题排查。帮助定位修复问题

  • 第十一章:介绍了常见的视频封装格式,以及对封装格式原理和内部结构进行分析。可以学习到音视频数据是怎么一步一步组配的。

源码

链接:https://pan.baidu.com/s/16OUkZToVQYhkrrxFszi0Jg 密码:mzas

码流分析工具

链接:https://pan.baidu.com/s/1iUksNQ8MW3JHw258cb3Yzw 密码:e08o

勘误列表

  • 1、Page-3,Line-8,错误类型–错别字,AudioTrack 写成 “AudiTrack”;

  • 2、Page-6,错误类型–描述错误,关于PCM的采样率和比特率换算,常见的比特率并没有44.1Hz,而是44.1KHz,即使是44.1Hz,16位的精度,换算的比特率也不是4410016kb/s的结果;

  • 3、第一章中关于YUV的概念介绍中说 :“YUV:也被称作YCrCb”, 应为“YCbCr”, 在YUV家族中,YCbCr是在计算机系统中应用最多的成员,其应用领域很广泛,JPEG、MPEG均采用此格式。一般人们所讲的YUV大多是指YCbCr。引用微软对YV12和NV12的描述:https://docs.microsoft.com/en-us/previous-versions/aa904813(v=vs.80)

YV12
  All of the Y samples appear first in memory as an array of unsigned char values. This array is followed immediately by all of the V (Cr) samples. The stride of the V plane is half the stride of the Y plane, and the V plane contains half as many lines as the Y plane. The V plane is followed immediately by all of the U (Cb) samples, with the same stride and number of lines as the V plane (Figure 12).

NV12
  All of the Y samples are found first in memory as an array of unsigned char values with an even number of lines. The Y plane is followed immediately by an array of unsigned char values that contains packed U (Cb) and V (Cr) samples, as shown in Figure 13. When the combined U-V array is addressed as an array of little-endian WORD values, the LSBs contain the U values, and the MSBs contain the V values. NV12 is the preferred 4:2:0 pixel format for DirectX VA. It is expected to be an intermediate-term requirement for DirectX VA accelerators supporting 4:2:0 video.

可以发现 U (Cb) ,V (Cr),那YUV就是YCbCr.

  • 4、Page-23处libmedia.so库源文件的目录不是frameworks/base/media/libmedia,而是在frameworks/av/media/libmedia

  • 5、Page-15,得到软引用对象,应为“得到弱引用对象”

  • 6、Page-210 metadata,应为“元数据”

  • 7、Page-212 priv_data_size,应为“某种格式文件的数据大小”

  • 8、Page-198 第一个命令写成前面一节降噪命令了,争取画中画命令应为“ffmpeg -i input1 -i input2 -filter_complex overlay=x:y output”

  • 9、Page-46 首先找到入口,在frameworks/base/media/mediaserver/main_mediaserver.cpp中,应为“首先找到入口,在frameworks/av/media/mediaserver/main_mediaserver.cpp中”

  • 10、Page-47 接下来看看interface_cast是什么,其处于frameworks/base/include/binder/IInterface.h中,应为“接下来看看interface_cast是什么,其处于frameworks/native/include/binder/IInterface.h中”

  • 11、Page-48 其处于frameworks/base/include/binder/IServiceManager.h中,应为“接下来看看interface_cast是什么,其处于frameworks/native/include/binder/IServiceManager.h中”

  • 12、Page-49 开始添加服务内部,在frameworks/base/media/libmediaplayerservice/MediaPlayerService.cpp中,应为“开始添加服务内部,在frameworks/av/media/libmediaplayerservice/MediaPlayerService.cpp中”

  • 13、Page-52 其处于frameworks/base/libs/binder/IserviceManager.cpp中,应为“ 其处于frameworks/native/libs/binder/IServiceManager.cpp中”

  • 14、Page-53 继续在BpBinder中寻找实现代码,其处于frameworks/base/libs/binder/BpBinder.cpp中,应为“继续在BpBinder中寻找实现代码,其处于frameworks/native/libs/binder/BpBinder.cpp中”

License

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Copyright (C) <2018>  <hejunlin>

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.

本文标题:《Android音视频开发》勘误

文章作者:

发布时间:2019年06月09日 - 10:06

最后更新:2019年06月09日 - 11:06

原始链接:https://www.stockclaw.asia/2019/06/09/Android%E9%9F%B3%E8%A7%86%E9%A2%91%E5%BC%80%E5%8F%91%E5%8B%98%E8%AF%AF/

许可协议: 署名-非商业性使用-禁止演绎 4.0 国际 转载请保留原文链接及作者。

 wechat
欢迎您扫一扫上面的微信公众号,第一时间关注我的博客!
坚持原创技术分享,您的支持将鼓励我继续创作!