Mobile-SDK-Android-V5 icon indicating copy to clipboard operation
Mobile-SDK-Android-V5 copied to clipboard

[Bug] DJI Mini 4 Pro – onReceiveStreamData() never triggered, video stream not delivered (SDK V5.16, Android, Galaxy S25ultra)

Open HB9FNO opened this issue 2 months ago • 3 comments

✅ Stream listener registered for component after surface available ❌ File too small (40B) - likely no stream data received! 💡 Check if DJI stream listeners are working and feed() methods are called

Subject: DJI Mini 4 Pro – Video Stream Not Delivering Frames (onReceiveStreamData Never Triggered)

Problem Summary

We are experiencing a critical issue with DJI Android SDK V5.16 when working with the DJI Mini 4 Pro.
Despite following the official documentation and community best practices, no video frames are ever delivered.

✅ Mini 4 Pro connects successfully
✅ CameraStreamManager setup runs without errors
✅ MP4 recording files are created with valid headers (40B)
onReceiveStreamData() is never triggered
❌ Files remain at 40 bytes (headers only, no video content)


Our Implementation

// Video stream source setup
val key = KeyTools.createKey(CameraKeys.KeyCameraVideoStreamSource)
KeyManager.getInstance().setValue(key, CameraVideoStreamSource.WIDE_CAMERA, { ... }, { ... })

// Stream manager setup
val streamManager = MediaDataCenter.getInstance().cameraStreamManager
streamManager.setKeepAliveDecoding(true)
streamManager.putCameraStreamSurface(
    ComponentIndexType.LEFT_OR_MAIN,
    surface,
    1920,
    1080,
    ScaleType.CENTER_INSIDE
)
streamManager.addReceiveStreamListener(ComponentIndexType.LEFT_OR_MAIN, receiveStreamListener)

HB9FNO avatar Sep 28 '25 11:09 HB9FNO

Subject: DJI Mini 4 Pro – Video Stream Not Delivering Frames (onReceiveStreamData Never Triggered)

Dear DJI SDK Team,

We are experiencing a critical issue with DJI Android SDK V5.16 when working with the DJI Mini 4 Pro. Despite following the official documentation and community best practices, no video frames are ever delivered.

Problem Summary

✅ Mini 4 Pro connects successfully

✅ CameraStreamManager setup runs without errors

✅ MP4 recording files are created with valid headers (40B)

❌ onReceiveStreamData() is never triggered

❌ Files remain at 40 bytes (headers only, no video content)

Our Implementation // Video stream source setup val key = KeyTools.createKey(CameraKeys.KeyCameraVideoStreamSource) KeyManager.getInstance().setValue(key, CameraVideoStreamSource.WIDE_CAMERA, { ... }, { ... })

// Stream manager setup val streamManager = MediaDataCenter.getInstance().cameraStreamManager streamManager.setKeepAliveDecoding(true) streamManager.putCameraStreamSurface(ComponentIndexType.LEFT_OR_MAIN, surface, 1920, 1080, ScaleType.CENTER_INSIDE) streamManager.addReceiveStreamListener(ComponentIndexType.LEFT_OR_MAIN, receiveStreamListener)

What We Have Tried

All ComponentIndexType values (LEFT_OR_MAIN, RIGHT, FPV, etc.)

Different stream sources (WIDE_CAMERA, DEFAULT)

Various surface configs (1920×1080, different scale types)

setKeepAliveDecoding(true)

Correct sequence (stream source → surface → keepalive → listener)

Logs (excerpt) 09-28 12:54:36.096 I DJI-STREAM: 🚀 SDK initialized, waiting for video frames... 09-28 12:54:39.552 I DJI-STREAM: ✅ Stream listener registered for component after surface available 09-28 12:54:55.736 W DjiEsRecorder: ✅✅✅ Recording started, file ready 09-28 12:55:46.075 E DjiEsRecorder: ❌ File too small (40B) - no stream data received

Questions

Is there a special initialization sequence for Mini 4 Pro video streaming?

Are there extra steps/permissions required compared to other drones?

Does Mini 4 Pro require a different ComponentIndexType than LEFT_OR_MAIN?

Can you provide a working Mini 4 Pro streaming example?

Environment

Drone: DJI Mini 4 Pro

SDK: DJI Android SDK V5.16

Android: API 28+

Connection: USB & WiFi (both tested)

Expected: onReceiveStreamData() delivers H.264/H.265 frames. Actual: No frames delivered → MP4 files remain empty (40 bytes).

We would greatly appreciate any guidance or working example for the Mini 4 Pro.

Best regards, Daniel Bussmann, Switzerland

🇨🇳 中文版本 (for DJI China Forum)

主题: DJI Mini 4 Pro – 视频流无法获取 (onReceiveStreamData 从未触发)

尊敬的 DJI SDK 团队:

我们在使用 DJI Android SDK V5.16 开发 Mini 4 Pro 时遇到严重问题。 虽然初始化过程一切正常,但 从未收到视频帧数据。

问题总结

✅ Mini 4 Pro 连接正常

✅ CameraStreamManager 初始化成功,无报错

✅ MP4 文件已创建 (40 字节,有效头部)

❌ onReceiveStreamData() 从未触发

❌ 文件始终只有 40B,无实际视频内容

我们的实现代码 // 设置视频流源 val key = KeyTools.createKey(CameraKeys.KeyCameraVideoStreamSource) KeyManager.getInstance().setValue(key, CameraVideoStreamSource.WIDE_CAMERA, { ... }, { ... })

// 设置 CameraStreamManager val streamManager = MediaDataCenter.getInstance().cameraStreamManager streamManager.setKeepAliveDecoding(true) streamManager.putCameraStreamSurface(ComponentIndexType.LEFT_OR_MAIN, surface, 1920, 1080, ScaleType.CENTER_INSIDE) streamManager.addReceiveStreamListener(ComponentIndexType.LEFT_OR_MAIN, receiveStreamListener)

已尝试的方法

所有 ComponentIndexType (LEFT_OR_MAIN, RIGHT, FPV 等)

不同视频源 (WIDE_CAMERA, DEFAULT)

各种 Surface 参数 (1920×1080, 不同 scale type)

已调用 setKeepAliveDecoding(true)

初始化顺序正确 (视频源 → surface → keepalive → listener)

日志摘录 09-28 12:54:36.096 I DJI-STREAM: 🚀 SDK initialized, waiting for video frames... 09-28 12:54:39.552 I DJI-STREAM: ✅ Stream listener registered for component after surface available 09-28 12:54:55.736 W DjiEsRecorder: ✅✅✅ Recording started, file ready 09-28 12:55:46.075 E DjiEsRecorder: ❌ File too small (40B) - no stream data received

我们的疑问

Mini 4 Pro 是否需要特殊的初始化顺序?

是否需要额外的权限或配置?

Mini 4 Pro 是否必须使用不同的 ComponentIndexType?

官方是否有可运行的 Mini 4 Pro 视频流示例?

环境

飞机: DJI Mini 4 Pro

SDK: DJI Android SDK V5.16

Android: API 28+

连接: USB & WiFi (均已测试)

期望结果: onReceiveStreamData() 能返回 H.264/H.265 帧。 实际结果: 从未收到帧,文件只有 40 字节头部。

恳请 DJI 团队提供帮助或可运行示例。谢谢!

HB9FNO avatar Sep 28 '25 12:09 HB9FNO

Agent comment from YIGUI LIU in Zendesk ticket #158218:

Dear Developer,

1、For the connection method of Mini 4 Pro using MSDK, you should use the Type-C port on the top of the DJI RC N2 screenless remote controller to connect an Android device via cable, and run the MSDK APP on the Android device. Other remote controller models do not support MSDK, nor do they support WiFi connection. The only supported way is to connect the Android device to the remote controller via cable.

2、You can use CameraKey.KeyCameraVideoStreamSourceRange to obtain the video source type of the model. The Mini 4 Pro should have only a single lens, so CameraKey.KeyCameraVideoStreamSource can only be set to DEFAULT_CAMERA.

Similarly, the available lens list can be obtained through AvailableCameraUpdatedListener. The Mini 4 Pro should only have LEFT_OR_MAIN, so the value of ComponentIndexType can only be LEFT_OR_MAIN.

3、In the MSDK sample app => Testing Tools => Multi-Video Decoding, you can experience the functions related to obtaining video streams.

The [Begin Download Stream] at the bottom of the page is to call addReceiveStreamListener to obtain the video stream, and [Stop Download Stream] is to stop it.

Run the sample app: https://developer.dji.com/doc/mobile-sdk-tutorial/en/quick-start/run-sample.html

Tutorial on obtaining video streams: https://developer.dji.com/doc/mobile-sdk-tutorial/en/tutorials/video-stream/video-stream2.html

Sample code for obtaining video streams: https://github.com/dji-sdk/Mobile-SDK-Android-V5/blob/dev-sdk-main/SampleCode-V5/android-sdk-v5-sample/src/main/java/dji/sampleV5/aircraft/pages/CameraStreamListFragment.kt

Best Regards, DJI Innovations SDK Technical Support Team

°°°

dji-dev avatar Sep 29 '25 03:09 dji-dev

Dear DJI Developper Team,Thank you so very much for your again so kind and quick support, gladly I will going to test everything carefully!Again many thanks and best regards from Switzerland, EuropeDaniel -------- Ursprüngliche Nachricht --------Von: DJI @.> Datum: 29.09.25 05:52 (GMT+01:00) An: dji-sdk/Mobile-SDK-Android-V5 @.> Cc: HB9FNO @.>, Author @.> Betreff: Re: [dji-sdk/Mobile-SDK-Android-V5] [Bug] DJI Mini 4 Pro – onReceiveStreamData() never triggered, video stream not delivered (SDK V5.16, Android, Galaxy S25ultra) (Issue #641) dji-dev left a comment (dji-sdk/Mobile-SDK-Android-V5#641) Agent comment from YIGUI LIU in Zendesk ticket #158218:Dear Developer, 1、For the connection method of Mini 4 Pro using MSDK, you should use the Type-C port on the top of the DJI RC N2 screenless remote controller to connect an Android device via cable, and run the MSDK APP on the Android device. Other remote controller models do not support MSDK, nor do they support WiFi connection. The only supported way is to connect the Android device to the remote controller via cable. 2、You can use CameraKey.KeyCameraVideoStreamSourceRange to obtain the video source type of the model. The Mini 4 Pro should have only a single lens, so CameraKey.KeyCameraVideoStreamSource can only be set to DEFAULT_CAMERA. Similarly, the available lens list can be obtained through AvailableCameraUpdatedListener. The Mini 4 Pro should only have LEFT_OR_MAIN, so the value of ComponentIndexType can only be LEFT_OR_MAIN. 3、In the MSDK sample app => Testing Tools => Multi-Video Decoding, you can experience the functions related to obtaining video streams. The [Begin Download Stream] at the bottom of the page is to call addReceiveStreamListener to obtain the video stream, and [Stop Download Stream] is to stop it. Run the sample app: https://developer.dji.com/doc/mobile-sdk-tutorial/en/quick-start/run-sample.html Tutorial on obtaining video streams: https://developer.dji.com/doc/mobile-sdk-tutorial/en/tutorials/video-stream/video-stream2.html Sample code for obtaining video streams: https://github.com/dji-sdk/Mobile-SDK-Android-V5/blob/dev-sdk-main/SampleCode-V5/android-sdk-v5-sample/src/main/java/dji/sampleV5/aircraft/pages/CameraStreamListFragment.kt Best Regards, DJI Innovations SDK Technical Support Team °°°

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

HB9FNO avatar Sep 29 '25 10:09 HB9FNO