2

We are storing some video files as binary in NoSQl database, NoSQL database exposes Rest API to read data from database. We are able to receive the binary data (with no file extension) from RestAPI, but web browser starts to download the file instead of playing it in the browser.

I want to play the binary data as video on web browser instead of downloading.

nilesh1212
  • 1,561
  • 2
  • 26
  • 60
  • With Firefox browser it is at least prompting to open or save file if Rest API content is `application/octet-stream` unlike other browsers – nilesh1212 Dec 22 '16 at 10:31
  • Do you have a short example of this binary stream? Download the file anyways (as extension **.dat**) up to a few megabytes and put in online link... Is the video in MP4 format? Are you putting link in video tag? **Show us code** of what you're doing for playback, so we can advise you... – VC.One Dec 23 '16 at 03:45
  • @VC.One So at a higher level, we storing media files in HBase and HBase offer some RestAPI to get values from table, We store media files as binary in HBase (videos are in mp4). When we hit RestAPI we receive content as application/octet-stream. So the idea is to make this work smoothly on browser without any manual intervention. I have raised one more question on this for more details please have a look. http://stackoverflow.com/questions/41137041/image-video-on-hbase-and-made-available-via-some-sort-of-http-url-for-access – nilesh1212 Dec 23 '16 at 06:59
  • _"When we hit RestAPI..."_ How? Must be a URL, so what happens when you use URL in a video tag? **Show a testable video link** if unsure what to do (upload a 30-sec trailer and give link to reproduce your issue)... Also do the bytes in the octet stream begin with `00 00 00 18 66 74 79 70` (for a valid MP4)? Asking to be sure data isn't wrapped within bytes of some other container like **.ts** or of protocol like **Rtmp** or **RTP**... Last resort if PHP is an option, then just `echo` the result of `file_get_contents(URL-to-video-bytes)` and put that PHP file's own URL as source in video tag... – VC.One Dec 23 '16 at 10:16
  • Hi nilesh did you got any answer for this question ? – KuldeeP ChoudharY Sep 27 '17 at 09:59
  • @KuldeePChoudharY , to some extend yes.. I have used HDFS for storing Videos and Image. I am using HBase to store all the hdfs path of those images and videos, after this you can use HBase Out of the box rest api to get videos and Images, you can use the same rest urls in your web application too. – nilesh1212 Sep 27 '17 at 13:27
  • Is is possible ? https://stackoverflow.com/questions/46451494/videos-streaming-from-external-sources-through-our-application – KuldeeP ChoudharY Sep 27 '17 at 16:38
  • @KuldeePChoudharY No I have not implemented media streaming use case, But what I understood from my experience is HBase rest api make your videos and images played on browser as stream , so on your web app end you should able to render and play media files.. – nilesh1212 Sep 28 '17 at 06:34

0 Answers0