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

Setting custom directory and file name for video recording.

Open HEEJUN-SHIN opened this issue 8 months ago • 4 comments

Hello, I want to set the custom directory name and file name for video recording.

In my implementation,

// Create a CustomExpandFolderNameSettings object
 CustomExpandNameSettings customExpandFolderNameSettings = new CustomExpandNameSettings();
 customExpandFolderNameSettings.setEncodingType(EnCodingType.UTF8);
 customExpandFolderNameSettings.setRelativePosition(RelativePosition.POSITION_END);
 customExpandFolderNameSettings.setPriority(0);
 customExpandFolderNameSettings.setForceCreateFolder(true);
 customExpandFolderNameSettings.setCustomContent(folderName);

 // Create a CustomExpandFileNameSettings object
 CustomExpandNameSettings customExpandFileNameSettings = new CustomExpandNameSettings();
 customExpandFileNameSettings.setEncodingType(EnCodingType.UTF8);
 customExpandFileNameSettings.setRelativePosition(RelativePosition.POSITION_END);
 customExpandFileNameSettings.setPriority(0);
 customExpandFileNameSettings.setForceCreateFolder(true);
 customExpandFileNameSettings.setCustomContent(fileName);


KeyManager.getInstance().setValue(KeyTools.createCameraKey(CameraKey.KeyCustomExpandDirectoryNameSettings, ComponentIndexType.LEFT_OR_MAIN, CameraLensType.CAMERA_LENS_ZOOM), customExpandFolderNameSettings, new CommonCallbacks.CompletionCallback() {
             @Override
             public void onSuccess() {
                 Log.e(TAG, "Folder name set successfully");

                 KeyManager.getInstance().setValue(KeyTools.createKey(CameraKey.KeyCustomExpandDirectoryNameSettings), customExpandFileNameSettings, new CommonCallbacks.CompletionCallback() {
                     @Override
                     public void onSuccess() {
                         // Extension name set successfully, now start recording
                         Log.e(TAG, "File name set successfully");
                         RecordVideo(sendResponses);
                     }

                     @Override
                     public void onFailure(@NonNull IDJIError error) {
                         // Handle the error
                         Log.e(TAG, "Failed to set file name: " + error);
                     }
                 });

             }

             @Override
             public void onFailure(@NonNull IDJIError error) {
                 // Handle the error
                 Log.e(TAG, "Failed to set folder name: " + error);
             }
         });

However "KeyCustomExpandDirectoryNameSettings" and "KeyCustomExpandDirectoryNameSettings" throws an error,

ErrorImp{errorType='CORE', errorCode='REQUEST_HANDLER_NOT_FOUND', innerCode='CAMERA.CustomExpandDirectoryNameSettings:-1', description='null', hint='error code = -1'}

This issue might be duplicate of https://github.com/dji-sdk/Mobile-SDK-Android-V5/issues/497 , but I could not see further response from developers.


I am using Mini3Pro with MSDK v5.12. ( aircraft firmware=01.00.0900) (rc-n1 firmware == 04.14.0700)

Thank you.

HEEJUN-SHIN avatar Apr 11 '25 02:04 HEEJUN-SHIN

Agent comment from YIGUI LIU in Zendesk ticket #139445:

Dear Developer,

I'm very sorry. After confirming with the R & D team, it's found that the Mini 3 and Mini 3 Pro models do not support customizing folders or photo suffixes.

Therefore, calling "KeyCustomExpandDirectoryNameSettings" and "KeyCustomExpandDirectoryNameSettings" will result in a "REQUEST_HANDLER_NOT_FOUND" error. Thank you for your understanding and support.

Best Regards, DJI Innovations SDK Technical Support Team

°°°

dji-dev avatar Apr 11 '25 03:04 dji-dev

I see. If so, is there any way that I can store some meta-information inside the video file?

HEEJUN-SHIN avatar Apr 12 '25 05:04 HEEJUN-SHIN

Agent comment from YIGUI LIU in Zendesk ticket #139445:

Dear Developer,

I'm sorry. Currently, there is no metadata available for parsing in either the real-time video stream or the recorded video, and it is not supported for developers to add metadata.

Best Regards, DJI Innovations SDK Technical Support Team

°°°

dji-dev avatar Apr 14 '25 02:04 dji-dev

@dji-dev

Is it possible, that KeyCustomExpandDirectoryNameSettings does not work for drone model M30_SERIES.M30T, too? I do experience the same error message:

REQUEST_HANDLER_NOT_FOUND: Could not set KeyCustomExpandDirectoryNameSettings to FR-0aN1-TSPombed-20240916-1321. error code = -1.

jgauchel avatar Sep 04 '25 10:09 jgauchel