1

I have users submitting huge (2+GB) files in .mov format to server, the only thing I need to know about that files is few meta-tags (the video itself we upload to youtube from client side).

Obviously I want to be able just parse those meta-tags without uploading the full file to server, moreover - to be able not to initiate uploading video to youtube if metatags is empty or invalid.

I see the following solution of problem:

  • User selects a file

  • JS slices from the file first 128kb bytes where metadata is located

  • JS Submits those bytes to server and server parses its OR JS itself parses it

Since JS have Blob.prototype.slice method of Blob type I use next code:

filePart = file.slice(0, 131072); // first 128kb

Problem is in the last step because I don't know how to parse those sliced bytes.

  • What info from these metadata do you want to find? IIRC metadatas (moov atoms?) are not forced to be placed at any particular position in the file. According to this [Q/A](https://stackoverflow.com/questions/21355316/getting-metadata-for-mov-video) creation date is quite easy. But here you are actually asking us to write a full parser for you, which is a bit of a broad question. – Kaiido Jun 06 '18 at 14:06
  • I need creation_date parameter. Thank you for pointing me out to the 'moov' atom. I read some info and, as I understand, to take the 'moov' atom, I need to extract existed atoms from file. I have spent day trying to achieve it but all existed implementations can't work with file of huge size. They all expect ArrayBuffer as input argument but I can't convert Blob to ArrayBuffer because it crashes the browser. Next solution that comes to mind is to split File on parts and try to parse atoms from that parts. But how to understand when part of atom is started and what length it have? – Dmitry Likhovoi Jun 07 '18 at 12:27

0 Answers0