Bad request with probe function

Hi there, I wonder what I’m doing wrong.
I’m trying to call a probe function to inspect a video (to get vid duration, width and height), and all I’m getting back, is this:
{“success”:true,“message”:“bad request”,“response”:“Media file could not be found or was invalid.”}

Not sure why, since the video does exist and is publicly available:

I’ve double-checked that I’m encoding it correctly, via publicly available online URL encoders.

GET request I’m making is a simple get request to this URL:
https://api.shotstack.io/stage/probe/https%3A%2F%2Fwebispark.blob.core.windows.net%2Ftrip-itinerary-videos%2Faad2190c-99f6-4db8-bf82-910c814d7943.mp4
OR
** /v1/probe/ **

while passing the appropriate “x-api-key” header.

Thanks for help!
Stef

Hey @stefan,

It looks like you’re doing everything right, and can reproduce the error. I checked the logs and it appears there’s an issue where the service is timing out because of a long response time.

This is likely to be caused because the server on which the video is hosted isn’t very responsive. I tried both the file shared and the same file made available via S3 (see below). The S3 file can be probed successfully.

We’ll look at whether we can reduce the timeout, but what I would recommend for now:

  1. Host files via Shotstack Serve if built via Shotstack
  2. Host on responsive data store such as S3, Google Cloud Storage or equivalent

Server Response Times

https://webispark.blob.core.windows.net

Lookup Time:		0.175117
Connect Time:		0.429665
Pre-transfer Time:	1.002545
Start-transfer Time:	1.318936

Total Time:		11.632598

S3

Lookup Time:		0.043057
Connect Time:		0.074452
Pre-transfer Time:	0.154380
Start-transfer Time:	0.230289

Total Time:		0.608612

Thanks @dazzatron , good to know, however, also extremely annoying, because when I load the video directly in browser, it takes in total roughly 1second (tried a few times) - nowhere close to your 11 seconds! I’m not quite getting it why… Video is pretty small: 3.82 MB, Finish: 1.68 s, DOMContentLoaded: 539 ms, load: 1.01 s
It’s hosted in Microsoft Azure blob storage that we’re not really planning to ditch. I’ll investigate a bit more about ‘responsive’ storage. Thanks!

Hi @dazzatron it looks like that you might be getting such a long response because I believe you’re based in Australia, and our server and Azure storage is optimised for usage in UK.
The example you’ve shown on a temp S3 URL, looks like it’s because it’s hosted also in Australia, which could explain the quick response.
So, if you could please increase the timeout limit that’d be great, and I can then test it again.
In the meantime, we’re working on another solution that may spread the MS Azure blob content via their own CDN around the world, potentially allowing for quicker web request response from Australia too.
Thanks!
Stef

You are right. The response times would be skewed because of where I did the test. Good pickup.

I’m a bit mystified why this is occuring to your file only though. We have quite a few users who would be using storage in different geographies and haven’t seen this issue come up.

I’ll add in a ticket to review the timeout and ask someone to investigate a little deeper.

The probe endpoint needs to download enough of the video file so that it can read the embedded meta data. That might be different from how a browser downloads the data to start streaming which is why it might appear faster in a browser.

We will look at increasing the timeout to fix this.