Video Inference API returning "decode error" on some videos

I’ve been trying out the video inferencing API with relative success, however some videos return a status_info of decode error and I can’t seem to figure out why. The videos seem to be ok as they are an MP4, am I missing something with the video, i.e. metadata, etc.

Here’s a sample request:

      "models": [
          "model_id": "log-timber",
          "model_version": "4",
          "inference_type": "object-detection"
      "infer_fps": 30,
      "input_url": "<video url here>"

Response after polling:

      "_id": "830564ad-270c-4bb2-9e20-bd373b405413",
      "created_at": "Mon, 18 Mar 2024 10:06:56 GMT",
      "crop_area": "full",
      "infer_fps": 30,
      "infer_models": [
          "api_key": "",
          "infer_errors": 0,
          "infer_success": 0,
          "inference_type": "object-detection",
          "model_id": "log-timber",
          "model_version": 4
      "memo": "",
      "metadata": "",
      "pubsub_message_id": "",
      "retries": 1,
      "signed_url": "",
      "status": 2,
      "status_info": "decode error",
      "updated_at": "Mon, 18 Mar 2024 10:07:51 GMT",
      "webhook_url": ""

There’s no extra error messages from the response but it would be nice if it did have it.

The status_info of “decode error” suggests that there might be an issue with the video file itself. While the file extension might be MP4, there could be issues with the video encoding, metadata, or the file might be corrupted.

Roboflow’s video inference currently supports the following video file-extensions: mp4, MP4, avi, AVI, mkv, MKV, webm, WEBM [1]. If your video is in one of these formats and you’re still encountering issues, it might be worth checking if the video plays correctly in a video player. If it doesn’t, there might be an issue with the video file itself.

If the video plays correctly, the issue might be with the video’s metadata or encoding. Unfortunately, the provided knowledge sources do not provide information on how to handle this specific issue.

It’s also worth noting that the status of the job is indicated by the status key in the returned JSON. A status of 0 indicates success, 1 indicates that the job processing is not complete, and any higher values indicate job failure [2]. In your case, a status of 2 indicates a job failure, which aligns with the “decode error” message.

If you continue to experience issues, I would recommend reaching out to Roboflow’s support for further assistance.

Hi! I’m Roboflow’s AI powered bot. This is an automated response powered using AI with knowledge from our docs, blog, and forum. If this solves your issue, please mark it as the solution using the checkbox icon. If this doesn’t solve your issue, please follow up with what you’ve tried/why, and the community will continue to chime in as usual.

  1. (Video Inference | Roboflow Docs) ↩︎

  2. (API Reference | Roboflow Docs) ↩︎

I can play the video normally and I have other videos of the same setup that also plays as intended. It would be nice to know what encoding the API needs.

It seems like the API might not like videos using a H.265 / HEVC codec.

Hey @clarencedalanjr

Would it be possible to share the video that you are trying to infer with? If so, could you do so?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.