gpt4 book ai didi

android - 如何在不使用 ffmpeg 的情况下在 node.js 中编码 h.264

转载 作者:太空宇宙 更新时间:2023-11-04 00:00:25 25 4
gpt4 key购买 nike

我正在做一个项目,其中包括用手机控制无人机(Tello)。我选择React Native作为混合应用程序来开发这个项目,我必须在应用程序中插入一个node.js( Node.js for Mobile Apps React Native ),因为无人机只有udp通信,并且还需要一个包来解码流视频。

无人机有3个udp端口,其中一个用于接收指令,另一个用于发送无人机状态,最后一个用于发送视频。

这个视频是我从流中获得的,它是原始的,所以我需要一个包来编码或转换它。

我正在测试一些东西,因为没有关于这个主题的文档。我下载了 ffmpeg,然后尝试解码 H.264 中的数据,终于可以看到视频了。

在介绍完之后我想问你:

有什么方法可以在移动设备上使用相同的技术而不需要 ffmpeg?

有没有办法将ffmpeg导入android并与nodejs通信?

最佳答案

Is there any way I can use the same technique on the mobile without needing ffmpeg?

是的,您可以使用 native 视频解码器。 Android 上的 MediaCodec 和 iOS 上的 VideoToolbox

Is there any way to import ffmpeg into android and communicate with nodejs?'

是的,node js 有 C 的绑定(bind),而且我确信有开源的绑定(bind)。您还可以使用类似 child_process

Is there any other solution where I can use another node that doesn't have to be on the phone?

当然,很多。

关于android - 如何在不使用 ffmpeg 的情况下在 node.js 中编码 h.264,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55002012/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com