0

This question is related to my previous question Trying to stream telegram media and playing it in a web page.

I am trying to stream Telegram videos on a website using this library. I found out that most of the videos have the MOOV atom at the end, so they cannot be streamed until completely downloaded.

I wanted to know if I can create or move the MOOV atom of the mp4 file while streaming it as I cannot download the file completely and then do the same. Or if there is any other type of HTTP metadata that can be sent along the file to compensate for the MOOV atom.

Prashant Sengar
  • 506
  • 1
  • 7
  • 24
  • Can you modify the file on disk to move the moov atom once instead of every-time a user downloads? Or can you not modify the file? – szatmary Feb 05 '20 at 16:53
  • @szatmary no I can't do that. As I said, I am not downloading the file on my disk, I am just streaming it directly from Telegram's server. So can't do anything on disk – Prashant Sengar Feb 07 '20 at 07:29
  • Then you must download the moov from the end of the file via a byte range request , parse it, rewrite all the data offset values, send the new virtual moov the the client, then stream through the mdat. To the best of my knowledge there are no existing tools to do that, so you probably need to write it yourself. – szatmary Feb 07 '20 at 07:33
  • @szatmary can I get some resources for my help? – Prashant Sengar Feb 07 '20 at 08:23
  • Can I create my own moov atom and then send it in the response to the request? Something like some metadata? – Prashant Sengar Feb 07 '20 at 08:24
  • Yes, Iso 14496-12 – szatmary Feb 07 '20 at 08:25
  • Thanks :) I am not able to get exactly the format of the atom. Is there some specific way to create the moov atom to send it via HTML responses (any link will be greatly appreciated) – Prashant Sengar Feb 07 '20 at 08:32
  • The format is documented in iOS 14496-12 – szatmary Feb 07 '20 at 15:32

0 Answers0