1

I'm using Filestack API to aupload video files to AWS S3. I would like to get the dimensions of the uploaded video file. Is it possible to get this information from Filestack?

It is returning a file object, but unfortunately it does not include dimensions:

File: {…}
​​  container: "s3container"
​​  filename: "toy_plane_liftoff.avi"
​​  handle: "tVIdjBPBR"
​​  key: "dir/toy_plane_liftoff.avi"
​​  mimetype: "video/avi"
​​originalFile: {…}
​​​ name: "toy_plane_liftoff.avi"
​​​ size: 2373088
​​​ type: "video/avi"
​​​<prototype>: {…}
​​originalPath: "toy_plane_liftoff.avi"
​​size: 2373088
​​source: "local_file_system"
​​status: "Stored"
​​uploadId: "9824218d148"
​​url: "https://cdn.filestackcontent.com/tVIdjBPBR"

Is there any workaround?

Tomasz Cz.
  • 315
  • 5
  • 22

1 Answers1

0

It seems that you have it twice in the response according to filestack documentation: https://www.filestack.com/docs/concepts/pickers/web/

size: Size of the uploaded file.

and original file has it as well

originalFile: Object representing original file, its name, type and size.

Your files size should be 2373088

V. Sambor
  • 12,361
  • 6
  • 46
  • 65
  • Thanks! But I need dimensions i.e. width x height in pixels. – Tomasz Cz. Apr 23 '19 at 20:09
  • 1
    Sorry I didn't understood you well. Hmmm I'm afraid it is not possible this way; I mean File instance does not expose contents of underlying file content. What you will have to do is maybe to use a video element of html5 and then retrieve video information with `loadedmetadata`... check this question https://stackoverflow.com/questions/4129102/html5-video-dimensions/4129579#4129579 – V. Sambor Apr 23 '19 at 20:36