1、我的需求是把无人机的视频推送到国标平台。 2、改造了官方DEMO,用VIDEOFEEDVIEW.JAVA里面的V...

Completed

Comments

16 comments

  • Leo

    问题是我发的。 本地画面是正常的,只是偶尔会花屏,推出来再播放,是一直花屏。

    0
    Comment actions Permalink
  • DJI Developer Support
    你的机型是什么?纯正的H.264视频流要从provideTranscodedVideoFeed这个函数接口中获取。
    0
    Comment actions Permalink
  • Leo

    御Mavic Mini

    0
    Comment actions Permalink
  • Leo

    官方DEMO中,VideoFeederView.java用getPrimaryVideoFeed,本地画面是正常的。用provideTranscodedVideoFeed,画面就花屏了,如下所示:,请问是什么原因导致的。因为我还要再推流到国标平台,所以必须用provideTranscodedVideoFeed,返回标准的H264数据。

    0
    Comment actions Permalink
  • DJI Developer Support
    Mavic Mini使用getPrimaryVideoFeed,但是获取的是DJI格式的H.264直接送出去是没法解码播放的,建议你送到解码器解称Yuv数据再传给国标平台。
    0
    Comment actions Permalink
  • Leo

    那什么机型支持直接从provideTranscodedVideoFeed取H264,直接推送呢? 因为解码再编码,延迟大

    0
    Comment actions Permalink
  • DJI Developer Support
    御2系列的飞机的视频流是直接从provideTranscodedVideoFeed获取H.264视频流。
    0
    Comment actions Permalink
  • Gn

    那想问一下,M210 RTK,精灵4RTK 也是通过这个视频流调用吗?御2进阶、M300呢?  不同的机型用不同的接口吗?有没有优化的方法可以适用于不同的机型啊。  因为后面业务还要适配不同机型。

    1
    Comment actions Permalink
  • DJI Developer Support
    其余机型都是用getPrimaryVideoFeed,我们确实有很多机型使用的都是不同的接口,需要对各种机型做不同的适配。
    0
    Comment actions Permalink
  • Leo

    但是getPrimaryVideoFeed获取的不是大疆制式的H264吗? 就是我需要获取标准的H264,再推送到国标平台,那么:1、有哪几种接口获取标准的H264?

    2、还是有的机型不支持获取标准的H264,只能用解码后的YUV,那么解码的YUV格式是什么类型?NV21还是其他什么?

    0
    Comment actions Permalink
  • DJI Developer Support
    getPrimaryVideoFeed获取的是DJI格式的H.264所以只能用于显示,不使用LiveStreamManager无法推流。要想推流则必须要使用provideTranscodedVideoFeed或者把getPrimaryVideoFeed送到DJICodecManager做进一步解码称Yuv数据,看机型出数据,NV21和YUV420P都会有。要provideTranscodedVideoFeed出数据,你需要创造个DJICodecManager,在getPrimaryVideoFeed的回调里把数据送到解码器解码,后面会重新编码从provideTranscodedVideoFeed出数据。御2系列的飞机最特殊,什么都不用做,直接监听provideTranscodedVideoFeed就可以了。
    0
    Comment actions Permalink
  • Leo

    要provideTranscodedVideoFeed出数据,你需要创造个DJICodecManager,在getPrimaryVideoFeed的回调里把数据送到解码器解码,后面会重新编码从provideTranscodedVideoFeed出数据.

    针对以上说法,DJICodecManager没有找到编码的方法,所以这个流程需要怎么做?

    0
    Comment actions Permalink
  • DJI Developer Support
    getPrimaryVideoFeed的回调里调用sendDataToDecoder就可以了,provideTranscodedVideoFeed里面应该就会出数据,编码是我们内部自动做的。
    0
    Comment actions Permalink
  • 嘻哈江湖
    我这边是在 getPrimaryVideoFeed的回调里调用sendDataToDecoder了,后面重新拿到了VideoFeed 实例,代码如下
    VideoFeeder.VideoFeed transFeed = VideoFeeder.getInstance().provideTranscodedVideoFeed();
    transFeed .addVideoDataListener(new VideoFeeder.VideoDataListener() {
                                        @Override
                                        public void onReceive(byte[] bytes, int i) {
                                            //打印内容
                                        }
                                    });
     
    但是onReceive里面并没有回调 不知道是什么原因 原始的getPrimaryVideoFeed里面的onReceive回调是走的
    0
    Comment actions Permalink
  • Leo

    provideTranscodedVideoFeed获取的标准264,那么请问怎么设置编码的关键帧间隔?可有接口设置?

    0
    Comment actions Permalink
  • muchacha1

    真复杂。。。。

    0
    Comment actions Permalink

Please sign in to leave a comment.