EXCEEDED_INPUT_TIME_LIMIT while taking a photo

评论

14 条评论

  • DJI Developer Support
    Could you provide us with the MediaVM.kt file you are using? Here is an upload link:https://pan-sec.djicorp.com/s/QTs4wf74pMnAaAj The password for it is dji123. Thank you!
    0
    评论操作 固定链接
  • stefano.minardi

    I have uploaded the file at the link you provided. It is just the MediaVM.kt file of your example here anyway: https://github.com/dji-sdk/Mobile-SDK-Android-V5. 

    0
    评论操作 固定链接
  • yating.liao

    Thank you for confirming. I have used the code you provided, but I did not reproduce the same error on the DJI Mini 3 Pro. Do you perform other actions while taking photos? I suspect that other actions may be affecting the photo-taking process.

    0
    评论操作 固定链接
  • stefano.minardi

    I am calling the function rotateGimbalDownAndTakePicture() as the only action on a button setOnClickListener just like you did in your test.

    I have created the button on the file frag_virtual_stick_page.xml for using on the file VirtualStickFragment.kt. I have also added import dji.sampleV5.aircraft.models.MediaVM directive at the top of VirtualStickFragment.kt in order to be able to intstantiate MediaVM() from there.

    Aside from that, after many attempts with taking photos, I started to receive persistently the  CANNOT_START_TASK_VLOTAGE_ALARM error. Could it be due to drone overheating or some other hardware issues ?

    0
    评论操作 固定链接
  • DJI Developer Support
    I suggest placing mediaVM.init() in the onViewCreated section of the fragment, and then calling mediaVM.destroy() when the fragment is destroyed. I have tried delaying the execution of takePhoto by 2 seconds, which was successful. However, the file list status will change to updating, so at this point, you will not be able to directly access the file index of the latest generated photo.
    0
    评论操作 固定链接
  • stefano.minardi

    I am now able to take pictures from my function on VirtualStickFragment.kt without errors. I have just moved the instantiation outside of the function:

    class VirtualStickFragment : DJIFragment() {
    private val mediaVM = MediaVM()
     
    The problem is that, similarly to what you were saying, the code that I now have within the function returns always "file count:0". So I don't have access to the picture I have just taken.
     
    // Initialize MediaVM
    mediaVM.init()
    //Take photo
    mediaVM.takePhoto(object : CommonCallbacks.CompletionCallback {
    override fun onSuccess() {
    // Get media file list
    val mediaFiles = mediaVM.getMediaFileList()
    ToastUtils.showToast("file count:"+mediaFiles.count().toString())
    }
    override fun onFailure(error: IDJIError) {
    ToastUtils.showToast("takePhoto:${error.errorCode()}")
    }
    })
    mediaVM.destroy()
     
    My aim is downloading the picture as soon as possible, even asyncronously, when it is saved in the internal memory of the drone.
    Is there a listener I can set so that I can proceed with my operations when the 'new file saved' event is generated ? Thank you.
    0
    评论操作 固定链接
  • stefano.minardi

    PS. I have tested the code for showing the media files count after taking a picture on MediaFragment.kt as well and the result was still "file count:0"

    btn_take_photo.setOnClickListener {
    mediaVM.takePhoto(object : CommonCallbacks.CompletionCallback {
    override fun onSuccess() {
    val mediaFiles = mediaVM.getMediaFileList()
    ToastUtils.showToast("file count:"+mediaFiles.count().toString())
    //ToastUtils.showToast("take photo success")
    }
    override fun onFailure(error: IDJIError) {
    ToastUtils.showToast("take photo failed")
    }
    })
    }
     
    UPDATE. I have noticed that mediaFiles.count() is populated and returns the right number of photos in the drone's memory after a click on the button 'fetch media file list' on the Media page of the sample app.
    There are in summary, as far as the Media page is concerned, these two cases:
    1) if I click directly on the 'take photo'  I see 'file count:0'
    2) If I click on the 'fetch media file list' button and then I click on the 'take photo' button I see 'file count: 36' (if there are 36 photos in the drone's internal memory
    0
    评论操作 固定链接
  • stefano.minardi

    I have verified that if I fetch the media file list programmatically within OnViewCreated on VirtualStickFragment.kt, I can at least read the index of the latest picture saved on the drone's memory from my function:

    class VirtualStickFragment : DJIFragment() {
    [...]
    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
    [...]
    // Initialize MediaVM
    mediaVM.init()
    //Set the storage
    mediaVM.setStorage(CameraStorageLocation.INTERNAL)
    //Fetch media file list
    mediaVM.pullMediaFileListFromCamera(-1, -1)
     
    fun rotateGimbalDownAndTakePicture() {
    [...]
    var mediaFiles = mediaVM.getMediaFileList()
    //Index of the latest picture saved on the drone
    var indexLatestPicture =mediaFiles.first().fileIndex
    ToastUtils.showToast("indexLatestPicture:"+indexLatestPicture)
     
    Of course mediaFiles is not updated when new pictures are taken with my function.
    Is there a way of  updating it correctly every time a new photo is taken ?
    0
    评论操作 固定链接
  • DJI Developer Support
    If you want to immediately get the fileIndex of the latest photo after taking a photo, this may not be achievable. The success of `takephoto` indicates that the SDK has requested the aircraft to take a photo successfully, but it does not necessarily mean that the aircraft has successfully taken the photo. Therefore, often when you receive a successful photo callback, the photo has not been generated yet. For newly generated photos, you can consider using KeyNewlyGeneratedMediaFile to monitor information about newly generated photos. However, it is important to note that KeyNewlyGeneratedMediaFile may also experience data loss. Therefore, I recommend that you check which photos have already been downloaded when downloading photos.
    0
    评论操作 固定链接
  • stefano.minardi

    I can't find KeyNewlyGeneratedMediaFile in the API reference for MSDK 5.8. Could you post a link to it ? Thank you. 

    0
    评论操作 固定链接
  • stefano.minardi

    Hello. I still get the EXCEEDED_INPUT_TIME_LIMIT sometimes while I take a photo. 

    Now I am starting to receive systematically the message CANNOT_START_TASK_ON_WEAK_GPS, when I take a photo. 

    Are there explanations and workarounds for these errors ? Thank you.

    0
    评论操作 固定链接
  • stefano.minardi

    For the records: the CANNOT_START_TASK_ON_WEAK_GPS error went away once I made again the process of stabilization/calibration through the official DJI app. 

    That error message is very misleading though.

    0
    评论操作 固定链接
  • DJI Developer Support
    When you encounter the errors "EXCEEDED_INPUT_TIME_LIMIT" and "CANNOT_START_TASK_ON_WEAK_GPS," does the device health information indicate any abnormalities? I would appreciate receiving details of your issue scenario for us to correct the misleading information.
    0
    评论操作 固定链接

请先登录再写评论。