Return code of pullMediaFileListFromCamera

Completed

Comments

7 comments

  • DJI Developer Support
    1. What does it mean when this function returns -3 or -7 Errorcode? -->-3 indicates timeout. -7 is a non-specific error, can you provide details about the error scenario? 2. When there are more than 1000 data in the SD card, I cannot get a list of all data with pullMediaFileListFromCamera(-1, -1), I can only get about 400 data. Why is this? --》 What type of aircraft are you using? In fact, drones may not support obtaining too many files at once. You can try setting the number of files to be obtained for this time using PullMediaFileListParam.Count, and then retrieve them multiple times. Also, is there a way to get only the list of shooting folders, not the list of files? -->You can configure the PullMediaFileListParam to only retrieve photos. Thank you.
    0
    Comment actions Permalink
  • YutaShimoe

    Thank you for your reply.

    >What type of aircraft are you using? 
    I use Mavic3 Enterprise.

    I understood that if there are many files, it is sufficient to call the API multiple times.
    Also, thanks for the information about PullMediaFileListParam.

    Best Regards

    0
    Comment actions Permalink
  • DJI Developer Support
    You can try PullMediaFileListParam first to see if it can help you. You can keep asking us if you have questions.
    0
    Comment actions Permalink
  • YutaShimoe

    Sorry for the late reply.
    I have tried PullMediaFileListParam and it does not work.
    I have also found a few additional things.

    1. in the V5.8.0 sample app with pullMediaFileListFromCamera.The larger the MediaFileIndex, the more likely it is to time out. Also, specifying filter(MediaFileFilter.PHOTO) in PullMediaFileListParam did not improve the problem.

    2. There is a bug in the album function of DJI Pilot2, when there are more than 3000 images in a folder, it is not displayed.


    From the above, am I right in understanding that DJI SDK is not designed to handle a large amount of data? If so, how many images are guaranteed to work?

    0
    Comment actions Permalink
  • DJI Developer Support
    Could you please provide a detailed description of your testing method? Currently, I am using PullMediaFileListParam on the Mavic 3 Enterprise series without any issues. Retrieving 3000 photos at once is a relatively large quantity, and paging through them helps avoid retrieval failures caused by a large amount of data. Below is an example. //mediaFileIndex -- MediaFile.index//count -- Number of photos pulled this timeMediaDataCenter.getInstance().mediaManager.pullMediaFileListFromCamera( PullMediaFileListParam.Builder().mediaFileIndex(mediaFileIndex).count(count).build(), object : CommonCallbacks.CompletionCallback { override fun onSuccess() { ToastUtils.showToast("Spend time:${(System.currentTimeMillis() - currentTime) / 1000}s") LogUtils.i(logTag, "fetch success") } override fun onFailure(error: IDJIError) { LogUtils.e(logTag, "fetch failed$error") } }) Suppose your camera only stores 4 photos, so there are four MediaFiles storing their information, and their index attributes are 111, 222, 333, 444 respectively. Generally, the later generated photos will have larger indexes, and internally the SDK arranges them in descending order, so the storage order of these four photos in the MediaFileList is 444, 333, 222, 111. If I want to retrieve the two photos starting from 333, then I need to set the mediaFileIndex to 333 and count to 3. Thank you.
    0
    Comment actions Permalink
  • YutaShimoe

    Sorry for late response

    I have since been testing with a few images, but the behavior is unstable, sometimes succeeding, sometimes failing... I have found some bugs regarding the API of the DJI SDK, which I will report in another post

    Best Regards

     

    0
    Comment actions Permalink
  • DJI Developer Support
    I will wait for you to upload the issues you have found.
    0
    Comment actions Permalink

Please sign in to leave a comment.