πŸŽ‰ New feature: Error reason codes for errored videos

You might have previously seen a video uploaded to Stream display Error in the dashboard instead of Ready. This might happen for a number of reasons such as uploading a non-video file (a .pdf file or an image) to Stream or when a uploaded video file exceeds maxDurationSeconds specified during Direct Creator Upload creation.

It might be frustrating for customers who run video platforms with Stream to see a video in the Error state because it’s very hard to pinpoint why the upload errored and what the next steps to resolve the issue is.

If the file is not a video, platforms should prompt the creator to revisit the file they’ve chosen, while if the video is too long in duration platforms should ask the creator to upload a shorter video.

Now with the new error reason codes in the Stream API you can show relevant next steps to your users to fix the issue with their failed upload!

Error codes include:

  • ERR_NON_VIDEO (upload is not a video)
  • ERR_DURATION_EXCEED_CONSTRAINT (video duration exceeds constraints defined in the direct creator upload)
  • ERR_FETCH_ORIGIN_ERROR (downloading the video from URL failed)
  • ERR_MALFORMED_VIDEO (video is a valid file but contains corrupt data that can’t be recovered)
  • ERR_DURATION_TOO_SHORT (video duration shorter than 0.1 seconds)
  • If Stream can’t automatically determine why the video errored, the ERR_UNKNOWN code will be used.

These error codes account for a majority of the videos in Error state across all customers of Stream and we will continue to add new ones over time to help creators get their videos online faster.

8 Likes

Hi team! This is hugely helpful, working on integrating with this today.

Are these error codes retrievable present as soon as status.state is "error", or do they take a moment to populate?

1 Like

Great question! The system works in this order when a video is set to error:

  1. status.state is set to "error"
  2. status.errorReasonCode and status.ErrorReasonText set
  3. Webhook sent (if enabled)

The delay between step 1 and 2 is at most 200ms (but average is about 5ms). It is technically possible for you to see the codes not populated yet when you make a API request but it is very unlikely.

1 Like