快速落地智能云存储摄像机解决方案

0
0
{"value":"### **介绍**\n#### **加速 IPC 设备开发进度**\n为IPC出海客户提供快速开发产品的代码原型参考。\n\n相信每个想要 IPC 出海的厂商,在设备接入亚马逊 Kinesis Video Stream 服务时都面临同样一个痛点:如何快速的开发一款安全,稳定,高效,低成本的亚马逊云连接 IPC。[KVS embedded producer C SDK](https://github.com/aws-samples/amazon-kinesis-video-streams-producer-embedded-c)就是为了这个目的而诞生的。\n\nKVS embedded producer C SDK 延续了亚马逊云一贯的高安全性。并且我们着重深度优化了软件的内存占用情况,使得仅拥有64MB甚至32MB的低成本 IPC SoC 一样可以正常运行。在与芯片厂商(如本文下面提到的君正T31)深度合作的背景下,这款 SDK 拥有了更好的稳定性和高效的性能表现。它提供了“自带电池”一般的使用体验,极易上手。\n\n#### **Kinesis Video Stream 介绍**\n\n![image.png](https://dev-media.amazoncloud.cn/ee2d2aaabf474bac8542f5237ae1638e_image.png)\n\n#### **T31 介绍**\nT31 智能视频处理器拥有1.5G高主频 CPU 计算性能,星光增强 ISP,5M@30帧视频编码,安全引擎 并且内置 DDR 。\n\n专业的成像能力,领先的编码品质,丰富的差异化扩展,极致的成本控制和低功耗基因,搭配整合好的丰富 AI 功能算法,使 T31成为业内最全面均衡的H.265+AI视频处理器。\n\n![image.png](https://dev-media.amazoncloud.cn/8012dce617224192ae408549337b5278_image.png)\n\n#### **T31 硬件开发板**\n\n![image.png](https://dev-media.amazoncloud.cn/60ad80e6ee25468da4f5d9ca3e05f582_image.png)\n\n### **使用方法**\n#### **下载代码**\n```\\ngit clone --recursive https://github.com/aws-samples/amazon-kinesis-video-streams-producer-embedded-c.git\\n```\n\n如果在执行 git clone 命令的时候忘记带上 –recursive ,参数,可以进入代码目录中执行 git submodule update –init –recursive 。\n\n#### **预置设备证书(可选)**\nIP Camera 设备也可以使用 X.509 证书连接到 Amazon IoT,然后从Amazon IoT credentials provider 中获取授权信息,并用此信息来授权 Kinesis Video Streams service 的相关操作。请参考文档中 “[how-iot](https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/how-iot.html)” 的相关操作步骤。\n\n#### **准备 H264 视频文件**\n上面介绍的代码中,我们上传的视频是预先录制好,并以文件形式储存在本地的。可以在代码中 “samples/h264SampleFrames/” 目录下面找到,这些文件都是以”frame-[index].h264″作为开头。比如,”frame-001.h264″, “frame-002.h264”, 等等。\nYou can also use [sample frames of amazon-kinesis-video-streams-producer-c](https://github.com/awslabs/amazon-kinesis-video-streams-producer-c/tree/master/samples/h264SampleFrames).\n\n#### **Ingenic T31 example**\n##### **准备工作**\n- Ingenic T31 SDK ISVP-T31-1.1.3-20210223:\n\n\t注意:上面的代码中没有附带君正 T31 的 SDK,所以需要自行联系君正或者该SDK\n\n- Ingenic T31 EVB 开发板\n- 以太网网络连接\n\n\n##### **Device 设置**\n请跟随君正 T31 的 SDK 中附带的”T31 SNIPE_user_guide.pdf”配置设备,加入如下配置到 /system/init/app_init.sh\n\n#### **设置 DNS server**\n使用如下命令设置 DNS 服务器。.其中 “8.8.8.8” 是谷歌的DNS服务器,可以根据实际情况修改。.\n\n```echo 'nameserver 8.8.8.8' > /etc/resolv.conf```\n\n然后,使用如下命令验证 DNS 服务器是否正确。\n\n```\\n# ping aws.amazon.com\\nPING aws.amazon.com (13.35.25.75): 56 data bytes\\n64 bytes from 13.35.25.75: seq=0 ttl=242 time=10.026 ms\\n64 bytes from 13.35.25.75: seq=1 ttl=242 time=9.244 ms\\n```\n\n##### **设置 NTP time**\n注意:请确保你的 NTP 服务器工作正常,可以根据实际情况修改NTP服务器地址。\n\n```ntpd -nqp pool.ntp.org```\n\n然后,使用如下命令验证 NTP 服务器是否正确。\n\n```\\n[root@Ingenic-uc1_1:mnt]# date\\nFri Jul 16 03:30:05 UTC 2021\\n```\n\n##### **挂载 SD card**\n这里我们会把执行程序放在 SD 中,如果你使用其他地址存放执行程序,比如 Flash,可以跳过这一步。\n使用如下命令挂载 SD 卡。\n\n```mount -t vfat /dev/mmcblk0p1 /mnt```\n\n##### **使能 音频驱动**\n使用如下命令加载音频模块,如果你不想使用音频,可以跳过这一步。\n\n```insmod /system/lib/modules/audio.ko```\n\n##### **构建代码**\n##### **下载代码**\n```\\ngit clone --recursive https://github.com/aws-samples/amazon-kinesis-video-streams-producer-embedded-c.git\\n```\n\n如果在执行 git clone 命令的时候忘记带上 –recursive ,参数,可以进入代码目录中执行 ```git submodule update --init --recursive``` 。\n\n##### **配置 T31 SDK**\n将 T31 的 SDK 放到 “samples/kvsapp-ingenic-t31/sdk/”目录下\n\n```\\ncp -rf /path/to/ISVP-T31-1.1.3-20210223/software/sdk/Ingenic-SDK-T31-1.1.3-20210223/sdk/4.7.2 \\\\\\n /path/to/amazon-kinesis-video-streams-producer-embedded-c/samples/kvsapp-ingenic-t31/sdk/\\n```\n\n最终的目录结构如下:\n```\\n\\n.\\n├── app\\n├── libraries\\n├── misc\\n├── samples\\n│ ├── kvsapp-ingenic-t31\\n│ │ ├── include\\n│ │ ├── library\\n│ │ ├── sdk\\n│ │ │ ├── include\\n│ │ │ │ ├── imp\\n│ │ │ │ └── sysutils\\n│ │ │ ├── lib\\n│ │ │ │ ├── glibc\\n│ │ │ │ └── uclibc\\n│ │ │ └── samples\\n│ │ │ ├── libimp-samples\\n│ │ │ └── libsysutils-samples\\n│ │ └── source\\n│ └── mkv_uploader\\n└── src\\n```\n\n##### **配置 toolchain**\n添加”mips-gcc472-glibc216-64bit”交叉编译链到系统的 PATH 中\n\n```\\nexport PATH=\$PATH:/path/to/your/toolchain/mips-gcc472-glibc216-64bit/bin\\n```\n\n##### **配置 sample**\n如果你想使用环境变量,可以跳过这一步。\n详细配置保存在 “samples/kvsapp-ingenic-t31/include/sample_config.h“文件中。\n\n##### **Build**\n创建 build 目录\n\n```mkdir build && cd build```\n\n执行 cmake 命令\n\n```\\ncmake -DCMAKE_C_COMPILER=mips-linux-gnu-gcc \\\\\\n -DCMAKE_CXX_COMPILER=mips-linux-gnu-g++ \\\\\\n -DBOARD_INGENIC_T31=ON \\\\\\n ..\\n```\n\n##### **Build 整个项目**\n\n```cmake --build``` .\n\n在编译完成以后,在”build/bin/”目录下将会出现两个可执行文件: “kvsappcli-ingenic-t31” 和 “kvsappcli-ingenic-t31-static” 。 “kvsappcli-ingenic-t31″ 使用”build/lib/” 目录下的shared library。 “kvsappcli-ingenic-t31-static” 是一个静态可执行程序,它不需要其他的动态库,除了最基本的运行时 library,比如 “libc” 和 “pthread”。 将上述编译生成的文件以及相关的音视频文件拷贝到 SD 卡中。\n\n##### **运行 sample**\n如果你没有把配置写入文件 “*samples/kvsapp-ingenic-t31/include/sample_config.h*“,可以直接配置环境变量:\n\n```\\nexport AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxxxxx\\nexport AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\\nexport AWS_DEFAULT_REGION=us-east-1\\nexport AWS_KVS_HOST=kinesisvideo.us-east-1.amazonaws.com\\n```\n\n现在可执行文件已经在 SD 卡上了,可以使用如下命令启动应用,其中 kvs-stream-name 是 KVS 流的名字。也可以把这些参数细节写入sample_config.h 文件中。\n\n```\\ncd /mnt\\n./kvsappcli-ingenic-t31-static [kvs-stream-name]\\n```\n\n如果一切正常,可以看到如下输出:\n\n```\\n[root@Ingenic-uc1_1:mnt]# ./kvsappcli-ingenic-t31\\nAACEncoderInit channels = 1, pcm_frame_len = 2048\\n[ 5577.435278] gc2053 chip found @ 0x37 (i2c0) version H20210315a\\n---- FPGA board is ready ----\\nBoard UID : 30AB6E51\\nBoard HW ID : 72000460\\nBoard rev. : 5DE5A975\\nBoard date : 20190326\\n-----------------------------\\n!! The specified ScalingList is not allowed; it will be adjusted!!\\n[ 5577.814323] codec_set_device: set device: MIC...\\nInfo: SPS is found\\nInfo: SPS is set\\nInfo: PPS is found\\nInfo: PPS is set\\nInfo: KVS stream buffer created\\nInfo: Try to describe stream\\nInfo: PUT MEDIA endpoint: s-xxxxxxxx.kinesisvideo.us-east-1.amazonaws.com\\nInfo: 100-continue\\nInfo: Flush to next cluster\\nInfo: Fragment buffering, timecode:1628131208569\\nInfo: Fragment received, timecode:1628131208569\\nInfo: Fragment buffering, timecode:1628131212771\\nInfo: Fragment persisted, timecode:1628131208569\\nInfo: Fragment received, timecode:1628131212771\\nInfo: Fragment buffering, timecode:1628131216972\\nInfo: Fragment persisted, timecode:1628131212771\\nInfo: Fragment received, timecode:1628131216972\\nInfo: Fragment buffering, timecode:1628131220975\\nInfo: Fragment persisted, timecode:1628131216972\\nInfo: Fragment received, timecode:1628131220975\\nInfo: Fragment buffering, timecode:1628131224975\\nInfo: Fragment persisted, timecode:1628131220975\\n```\n\n##### **KVS sample for Ingenic T31**\n上面的 build 步骤以后,””build/ingenic_t31_kvs_sample”目录中将会出现一些预编译好的 libraries。这样可以大大加速再次 build 的速度。\n\n##### **目前支持的其他硬件平台**\n上面介绍的代码是为嵌入式设备特殊优化的,比如 [FreeRTOS](https://aws.amazon.com/cn/freertos/?trk=cndc-detail)/Embedded Linux。如下的几种常见的嵌入式平台,目前都可以使用这份代码安全的上传音视频流到 Kinesis Video Streams.\n\n- [Espressif ESP-WROVER-KIT](https://github.com/aws-samples/amazon-kinesis-video-streams-producer-embedded-c#esp-wrover-kit-example)\n- [Ingenic T31](https://github.com/aws-samples/amazon-kinesis-video-streams-producer-embedded-c/tree/main/samples/kvsapp-ingenic-t31)\n- [Realtek AmebaPro](https://github.com/aws-samples/amazon-kinesis-video-streams-producer-embedded-c#realtek-amebapro-example)\n- [Raspberry Pi/V4L2](https://github.com/aws-samples/amazon-kinesis-video-streams-producer-embedded-c#raspberry-pi-v4l2-example)\n- [Linux](https://github.com/aws-samples/amazon-kinesis-video-streams-producer-embedded-c#linux-example)\n\n### **KVS 认证**\nAmazon 提供一系列硬體相關的[認證程序](https://aws.amazon.com/partners/programs/dqp/),用來協助合作伙伴驗證其硬體設備正常運行在 Amazon 相關服務。經由 Amazon 認證通過的硬件設備將會被列表在 Amazon 合作伙伴的[設備目錄](https://devices.amazonaws.com/)。此設備目錄將協助終端用戶快速搜索相關的硬件設備,加速搭建解決方案所選用之硬件,目的在於讓用戶專注在解決方案之開發,利用 Amazon IoT 生態圈來簡化硬件的選用,達成最佳的用戶體驗。 [Amazon Kinesis Video Streams](https://aws.amazon.com/cn/kinesis/video-streams/?trk=cndc-detail) 為 Amazon Device Qualification Program 其中一項硬體認證服務。\n\n[Amazon Kinesis Video Streams](https://aws.amazon.com/cn/kinesis/video-streams/?trk=cndc-detail) 認證程序基於有攝像頭的設備,或是俱備上傳影音功能之設備已整合相關軟件。確保設備正常運行[ KVS 相關軟件](https://aws.amazon.com/kinesis/video-streams/resources/?amazon-kinesis-video-streams-resources-blog.sort-by=item.additionalFields.createdDate&amazon-kinesis-video-streams-resources-blog.sort-order=desc),且能持續的將影音資料上傳至 KVS 服務。認證程序涵蓋了設備連線能力,與 KVS 服務之交互,設備身份驗證程序,以及合乎最佳安全實踐。客戶透過登入 Amazon Partner Central 來取得相關認證文件。\n\n合作伙伴所提交之設備,經過技術團隊驗證以及市場團隊審核其內容,完成認證流程後,硬件設備將會被公開發佈在[ Amazon Partner Device Catalog](https://devices.amazonaws.com/search?page=1&sv=kinvid) 以及 [ Amazon 硬件合作伙伴](https://aws.amazon.com/partners/programs/dqp/partners/) 之中。\n\n#### **本篇作者**\n\n![image.png](https://dev-media.amazoncloud.cn/18201cca2edd4ce8b3ea7bb9a39b50cb_image.png)\n\n**William**\nAmazon 物联网实验室 解决方案架构师,主要负责物联网解决方案,致力于 Amazon IoT 相关技术的的推广与应用\n\n![image.png](https://dev-media.amazoncloud.cn/b6bad4bdfbd44e42bc5042b1d5527e6e_image.png)\n\n**Blake**\nAmazon 物联网实验室 技术项目经理,主要负责物联网实验室项目推动,致力于 Amazon IoT 相关技术的扩展与推动新服务\n\n\n![image.png](https://dev-media.amazoncloud.cn/b28347abe28a4d13b00a380c2234b092_image.png)\n\n**Jimmy**\n北京君正智能视频事业部软件工程师,致力于 IPC 产品解决方案的推广与应用\n\n![image.png](https://dev-media.amazoncloud.cn/82c076bd50b642dfa93e735bda027dc9_image.png)\n\n**徐开**\nAmazon 物联网实验室 解决方案架构师,主要负责物联网解决方案,致力于 Amazon IoT 相关技术的的推广与应用","render":"<h3><a id=\\"_0\\"></a><strong>介绍</strong></h3>\\n<h4><a id=\\"_IPC__1\\"></a><strong>加速 IPC 设备开发进度</strong></h4>\\n<p>为IPC出海客户提供快速开发产品的代码原型参考。</p>\n<p>相信每个想要 IPC 出海的厂商,在设备接入亚马逊 Kinesis Video Stream 服务时都面临同样一个痛点:如何快速的开发一款安全,稳定,高效,低成本的亚马逊云连接 IPC。<a href=\\"https://github.com/aws-samples/amazon-kinesis-video-streams-producer-embedded-c\\" target=\\"_blank\\">KVS embedded producer C SDK</a>就是为了这个目的而诞生的。</p>\\n<p>KVS embedded producer C SDK 延续了亚马逊云一贯的高安全性。并且我们着重深度优化了软件的内存占用情况,使得仅拥有64MB甚至32MB的低成本 IPC SoC 一样可以正常运行。在与芯片厂商(如本文下面提到的君正T31)深度合作的背景下,这款 SDK 拥有了更好的稳定性和高效的性能表现。它提供了“自带电池”一般的使用体验,极易上手。</p>\n<h4><a id=\\"Kinesis_Video_Stream__8\\"></a><strong>Kinesis Video Stream 介绍</strong></h4>\\n<p><img src=\\"https://dev-media.amazoncloud.cn/ee2d2aaabf474bac8542f5237ae1638e_image.png\\" alt=\\"image.png\\" /></p>\n<h4><a id=\\"T31__12\\"></a><strong>T31 介绍</strong></h4>\\n<p>T31 智能视频处理器拥有1.5G高主频 CPU 计算性能,星光增强 ISP,5M@30帧视频编码,安全引擎 并且内置 DDR 。</p>\n<p>专业的成像能力,领先的编码品质,丰富的差异化扩展,极致的成本控制和低功耗基因,搭配整合好的丰富 AI 功能算法,使 T31成为业内最全面均衡的H.265+AI视频处理器。</p>\n<p><img src=\\"https://dev-media.amazoncloud.cn/8012dce617224192ae408549337b5278_image.png\\" alt=\\"image.png\\" /></p>\n<h4><a id=\\"T31__19\\"></a><strong>T31 硬件开发板</strong></h4>\\n<p><img src=\\"https://dev-media.amazoncloud.cn/60ad80e6ee25468da4f5d9ca3e05f582_image.png\\" alt=\\"image.png\\" /></p>\n<h3><a id=\\"_23\\"></a><strong>使用方法</strong></h3>\\n<h4><a id=\\"_24\\"></a><strong>下载代码</strong></h4>\\n<pre><code class=\\"lang-\\">git clone --recursive https://github.com/aws-samples/amazon-kinesis-video-streams-producer-embedded-c.git\\n</code></pre>\\n<p>如果在执行 git clone 命令的时候忘记带上 –recursive ,参数,可以进入代码目录中执行 git submodule update –init –recursive 。</p>\n<h4><a id=\\"_31\\"></a><strong>预置设备证书(可选)</strong></h4>\\n<p>IP Camera 设备也可以使用 X.509 证书连接到 Amazon IoT,然后从Amazon IoT credentials provider 中获取授权信息,并用此信息来授权 Kinesis Video Streams service 的相关操作。请参考文档中 “<a href=\\"https://docs.aws.amazon.com/kinesisvideostreams/latest/dg/how-iot.html\\" target=\\"_blank\\">how-iot</a>” 的相关操作步骤。</p>\\n<h4><a id=\\"_H264__34\\"></a><strong>准备 H264 视频文件</strong></h4>\\n<p>上面介绍的代码中,我们上传的视频是预先录制好,并以文件形式储存在本地的。可以在代码中 “samples/h264SampleFrames/” 目录下面找到,这些文件都是以”frame-[index].h264″作为开头。比如,”frame-001.h264″, “frame-002.h264”, 等等。<br />\\nYou can also use <a href=\\"https://github.com/awslabs/amazon-kinesis-video-streams-producer-c/tree/master/samples/h264SampleFrames\\" target=\\"_blank\\">sample frames of amazon-kinesis-video-streams-producer-c</a>.</p>\\n<h4><a id=\\"Ingenic_T31_example_38\\"></a><strong>Ingenic T31 example</strong></h4>\\n<h5><a id=\\"_39\\"></a><strong>准备工作</strong></h5>\\n<ul>\\n<li>\\n<p>Ingenic T31 SDK ISVP-T31-1.1.3-20210223:</p>\n<p>注意:上面的代码中没有附带君正 T31 的 SDK,所以需要自行联系君正或者该SDK</p>\n</li>\\n<li>\\n<p>Ingenic T31 EVB 开发板</p>\n</li>\\n<li>\\n<p>以太网网络连接</p>\n</li>\\n</ul>\n<h5><a id=\\"Device__48\\"></a><strong>Device 设置</strong></h5>\\n<p>请跟随君正 T31 的 SDK 中附带的”T31 SNIPE_user_guide.pdf”配置设备,加入如下配置到 /system/init/app_init.sh</p>\n<h4><a id=\\"_DNS_server_51\\"></a><strong>设置 DNS server</strong></h4>\\n<p>使用如下命令设置 DNS 服务器。.其中 “8.8.8.8” 是谷歌的DNS服务器,可以根据实际情况修改。.</p>\n<p><code>echo 'nameserver 8.8.8.8' &gt; /etc/resolv.conf</code></p>\\n<p>然后,使用如下命令验证 DNS 服务器是否正确。</p>\n<pre><code class=\\"lang-\\"># ping aws.amazon.com\\nPING aws.amazon.com (13.35.25.75): 56 data bytes\\n64 bytes from 13.35.25.75: seq=0 ttl=242 time=10.026 ms\\n64 bytes from 13.35.25.75: seq=1 ttl=242 time=9.244 ms\\n</code></pre>\\n<h5><a id=\\"_NTP_time_65\\"></a><strong>设置 NTP time</strong></h5>\\n<p>注意:请确保你的 NTP 服务器工作正常,可以根据实际情况修改NTP服务器地址。</p>\n<p><code>ntpd -nqp pool.ntp.org</code></p>\\n<p>然后,使用如下命令验证 NTP 服务器是否正确。</p>\n<pre><code class=\\"lang-\\">[root@Ingenic-uc1_1:mnt]# date\\nFri Jul 16 03:30:05 UTC 2021\\n</code></pre>\\n<h5><a id=\\"_SD_card_77\\"></a><strong>挂载 SD card</strong></h5>\\n<p>这里我们会把执行程序放在 SD 中,如果你使用其他地址存放执行程序,比如 Flash,可以跳过这一步。<br />\\n使用如下命令挂载 SD 卡。</p>\n<p><code>mount -t vfat /dev/mmcblk0p1 /mnt</code></p>\\n<h5><a id=\\"__83\\"></a><strong>使能 音频驱动</strong></h5>\\n<p>使用如下命令加载音频模块,如果你不想使用音频,可以跳过这一步。</p>\n<p><code>insmod /system/lib/modules/audio.ko</code></p>\\n<h5><a id=\\"_88\\"></a><strong>构建代码</strong></h5>\\n<h5><a id=\\"_89\\"></a><strong>下载代码</strong></h5>\\n<pre><code class=\\"lang-\\">git clone --recursive https://github.com/aws-samples/amazon-kinesis-video-streams-producer-embedded-c.git\\n</code></pre>\\n<p>如果在执行 git clone 命令的时候忘记带上 –recursive ,参数,可以进入代码目录中执行 <code>git submodule update --init --recursive</code> 。</p>\\n<h5><a id=\\"_T31_SDK_96\\"></a><strong>配置 T31 SDK</strong></h5>\\n<p>将 T31 的 SDK 放到 “samples/kvsapp-ingenic-t31/sdk/”目录下</p>\n<pre><code class=\\"lang-\\">cp -rf /path/to/ISVP-T31-1.1.3-20210223/software/sdk/Ingenic-SDK-T31-1.1.3-20210223/sdk/4.7.2 \\\\\\n /path/to/amazon-kinesis-video-streams-producer-embedded-c/samples/kvsapp-ingenic-t31/sdk/\\n</code></pre>\\n<p>最终的目录结构如下:</p>\n<pre><code class=\\"lang-\\">\\n.\\n├── app\\n├── libraries\\n├── misc\\n├── samples\\n│ ├── kvsapp-ingenic-t31\\n│ │ ├── include\\n│ │ ├── library\\n│ │ ├── sdk\\n│ │ │ ├── include\\n│ │ │ │ ├── imp\\n│ │ │ │ └── sysutils\\n│ │ │ ├── lib\\n│ │ │ │ ├── glibc\\n│ │ │ │ └── uclibc\\n│ │ │ └── samples\\n│ │ │ ├── libimp-samples\\n│ │ │ └── libsysutils-samples\\n│ │ └── source\\n│ └── mkv_uploader\\n└── src\\n</code></pre>\\n<h5><a id=\\"_toolchain_130\\"></a><strong>配置 toolchain</strong></h5>\\n<p>添加”mips-gcc472-glibc216-64bit”交叉编译链到系统的 PATH 中</p>\n<pre><code class=\\"lang-\\">export PATH=\$PATH:/path/to/your/toolchain/mips-gcc472-glibc216-64bit/bin\\n</code></pre>\\n<h5><a id=\\"_sample_137\\"></a><strong>配置 sample</strong></h5>\\n<p>如果你想使用环境变量,可以跳过这一步。<br />\\n详细配置保存在 “samples/kvsapp-ingenic-t31/include/sample_config.h“文件中。</p>\n<h5><a id=\\"Build_141\\"></a><strong>Build</strong></h5>\\n<p>创建 build 目录</p>\n<p><code>mkdir build &amp;&amp; cd build</code></p>\\n<p>执行 cmake 命令</p>\n<pre><code class=\\"lang-\\">cmake -DCMAKE_C_COMPILER=mips-linux-gnu-gcc \\\\\\n -DCMAKE_CXX_COMPILER=mips-linux-gnu-g++ \\\\\\n -DBOARD_INGENIC_T31=ON \\\\\\n ..\\n</code></pre>\\n<h5><a id=\\"Build__155\\"></a><strong>Build 整个项目</strong></h5>\\n<p><code>cmake --build</code> .</p>\\n<p>在编译完成以后,在”build/bin/”目录下将会出现两个可执行文件: “kvsappcli-ingenic-t31” 和 “kvsappcli-ingenic-t31-static” 。 “kvsappcli-ingenic-t31″ 使用”build/lib/” 目录下的shared library。 “kvsappcli-ingenic-t31-static” 是一个静态可执行程序,它不需要其他的动态库,除了最基本的运行时 library,比如 “libc” 和 “pthread”。 将上述编译生成的文件以及相关的音视频文件拷贝到 SD 卡中。</p>\n<h5><a id=\\"_sample_161\\"></a><strong>运行 sample</strong></h5>\\n<p>如果你没有把配置写入文件 “<em>samples/kvsapp-ingenic-t31/include/sample_config.h</em>“,可以直接配置环境变量:</p>\\n<pre><code class=\\"lang-\\">export AWS_ACCESS_KEY_ID=xxxxxxxxxxxxxxxxxxxx\\nexport AWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\\nexport AWS_DEFAULT_REGION=us-east-1\\nexport AWS_KVS_HOST=kinesisvideo.us-east-1.amazonaws.com\\n</code></pre>\\n<p>现在可执行文件已经在 SD 卡上了,可以使用如下命令启动应用,其中 kvs-stream-name 是 KVS 流的名字。也可以把这些参数细节写入sample_config.h 文件中。</p>\n<pre><code class=\\"lang-\\">cd /mnt\\n./kvsappcli-ingenic-t31-static [kvs-stream-name]\\n</code></pre>\\n<p>如果一切正常,可以看到如下输出:</p>\n<pre><code class=\\"lang-\\">[root@Ingenic-uc1_1:mnt]# ./kvsappcli-ingenic-t31\\nAACEncoderInit channels = 1, pcm_frame_len = 2048\\n[ 5577.435278] gc2053 chip found @ 0x37 (i2c0) version H20210315a\\n---- FPGA board is ready ----\\nBoard UID : 30AB6E51\\nBoard HW ID : 72000460\\nBoard rev. : 5DE5A975\\nBoard date : 20190326\\n-----------------------------\\n!! The specified ScalingList is not allowed; it will be adjusted!!\\n[ 5577.814323] codec_set_device: set device: MIC...\\nInfo: SPS is found\\nInfo: SPS is set\\nInfo: PPS is found\\nInfo: PPS is set\\nInfo: KVS stream buffer created\\nInfo: Try to describe stream\\nInfo: PUT MEDIA endpoint: s-xxxxxxxx.kinesisvideo.us-east-1.amazonaws.com\\nInfo: 100-continue\\nInfo: Flush to next cluster\\nInfo: Fragment buffering, timecode:1628131208569\\nInfo: Fragment received, timecode:1628131208569\\nInfo: Fragment buffering, timecode:1628131212771\\nInfo: Fragment persisted, timecode:1628131208569\\nInfo: Fragment received, timecode:1628131212771\\nInfo: Fragment buffering, timecode:1628131216972\\nInfo: Fragment persisted, timecode:1628131212771\\nInfo: Fragment received, timecode:1628131216972\\nInfo: Fragment buffering, timecode:1628131220975\\nInfo: Fragment persisted, timecode:1628131216972\\nInfo: Fragment received, timecode:1628131220975\\nInfo: Fragment buffering, timecode:1628131224975\\nInfo: Fragment persisted, timecode:1628131220975\\n</code></pre>\\n<h5><a id=\\"KVS_sample_for_Ingenic_T31_216\\"></a><strong>KVS sample for Ingenic T31</strong></h5>\\n<p>上面的 build 步骤以后,””build/ingenic_t31_kvs_sample”目录中将会出现一些预编译好的 libraries。这样可以大大加速再次 build 的速度。</p>\n<h5><a id=\\"_219\\"></a><strong>目前支持的其他硬件平台</strong></h5>\\n<p>上面介绍的代码是为嵌入式设备特殊优化的,比如 FreeRTOS/Embedded Linux。如下的几种常见的嵌入式平台,目前都可以使用这份代码安全的上传音视频流到 Kinesis Video Streams.</p>\n<ul>\\n<li><a href=\\"https://github.com/aws-samples/amazon-kinesis-video-streams-producer-embedded-c#esp-wrover-kit-example\\" target=\\"_blank\\">Espressif ESP-WROVER-KIT</a></li>\\n<li><a href=\\"https://github.com/aws-samples/amazon-kinesis-video-streams-producer-embedded-c/tree/main/samples/kvsapp-ingenic-t31\\" target=\\"_blank\\">Ingenic T31</a></li>\\n<li><a href=\\"https://github.com/aws-samples/amazon-kinesis-video-streams-producer-embedded-c#realtek-amebapro-example\\" target=\\"_blank\\">Realtek AmebaPro</a></li>\\n<li><a href=\\"https://github.com/aws-samples/amazon-kinesis-video-streams-producer-embedded-c#raspberry-pi-v4l2-example\\" target=\\"_blank\\">Raspberry Pi/V4L2</a></li>\\n<li><a href=\\"https://github.com/aws-samples/amazon-kinesis-video-streams-producer-embedded-c#linux-example\\" target=\\"_blank\\">Linux</a></li>\\n</ul>\n<h3><a id=\\"KVS__228\\"></a><strong>KVS 认证</strong></h3>\\n<p>Amazon 提供一系列硬體相關的<a href=\\"https://aws.amazon.com/partners/programs/dqp/\\" target=\\"_blank\\">認證程序</a>,用來協助合作伙伴驗證其硬體設備正常運行在 Amazon 相關服務。經由 Amazon 認證通過的硬件設備將會被列表在 Amazon 合作伙伴的<a href=\\"https://devices.amazonaws.com/\\" target=\\"_blank\\">設備目錄</a>。此設備目錄將協助終端用戶快速搜索相關的硬件設備,加速搭建解決方案所選用之硬件,目的在於讓用戶專注在解決方案之開發,利用 Amazon IoT 生態圈來簡化硬件的選用,達成最佳的用戶體驗。 [Amazon Kinesis Video Streams](https://aws.amazon.com/cn/kinesis/video-streams/?trk=cndc-detail) 為 Amazon Device Qualification Program 其中一項硬體認證服務。</p>\\n<p>Amazon Kinesis Video Streams 認證程序基於有攝像頭的設備,或是俱備上傳影音功能之設備已整合相關軟件。確保設備正常運行<a href=\\"https://aws.amazon.com/kinesis/video-streams/resources/?amazon-kinesis-video-streams-resources-blog.sort-by=item.additionalFields.createdDate&amp;amazon-kinesis-video-streams-resources-blog.sort-order=desc\\" target=\\"_blank\\"> KVS 相關軟件</a>,且能持續的將影音資料上傳至 KVS 服務。認證程序涵蓋了設備連線能力,與 KVS 服務之交互,設備身份驗證程序,以及合乎最佳安全實踐。客戶透過登入 Amazon Partner Central 來取得相關認證文件。</p>\\n<p>合作伙伴所提交之設備,經過技術團隊驗證以及市場團隊審核其內容,完成認證流程後,硬件設備將會被公開發佈在<a href=\\"https://devices.amazonaws.com/search?page=1&amp;sv=kinvid\\" target=\\"_blank\\"> Amazon Partner Device Catalog</a> 以及 <a href=\\"https://aws.amazon.com/partners/programs/dqp/partners/\\" target=\\"_blank\\"> Amazon 硬件合作伙伴</a> 之中。</p>\\n<h4><a id=\\"_235\\"></a><strong>本篇作者</strong></h4>\\n<p><img src=\\"https://dev-media.amazoncloud.cn/18201cca2edd4ce8b3ea7bb9a39b50cb_image.png\\" alt=\\"image.png\\" /></p>\n<p><strong>William</strong><br />\\nAmazon 物联网实验室 解决方案架构师,主要负责物联网解决方案,致力于 Amazon IoT 相关技术的的推广与应用</p>\n<p><img src=\\"https://dev-media.amazoncloud.cn/b6bad4bdfbd44e42bc5042b1d5527e6e_image.png\\" alt=\\"image.png\\" /></p>\n<p><strong>Blake</strong><br />\\nAmazon 物联网实验室 技术项目经理,主要负责物联网实验室项目推动,致力于 Amazon IoT 相关技术的扩展与推动新服务</p>\n<p><img src=\\"https://dev-media.amazoncloud.cn/b28347abe28a4d13b00a380c2234b092_image.png\\" alt=\\"image.png\\" /></p>\n<p><strong>Jimmy</strong><br />\\n北京君正智能视频事业部软件工程师,致力于 IPC 产品解决方案的推广与应用</p>\n<p><img src=\\"https://dev-media.amazoncloud.cn/82c076bd50b642dfa93e735bda027dc9_image.png\\" alt=\\"image.png\\" /></p>\n<p><strong>徐开</strong><br />\\nAmazon 物联网实验室 解决方案架构师,主要负责物联网解决方案,致力于 Amazon IoT 相关技术的的推广与应用</p>\n"}
目录
亚马逊云科技解决方案 基于行业客户应用场景及技术领域的解决方案
联系亚马逊云科技专家
亚马逊云科技解决方案
基于行业客户应用场景及技术领域的解决方案
联系专家
0
目录
关闭