Decoding Error using the Cloudflare Stream API to upload captions

Hi guys!
I’ve been using Cloudflare Stream for a while now and for captions I’ve been using nested inside the . This doesn’t seem to work anymore, and now I saw in the docs a method to upload a .vtt file for videos - sounds good to me, but my PUT request is always failing on “Decoding Error”.

The request is this, xx replacing specifics and such:
curl --location --request PUT ‘https://api.cloudflare.com/client/v4/accounts/xx/stream/xx/captions/se’ \

–header ‘X-Auth-Key: xx’ \

–header ‘X-Auth-Email: xx’ \

–form ‘[email protected]/xx/Downloads/Swedish.vtt’

response:
{
“result”: null,
“success”: false,
“errors”: [
{
“code”: 10004,
“message”: “Decoding Error”
}
],
“messages”: null
}

I tried this with a couple of files, both valid .vtt files already used for this. What could be the issue?

1 Like

It looks like we were not able to read your webVTT file.
It is very short? Is it possible that you share the .vtt file so we can debug/replicate together?

Also you seem to have an unfinished sentence above: “and for captions I’ve been using nested inside the .” :slight_smile:

Hey, the cutoff sentence was the forum system ignoring HTML tags - I meant I was using the ‘track’ tag inside the ‘stream’ tag.

Here’s the file, downloaded as-is from the previous video hosting platform:
http://cdn.dolly.media/trans/Subtitles/280169320/Swedish.vtt

Ah! Yes we never officially supported tags because there were compatibility problems across browsers and we could not give the viewers control over the language of their choice in the UI but the tags worked anyways on some browsers.

I can replicate your webvtt upload issue. Checking it out right now!

1 Like

Thanks a lot! I’m waiting to hear from you.

Hey! Thanks for your patience. We found the root cause for this issue.

After receiving the uploaded WebVTT files, we parse them uploaded to verify they comply with the WebVTT spec. This allows us to make sure we can display the caption files uploaded without problem.

In this case, the WebVTT file you uploaded was failing checks in an unexpected way. After an investigation we found that the the double space between the cue timings and cue settings was causing the failures even though it is perfectly fine to have double spaces here.

It will take us a few weeks to permanently fix this issue for everyone so a temporary workaround could be to convert the double spaces to a single space before uploading.

Thanks for posting here and helping improve the service for everyone!

2 Likes

Hi! I am experiencing this error as well. I tried with progressively smaller and smaller WebVTT files (which I checked with an online validator), but was never able to get any response other than the 10004 Decoding Error. The last file I tried was just:

WEBVTT

00:00:00.000 --> 00:00:02.000
Hello

But I still got the same error. Is there something else I might be doing wrong?

Thank you!

Thanks so much for the response and investigation! Unfortunately, removing double spaces did not fix the issue for me, and the alternative vtt files I have tried didn’t have any double spaces to begin with. Could there be something else I’m missing?

This is an annoying problem, I apologize for the time lost here going back and forth. I just went over the application logs and it seems like only four people have encountered this issue so far.

I was able to replicate this also when the file uses a character encoding other than UTF-8. Could that be it?

I’m currently submitting a code change to the rest of the team that fixes the UTF-8 only requirement. Will post here when both double-space issue and the UTF-8 requirement is both fixed.

Hey Renan,

I appreciate your efforts, re-saving the file as UTF-8 (and also changing the style of line endings from Linux to Windows) has caused no change on my end.

Thanks for the efforts Renan - I verified that my file is encoded as UTF-8, but received the same error :-/

Hi Renan,
I’m facing the same issue here. do you have any update on it please?.