<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>直播 - 宋明的博客</title><link>https://apolla.cc/posts/live/</link><description>宋明的博客</description><generator>Hugo 0.170.0 &amp; FixIt v1.0.0-rc.5-mwimukpl</generator><language>zh-cn</language><lastBuildDate>Sun, 10 Mar 2024 09:54:01 +0800</lastBuildDate><atom:link href="https://apolla.cc/posts/live/index.xml" rel="self" type="application/rss+xml"/><item><title>10： IOS安装FFmpeg问题总结</title><link>https://apolla.cc/posts/live/10-ios%E5%AE%89%E8%A3%85ffmpeg%E9%97%AE%E9%A2%98%E6%80%BB%E7%BB%93/</link><pubDate>Sun, 10 Mar 2024 09:54:01 +0800</pubDate><guid>https://apolla.cc/posts/live/10-ios%E5%AE%89%E8%A3%85ffmpeg%E9%97%AE%E9%A2%98%E6%80%BB%E7%BB%93/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;p&gt;&lt;strong&gt;说一下我自己的情况。还有（ios下的ffmpegh可以下载，代码由我改，基本没啥问题）&lt;/strong&gt;&#10;&lt;strong&gt;下载地址：&lt;/strong&gt;&lt;a href="http://download.csdn.net/detail/nil88/9351775" target="_blank" rel="external nofollow noopener noreferrer"&gt;ffmpegh&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;strong&gt;(怎么用可以看文章）&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;1、我是自己下载ffmpeg2.8.3版本，然后加最新的faac,x264来编译的arm64，armv7,armv7s（iphone所有的arm架构了，我是真机测试，所有不用i386了）。&#10;编译的脚本从这里弄的：&#10;&lt;a href="http://blog.csdn.net/leixiaohua1020/article/details/47071547" target="_blank" rel="external nofollow noopener noreferrer"&gt;http://blog.csdn.net/leixiaohua1020/article/details/47071547&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>1：技术分析与实现</title><link>https://apolla.cc/posts/live/1%E6%8A%80%E6%9C%AF%E5%88%86%E6%9E%90%E4%B8%8E%E5%AE%9E%E7%8E%B0/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/live/1%E6%8A%80%E6%9C%AF%E5%88%86%E6%9E%90%E4%B8%8E%E5%AE%9E%E7%8E%B0/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;p&gt;&lt;strong&gt;HTTP Live Streaming直播(iOS直播)技术分析与实现&lt;/strong&gt;&#10;花了一些时间研究了&lt;strong&gt;HTTP Live Streaming&lt;/strong&gt;（&lt;strong&gt;HLS&lt;/strong&gt;）技术，并实现了一个HLS编码器&lt;strong&gt;HLSLiveEncoder&lt;/strong&gt;，当然，C++写的。其功能是采集摄像头与麦克风，实时进行H.264视频编码和AAC音频编码，并按照HLS的协议规范，生成分段的标准TS文件以及m3u8索引文件。通过我的&lt;strong&gt;HLSLiveEncoder&lt;/strong&gt;和第三方Http服务器（例如：Nginx），成功实现了&lt;strong&gt;HTTP Live Streaming&lt;/strong&gt;直播，并在iphone上测试通过。&#10;&lt;strong&gt;HLS技术要点分析&lt;/strong&gt;&#10;&lt;strong&gt;HTTP Live Streaming&lt;/strong&gt;（&lt;strong&gt;HLS&lt;/strong&gt;）是苹果公司(Apple Inc.)实现的基于HTTP的流媒体传输协议，可实现流媒体的直播和点播，主要应用在&lt;strong&gt;iOS&lt;/strong&gt;系统，为&lt;strong&gt;iOS&lt;/strong&gt;设备（如iPhone、iPad）提供音视频直播和点播方案。&lt;strong&gt;HLS&lt;/strong&gt;点播，基本上就是常见的分段HTTP点播，不同在于，它的分段非常小。要实现&lt;strong&gt;HLS&lt;/strong&gt;点播，重点在于对媒体文件分段，目前有不少开源工具可以使用，这里我就不再讨论，只谈HLS直播技术。&#10;相对于常见的流媒体直播协议，例如&lt;a href="http://www.cnblogs.com/haibindev/archive/2011/12/29/2305712.html" target="_blank" rel="external nofollow noopener noreferrer"&gt;RTMP协议&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;、RTSP协议、MMS协议等，HLS直播最大的不同在于，直播客户端获取到的，并不是一个完整的数据流。HLS协议在服务器端将直播数据流存储为连续的、很短时长的媒体文件（&lt;strong&gt;MPEG-TS&lt;/strong&gt;格式），而客户端则不断的下载并播放这些小文件，因为服务器端总是会将最新的直播数据生成新的小文件，这样客户端只要不停的按顺序播放从服务器获取到的文件，就实现了直播。由此可见，基本上可以认为，HLS是以点播的技术方式来实现直播。由于数据通过HTTP协议传输，所以完全不用考虑防火墙或者代理的问题，而且分段文件的时长很短，客户端可以很快的选择和切换码率，以适应不同带宽条件下的播放。不过HLS的这种技术特点，决定了它的延迟一般总是会高于普通的流媒体直播协议。&#10;根据以上的了解要实现&lt;strong&gt;HTTP Live Streaming&lt;/strong&gt;直播，需要研究并实现以下技术关键点&lt;/p&gt;</description></item><item><title>11： iOS下利用FFmpeg命令行进行视频裁剪</title><link>https://apolla.cc/posts/live/11-ios%E4%B8%8B%E5%88%A9%E7%94%A8ffmpeg%E5%91%BD%E4%BB%A4%E8%A1%8C%E8%BF%9B%E8%A1%8C%E8%A7%86%E9%A2%91%E8%A3%81%E5%89%AA/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/live/11-ios%E4%B8%8B%E5%88%A9%E7%94%A8ffmpeg%E5%91%BD%E4%BB%A4%E8%A1%8C%E8%BF%9B%E8%A1%8C%E8%A7%86%E9%A2%91%E8%A3%81%E5%89%AA/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;ol&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;安装&lt;a href="http://linux.softpedia.com/get/Programming/Assembler-Tools/Yasm-621.shtml" target="_blank" rel="external nofollow noopener noreferrer"&gt;yasm&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&#10;• 进入下载后的yasm文件夹，通过编译安装命令yasm:&#10;./configure &amp;amp;&amp;amp; make -j 4 &amp;amp;&amp;amp; sudo make install&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;&lt;a href="https://github.com/applexiaohao/gas-preprocessor.git" target="_blank" rel="external nofollow noopener noreferrer"&gt;gas-preprocessor&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ol&gt;&#10;&lt;p&gt;• 打开终端Terminal，进入下载后的gas-preprocessor文件夹:&#10;1.将文件夹内的gas-preprocessor.pl文件拷贝到/usr/local/bin目录下&#10;2.chmod 777 /usr/local/bin/gas-preprocessor.pl&lt;/p&gt;</description></item><item><title>12：基于ijkplayer 视频流 播放</title><link>https://apolla.cc/posts/live/12%E5%9F%BA%E4%BA%8Eijkplayer-%E8%A7%86%E9%A2%91%E6%B5%81-%E6%92%AD%E6%94%BE/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/live/12%E5%9F%BA%E4%BA%8Eijkplayer-%E8%A7%86%E9%A2%91%E6%B5%81-%E6%92%AD%E6%94%BE/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;p&gt;&lt;strong&gt;之前开始使用ijk进行了一些简单的播放器实现，不过因为项目需要，所以又重新花了一些时间完善了一个demo&lt;/strong&gt;&#10;主要是对工具栏的逻辑进行了优化，顺便封装了一下，不过第一次做播放器，难免在一些地方有所疏漏，而且时间仓促，一些细节部分暂时还未完善。&#10;主要的一些文件：（参考ijk自带demo）&#10;&lt;img loading="lazy" src='https://apolla.cc/images/2e4035c9f7a7626982e53bafc0e4e915.png' alt="image.png"&gt;&lt;/p&gt;</description></item><item><title>13： ijkplayer 等多个项目开源</title><link>https://apolla.cc/posts/live/13-ijkplayer-%E7%AD%89%E5%A4%9A%E4%B8%AA%E9%A1%B9%E7%9B%AE%E5%BC%80%E6%BA%90/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/live/13-ijkplayer-%E7%AD%89%E5%A4%9A%E4%B8%AA%E9%A1%B9%E7%9B%AE%E5%BC%80%E6%BA%90/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;p&gt;SegmentFault 兄弟 + 基友单位弹幕视频网 Bilibili（B 站）近日在 GitHub 网站上建立了开源工作组（BOSTF）（此处 1024 赞），用以分享与维护自己的开源项目，其中包括 DanmakuFlameMaster（燃烧吧！烈焰弹幕使）与 ijkplayer。前者是免费提供 Android 平台下应用弹幕集成的解决方案，而后者则提供 Android 和 iOS 双平台视频播放器的解决方案。&lt;/p&gt;</description></item><item><title>15： IOS使用ijkPlayer</title><link>https://apolla.cc/posts/live/15-ios%E4%BD%BF%E7%94%A8ijkplayer/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/live/15-ios%E4%BD%BF%E7%94%A8ijkplayer/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;p&gt;最近要做一个视频直播的项目，刚刚进入视频坑，开始自己琢磨AVPlayer，使用起来发现还挺多限制的，虽然当然知道要先把基础打好，相关基础链接：&lt;/p&gt;&#10;&lt;p&gt;网络播放器相关&#10;&lt;a href="http://blog.csdn.net/Matthew_Fan/article/category/1200896" target="_blank" rel="external nofollow noopener noreferrer"&gt;http://blog.csdn.net/Matthew_Fan/article/category/1200896&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;HLS流媒体开发&#10;&lt;a href="http://blog.csdn.net/sdvch/article/details/14047281" target="_blank" rel="external nofollow noopener noreferrer"&gt;http://blog.csdn.net/sdvch/article/details/14047281&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;HLS 比较全的中文博客&#10;&lt;a href="http://blog.csdn.net/Matthew_Fan/article/category/1200896" target="_blank" rel="external nofollow noopener noreferrer"&gt;http://blog.csdn.net/Matthew_Fan/article/category/1200896&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;苹果 iOS 开发文档 （HLS）&#10;&lt;a href="https://developer.apple.com/streaming/" target="_blank" rel="external nofollow noopener noreferrer"&gt;https://developer.apple.com/streaming/&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/p&gt;</description></item><item><title>16：ios视频播放器，代码和界面分离</title><link>https://apolla.cc/posts/live/16ios%E8%A7%86%E9%A2%91%E6%92%AD%E6%94%BE%E5%99%A8%E4%BB%A3%E7%A0%81%E5%92%8C%E7%95%8C%E9%9D%A2%E5%88%86%E7%A6%BB/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/live/16ios%E8%A7%86%E9%A2%91%E6%92%AD%E6%94%BE%E5%99%A8%E4%BB%A3%E7%A0%81%E5%92%8C%E7%95%8C%E9%9D%A2%E5%88%86%E7%A6%BB/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;p&gt;最近业余时间整理的一个ios播放器，界面采用storyboard,以前几乎都是用代码布局，但是用过一个项目storyboard后，就感觉storyboard很靠谱，团队合作版本控制的问题解决其实很简单，每个人一个storyboard就可以了。播放代码使用的是avplayer，最大的优化就是播放界面和播放代码完全分离。&lt;/p&gt;</description></item><item><title>18：直播时代--IOS直播客户端SDK，美艳直播【开源】</title><link>https://apolla.cc/posts/live/18%E7%9B%B4%E6%92%AD%E6%97%B6%E4%BB%A3--ios%E7%9B%B4%E6%92%AD%E5%AE%A2%E6%88%B7%E7%AB%AFsdk%E7%BE%8E%E8%89%B3%E7%9B%B4%E6%92%AD%E5%BC%80%E6%BA%90/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/live/18%E7%9B%B4%E6%92%AD%E6%97%B6%E4%BB%A3--ios%E7%9B%B4%E6%92%AD%E5%AE%A2%E6%88%B7%E7%AB%AFsdk%E7%BE%8E%E8%89%B3%E7%9B%B4%E6%92%AD%E5%BC%80%E6%BA%90/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;h1 class="heading-element" id="直播时代ios直播客户端sdk美艳直播开源"&gt;&lt;span&gt;&lt;a href="https://www.cnblogs.com/Hakim/p/5242304.html" target="_blank" rel="external nofollow noopener noreferrer"&gt;直播时代&amp;ndash;IOS直播客户端SDK，美艳直播【开源】&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/span&gt;&#10; &lt;a href="#%e7%9b%b4%e6%92%ad%e6%97%b6%e4%bb%a3ios%e7%9b%b4%e6%92%ad%e5%ae%a2%e6%88%b7%e7%ab%afsdk%e7%be%8e%e8%89%b3%e7%9b%b4%e6%92%ad%e5%bc%80%e6%ba%90" class="heading-mark"&gt;&lt;svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"&gt;&lt;path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&lt;/h1&gt;&lt;p&gt;看到该文章我非常喜欢，为了方便自己查看和参考所以将其复制过来，源文地址：http://www.cnblogs.com/runner42/p/5241407.html&#10;请支持原作者。原作者如看到请原谅复制您的，纯属为了方便查阅。&lt;/p&gt;</description></item><item><title>2：RTMP协议学习总结</title><link>https://apolla.cc/posts/live/2rtmp%E5%8D%8F%E8%AE%AE%E5%AD%A6%E4%B9%A0%E6%80%BB%E7%BB%93/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/live/2rtmp%E5%8D%8F%E8%AE%AE%E5%AD%A6%E4%B9%A0%E6%80%BB%E7%BB%93/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;p&gt;RTMP协议是一个互联网TCP/IP五层体系结构中应用层的协议。RTMP协议中基本的数据单元称为消息（Message）。当RTMP协议在互联网中传输数据的时候，消息会被拆分成更小的单元，称为消息块（Chunk）。&#10;1 消息&#10;消息是RTMP协议中基本的数据单元。不同种类的消息包含不同的Message Type ID，代表不同的功能。RTMP协议中一共规定了十多种消息类型，分别发挥着不同的作用。例如，Message Type ID在1-7的消息用于协议控制，这些消息一般是RTMP协议自身管理要使用的消息，用户一般情况下无需操作其中的数据。Message Type ID为8，9的消息分别用于传输音频和视频数据。Message Type ID为15-20的消息用于发送AMF编码的命令，负责用户与服务器之间的交互，比如播放，暂停等等。消息首部（Message Header）有四部分组成：标志消息类型的Message Type ID，标志消息长度的Payload Length，标识时间戳的Timestamp，标识消息所属媒体流的Stream ID。消息的报文结构如下图所示。&lt;/p&gt;</description></item><item><title>4：如何做一款inke版的APP</title><link>https://apolla.cc/posts/live/4%E5%A6%82%E4%BD%95%E5%81%9A%E4%B8%80%E6%AC%BEinke%E7%89%88%E7%9A%84app/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/live/4%E5%A6%82%E4%BD%95%E5%81%9A%E4%B8%80%E6%AC%BEinke%E7%89%88%E7%9A%84app/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;h1 class="heading-element" id="一直播现状简介"&gt;&lt;span&gt;一、直播现状简介&lt;/span&gt;&#10; &lt;a href="#%e4%b8%80%e7%9b%b4%e6%92%ad%e7%8e%b0%e7%8a%b6%e7%ae%80%e4%bb%8b" class="heading-mark"&gt;&lt;svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"&gt;&lt;path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&lt;/h1&gt;&lt;h2 class="heading-element" id="1技术实现层面"&gt;&lt;span&gt;1.技术实现层面&lt;/span&gt;&#10; &lt;a href="#1%e6%8a%80%e6%9c%af%e5%ae%9e%e7%8e%b0%e5%b1%82%e9%9d%a2" class="heading-mark"&gt;&lt;svg class="octicon octicon-link" viewBox="0 0 16 16" version="1.1" width="16" height="16" aria-hidden="true"&gt;&lt;path d="m7.775 3.275 1.25-1.25a3.5 3.5 0 1 1 4.95 4.95l-2.5 2.5a3.5 3.5 0 0 1-4.95 0 .751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018 1.998 1.998 0 0 0 2.83 0l2.5-2.5a2.002 2.002 0 0 0-2.83-2.83l-1.25 1.25a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042Zm-4.69 9.64a1.998 1.998 0 0 0 2.83 0l1.25-1.25a.751.751 0 0 1 1.042.018.751.751 0 0 1 .018 1.042l-1.25 1.25a3.5 3.5 0 1 1-4.95-4.95l2.5-2.5a3.5 3.5 0 0 1 4.95 0 .751.751 0 0 1-.018 1.042.751.751 0 0 1-1.042.018 1.998 1.998 0 0 0-2.83 0l-2.5 2.5a1.998 1.998 0 0 0 0 2.83Z"&gt;&lt;/path&gt;&lt;/svg&gt;&lt;/a&gt;&#10;&lt;/h2&gt;&lt;p&gt;技术相对都比较成熟，设备也都支持硬编码。iOS还提供现成的Video ToolBox框架，可以对摄像头和流媒体数据结构进行处理，但Video ToolBox框架只兼容8.0以上版本，8.0以下就需要用x264的库软编了。&#10;github 上有现成的开源实现，推流、美颜、水印、弹幕、点赞动画、滤镜、播放都有。技术其实不是很难，而且现在很多云厂商都提供SDK，七牛云、金山云、乐视云、 腾讯云、百度云、斗鱼直播伴侣推流端，功能几乎都是一样的，没啥亮点，不同的是整个直播平台服务差异和接入的简易性。后端现在 RTMP/HTTP-FLV 清一色，App挂个源站直接接入云厂商或CDN就OK。&lt;/p&gt;</description></item><item><title>5：推流发布和播放【RTMP】介绍</title><link>https://apolla.cc/posts/live/5%E6%8E%A8%E6%B5%81%E5%8F%91%E5%B8%83%E5%92%8C%E6%92%AD%E6%94%BErtmp%E4%BB%8B%E7%BB%8D/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/live/5%E6%8E%A8%E6%B5%81%E5%8F%91%E5%B8%83%E5%92%8C%E6%92%AD%E6%94%BErtmp%E4%BB%8B%E7%BB%8D/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;p&gt;准备工作（&lt;sub&gt;表示安装目录）：&#10;1、在&lt;/sub&gt;/applications下创建一个live文件夹`&lt;/p&gt;&#10;&lt;p&gt;2、在~/conf下创建一个live文件夹，并把conf目录下的Application.xml复制进去&lt;/p&gt;&#10;&lt;p&gt;3、编辑Application.xml：&#10;（1）设置Streams/StreamType属性（live：仅直播；record：仅记录；live-record：既直播又记录）&#10;&lt;StreamType&gt;live&lt;/StreamType&gt;&#10;注意：记录的视频保存在~/content目录下。&#10;（2）设置HTTPStreamers属性：&#10;&lt;HTTPStreamers&gt;cupertinostreaming,smoothstreaming,sanjosestreaming&lt;/HTTPStreamers&gt;&#10;（3）设置Streams/LiveStreamPacketizers属性：&#10;&lt;LiveStreamPacketizers&gt;cupertinostreamingpacketizer, smoothstreamingpacketizer, sanjosestreamingpacketizer&lt;/LiveStreamPacketizers&gt;&#10;（4）设置RTP/Authentication/PlayMethod属性：&#10;&lt;PlayMethod&gt;none&lt;/PlayMethod&gt;&lt;/p&gt;</description></item><item><title>7：最简单的基于FFmpeg的推流器</title><link>https://apolla.cc/posts/live/7%E6%9C%80%E7%AE%80%E5%8D%95%E7%9A%84%E5%9F%BA%E4%BA%8Effmpeg%E7%9A%84%E6%8E%A8%E6%B5%81%E5%99%A8/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/live/7%E6%9C%80%E7%AE%80%E5%8D%95%E7%9A%84%E5%9F%BA%E4%BA%8Effmpeg%E7%9A%84%E6%8E%A8%E6%B5%81%E5%99%A8/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;p&gt;本文记录一个最简单的基于FFmpeg的推流器（simplest ffmpeg streamer）。推流器的作用就是将本地的视频数据推送至流媒体服务器。本文记录的推流器，可以将本地的 MOV / AVI / MKV / MP4 / FLV 等格式的媒体文件，通过流媒体协议（例如RTMP，HTTP，UDP，TCP，RTP等等）以直播流的形式推送出去。由于流媒体协议种类繁多，不一一记录。在这里记录将本地文件以RTMP直播流的形式推送至RTMP流媒体服务器（例如 Flash Media Server，Red5，Wowza等等）的方法。&lt;/p&gt;</description></item><item><title>9：编译ffmpeg和集成第三方实现直播（监控类）</title><link>https://apolla.cc/posts/live/9%E7%BC%96%E8%AF%91ffmpeg%E5%92%8C%E9%9B%86%E6%88%90%E7%AC%AC%E4%B8%89%E6%96%B9%E5%AE%9E%E7%8E%B0%E7%9B%B4%E6%92%AD%E7%9B%91%E6%8E%A7%E7%B1%BB/</link><pubDate>Sun, 10 Mar 2024 09:47:41 +0800</pubDate><guid>https://apolla.cc/posts/live/9%E7%BC%96%E8%AF%91ffmpeg%E5%92%8C%E9%9B%86%E6%88%90%E7%AC%AC%E4%B8%89%E6%96%B9%E5%AE%9E%E7%8E%B0%E7%9B%B4%E6%92%AD%E7%9B%91%E6%8E%A7%E7%B1%BB/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;p&gt;最近由于项目需要，接触了一下ffmpeg的编译和使用。&#10;由于之前的版本ffmpeg编译的库比较老，对新设备，5s及5s以后的设备支持不太好，重新编译了ffmpeg静态库。&lt;/p&gt;&#10;&lt;p&gt;&lt;strong&gt;一，下载并在终端中运行脚本编译ffmpeg&lt;/strong&gt;&#10;脚本参考git上的：https://github.com/kewlbear/FFmpeg-iOS-build-script；&#10;终端进入刚刚下载后的脚本文件夹下，运行sh：build－ffmpeg.sh 自动编译，有缺少yasm的按照提示操作，安装yasm&#10;编译的是ffmpeg2.5.3版本，Xcode6下iOS8.1。&#10;按照脚本编译完后的静态库目录如下：&#10;&lt;img loading="lazy" src='https://apolla.cc/images/0efea1bcb6650694d5c8738c09f2eda6.png' alt="image.png"&gt;&lt;/p&gt;</description></item><item><title>14： ijkplayer阅读笔记</title><link>https://apolla.cc/posts/live/14-ijkplayer%E9%98%85%E8%AF%BB%E7%AC%94%E8%AE%B0/</link><pubDate>Sat, 09 Mar 2024 23:21:58 +0800</pubDate><guid>https://apolla.cc/posts/live/14-ijkplayer%E9%98%85%E8%AF%BB%E7%AC%94%E8%AE%B0/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;p&gt;读取视频包 &amp;mdash;&amp;mdash;&amp;gt; 解码 &amp;mdash;&amp;mdash;&amp;gt; 显示&lt;/p&gt;&#10;&lt;p&gt;视频流程：&lt;/p&gt;&#10;&lt;p&gt;1)读取线程：读取视频包，推入videoq队列中&lt;/p&gt;&#10;&lt;pre&gt;&lt;code&gt;read_thread{&#10; ret = stream_component_open(ffp, st_index[AVMEDIA_TYPE_VIDEO]);{&#10; is-&amp;gt;video_tid = SDL_CreateThreadEx(&amp;amp;is-&amp;gt;_video_tid, video_thread, ffp, &amp;#34;ff_video_dec&amp;#34;);&#10; }&#10; &#10; for (;;) {&#10; if (is-&amp;gt;abort_request)&#10; break;&#10; &#10; ret = av_read_frame(ic, pkt);&#10; packet_queue_put(&amp;amp;is-&amp;gt;videoq, pkt); //将获取到的视频包推入videoq队列中&#10; }&#10;}&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;2）解码线程&#10;软解：从videoq队列中获取视频包，解码视频帧放入pictq列表中&#10;硬解：从videoq队列中获取视频包，推送MediaCodec解码，获取解码outputbuffer index并存储在pictq列表中&lt;/p&gt;</description></item><item><title>17： MPMoviePlayerViewController</title><link>https://apolla.cc/posts/live/17-mpmovieplayerviewcontroller/</link><pubDate>Sat, 09 Mar 2024 23:21:58 +0800</pubDate><guid>https://apolla.cc/posts/live/17-mpmovieplayerviewcontroller/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;p&gt;MPMoviePlayerViewController 解释：视频播放器&lt;/p&gt;&#10;&lt;p&gt;iOS开发中播放音乐可以使用MPMusicPlayerController类来实现，播放视频可以使用MPMoviePlayerController和MPMoviePlayerViewController类来实现，MPMediaPickerController类可以用于从系统媒体库中选择媒体播放。这几个类都包含与MediaPlayer.framework框架中。&lt;/p&gt;</description></item><item><title>3： RTMP直播应用与延时分析</title><link>https://apolla.cc/posts/live/3-rtmp%E7%9B%B4%E6%92%AD%E5%BA%94%E7%94%A8%E4%B8%8E%E5%BB%B6%E6%97%B6%E5%88%86%E6%9E%90/</link><pubDate>Sat, 09 Mar 2024 23:21:58 +0800</pubDate><guid>https://apolla.cc/posts/live/3-rtmp%E7%9B%B4%E6%92%AD%E5%BA%94%E7%94%A8%E4%B8%8E%E5%BB%B6%E6%97%B6%E5%88%86%E6%9E%90/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;p&gt;直播应用中，RTMP和HLS基本上可以覆盖所有客户端观看&#10;HLS主要是延时比较大，RTMP主要优势在于延时低。&lt;/p&gt;&#10;&lt;p&gt;一、应用场景&#10;◊ 低延时应用场景包括：&#10;◊ 互动式直播：譬如2013年大行其道的美女主播，游戏直播等等&#10;◊ 各种主播，流媒体分发给用户观看。用户可以文字聊天和主播互动。&#10;◊ 视频会议：我们要是有同事出差在外地，就用视频会议开内部会议。&#10;◊ 其实会议1秒延时无所谓，因为人家讲完话后，其他人需要思考，&#10;◊ 思考的延时也会在1秒左右。当然如果用视频会议吵架就不行。&#10;◊ 其他：监控，直播也有些地方需要对延迟有要求，&#10;◊ 互联网上RTMP协议的延迟基本上能够满足要求。&lt;/p&gt;</description></item><item><title>6：推荐的直播文章和rtmp直播地址</title><link>https://apolla.cc/posts/live/6%E6%8E%A8%E8%8D%90%E7%9A%84%E7%9B%B4%E6%92%AD%E6%96%87%E7%AB%A0%E5%92%8Crtmp%E7%9B%B4%E6%92%AD%E5%9C%B0%E5%9D%80/</link><pubDate>Sat, 09 Mar 2024 23:21:58 +0800</pubDate><guid>https://apolla.cc/posts/live/6%E6%8E%A8%E8%8D%90%E7%9A%84%E7%9B%B4%E6%92%AD%E6%96%87%E7%AB%A0%E5%92%8Crtmp%E7%9B%B4%E6%92%AD%E5%9C%B0%E5%9D%80/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;ul&gt;&#10;&lt;li&gt;解读：&lt;a href="http://blog.sina.com.cn/s/blog_4ad042e50100ijcq.html" target="_blank" rel="external nofollow noopener noreferrer"&gt;X264和H264 是什么？&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;解读：&lt;a href="http://bbs.9ria.com/thread-110484-1-1.html" target="_blank" rel="external nofollow noopener noreferrer"&gt;rtmp和http方式在播放flv方面的各自优势和劣势&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;解读：&lt;a href="http://www.cnblogs.com/qingquan/archive/2011/07/27/2118967.html" target="_blank" rel="external nofollow noopener noreferrer"&gt;I,P，B帧和PTS，DTS的关系&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;解读：&lt;a href="http://weibo.com/ttarticle/p/show?id=2309403969318634263193" target="_blank" rel="external nofollow noopener noreferrer"&gt;移动直播技术秒开优化经验(超级重要，必读！)&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;解读：&lt;a href="http://www.jianshu.com/p/b78db64acd77" target="_blank" rel="external nofollow noopener noreferrer"&gt;iOS8系统H264视频硬件编解码说明&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="http://www.videolan.org/developers/x264.html" target="_blank" rel="external nofollow noopener noreferrer"&gt;download x264&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;解读：&lt;a href="http://blog.csdn.net/leixiaohua1020/article/details/38283297" target="_blank" rel="external nofollow noopener noreferrer"&gt;FFmpeg发送流媒体的命令（UDP，RTP，RTMP）&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;解读：&lt;a href="http://blog.csdn.net/leixiaohua1020/article/details/38283297" target="_blank" rel="external nofollow noopener noreferrer"&gt;FFmpeg官网&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;解读：&lt;a href="http://blog.csdn.net/leixiaohua1020/article/details/15811977/" target="_blank" rel="external nofollow noopener noreferrer"&gt;FFMPEG视音频编解码零基础学习方法（最权威推荐阅读）&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;&lt;a href="http://www.videolan.org/developers/x264.html" target="_blank" rel="external nofollow noopener noreferrer"&gt;download x264&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;GitHub -&amp;gt; &lt;a href="https://github.com/jgh-" target="_blank" rel="external nofollow noopener noreferrer"&gt;jgh-&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;/&lt;a href="https://github.com/jgh-/VideoCore" target="_blank" rel="external nofollow noopener noreferrer"&gt;VideoCore&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;**GitHub -&amp;gt; &lt;a href="https://github.com/runner365" target="_blank" rel="external nofollow noopener noreferrer"&gt;runner365&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;/&lt;a href="https://github.com/runner365/LiveVideoCoreSDK" target="_blank" rel="external nofollow noopener noreferrer"&gt;LiveVideoCoreSDK&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;解读：&lt;a href="http://www.cnblogs.com/haibindev/archive/2013/01/30/2880764.html" target="_blank" rel="external nofollow noopener noreferrer"&gt;HTTP Live Streaming直播(iOS直播)技术分析与实现&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&#10;GitHub -&amp;gt; &lt;a href="https://github.com/LaiFengiOS" target="_blank" rel="external nofollow noopener noreferrer"&gt;LaiFengiOS&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;/&lt;a href="https://github.com/LaiFengiOS/LFLiveKit" target="_blank" rel="external nofollow noopener noreferrer"&gt;LFLiveKit&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;**GitHub -&amp;gt; &lt;a href="https://github.com/BradLarson" target="_blank" rel="external nofollow noopener noreferrer"&gt;BradLarson&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;/&lt;a href="https://github.com/BradLarson/GPUImage" target="_blank" rel="external nofollow noopener noreferrer"&gt;GPUImage&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;**GitHub -&amp;gt; &lt;a href="https://github.com/Guikunzhi/BeautifyFaceDemo" target="_blank" rel="external nofollow noopener noreferrer"&gt;BeautifyFaceDemo&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;li&gt;解读：&lt;a href="http://www.open-open.com/lib/view/open1463108934371.html" target="_blank" rel="external nofollow noopener noreferrer"&gt;iOS实时美颜滤镜是怎样炼成的&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&#10;GitHub -&amp;gt; &lt;a href="https://github.com/Bilibili" target="_blank" rel="external nofollow noopener noreferrer"&gt;Bilibili&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;/&lt;a href="https://github.com/Bilibili/ijkplayer" target="_blank" rel="external nofollow noopener noreferrer"&gt;ijkplayer&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;一般做rtmp编程的时候，需要用到rtmp视频源地址，通常可以自己搭建Red5等服务器到自己的机器配置好后，编写客户端，但是这样有点麻烦；&lt;/p&gt;</description></item><item><title>8：FFmpeg在iOS上完美编译</title><link>https://apolla.cc/posts/live/8ffmpeg%E5%9C%A8ios%E4%B8%8A%E5%AE%8C%E7%BE%8E%E7%BC%96%E8%AF%91/</link><pubDate>Sat, 09 Mar 2024 23:21:58 +0800</pubDate><guid>https://apolla.cc/posts/live/8ffmpeg%E5%9C%A8ios%E4%B8%8A%E5%AE%8C%E7%BE%8E%E7%BC%96%E8%AF%91/</guid><category domain="https://apolla.cc/categories/%E7%9B%B4%E6%92%AD/">直播</category><description>&lt;p&gt;最近刚接触ffmpeg,找了很多相关的编译资料，都没有编译成功，前几天在 github上找到一个脚本（&lt;a href="https://github.com/kewlbear/FFmpeg-iOS-build-script" target="_blank" rel="external nofollow noopener noreferrer"&gt;https://github.com/kewlbear/FFmpeg-iOS-build-script&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;），就可完美编译&#10;&lt;strong&gt;准备条件&lt;/strong&gt;&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;先下载文件：&lt;a href="https://github.com/libav/gas-preprocessor" target="_blank" rel="external nofollow noopener noreferrer"&gt;https://github.com/libav/gas-preprocessor&lt;i class="fa-solid fa-external-link-alt fa-xs ms-1 text-secondary" aria-hidden="true"&gt;&lt;/i&gt;&lt;/a&gt;，&#10;复制gas-preprocessor.pl到/usr/sbin下，&#10;修改文件权限：chmod 777 /usr/local/bin/gas-preprocessor.pl&lt;/li&gt;&#10;&lt;li&gt;安装yasm&lt;/li&gt;&#10;&lt;/ul&gt;&#10;&lt;p&gt;&lt;strong&gt;具体步骤如下：&lt;/strong&gt;&lt;/p&gt;</description></item></channel></rss>