Google App Engine cannot serve some of mp4 files - google-app-engine

I uploaded 2 .mp4 videointo blobstore.
When I served 311.0KB mp4 video, there is no problem with it. I can play the video
But when I served 3.3MB mp4 video, video is not loaded. So I went to admin console, and click Blob Viewer menu. When I clicked to see 3.3MB video, it doesn't load as well. Why?
I am using free version of GAE.

After some time I found out that using the X-AppEngine-BlobKey and X-AppEngine-BlobRange is working fine. I use Django and here is part of the code that I use, it should give you the idea how it works
response = HttpResponse()
response['Accept-Ranges'] = 'bytes'
response['Content-Type'] = content_type
response['X-AppEngine-BlobKey'] = blob_key
if 'HTTP_RANGE' in request.META:
response['X-AppEngine-BlobRange'] = request.META['HTTP_RANGE']
return response
Please note that X-AppEngine-BlobRange is set to exactly the same value as range header in request. GAE documentation for that case might be a little bit confusing as the examples show values like "0-499" when it should be set to "bytes=0-499".

Related

Convert video file to byte array and save within app

I am trying save some video in react native app privately. So that i can download videos within app and can watch within app after download. So i am not able to get it how can i do this. Let me know if anybody have resolution for this approach. i was checking that we can convert files into byte than can store within react native app. again then convert into video and can watch it within app. Let me know if this can be done by anyone. Thanks
<Video source={{uri: "background"}}
ref={(ref) => {
this.player = ref
}}
onBuffer={this.onBuffer}
onError={this.videoError}
style={styles.backgroundVideo} />
Watch this video
You can watch the above video. Anybody have a idea that how mx doing this thing. I want to do same. Download videos and save and will be private and play in my app.
For downloading any file like video,img ..
there are two best known libraries for downloading files
https://www.npmjs.com/package/react-native-fs
https://www.npmjs.com/package/react-native-fetch-blob
Now you can follow their documentation to download files like Videos,images or whatever you want to your user's phone.
For the part that you dont want it to be available to user via gallery.
For this you can use react-native-fetchblob as it has builtin intent actions and views. You can download a video file with any random name like 1234CACHE any random name without any extension to it, specially dont give it extension like video.mp4 because gallery detects .mp4 files so dont give it any extension and the file won't be available in any gallery.
Now how to hide the file? react-native-fetch-blob allow us to save files into directories that are not publicly available i mean user cannot reach those directory and these directories are used only for saving App's data so you can save your video file in one of these directories.
Now after completing your download, You can open your file with the Intent.
Example:
const VIDEO_PATH = res.path() //the path where your downloaded video is saved, you will actually receive this in the response of download function.
const MIME_TYPE = "video/mp4"
//Now finally call the intent with video mime so the video will be opened in user's media player, or if you want your own media player you can use any library for that.
android.actionViewIntent(VIDEO_PATH , MIME_TYPE)
you can use https://github.com/RonRadtke/react-native-blob-util to download any remote files

How to use an mp4 video stored on Dropbox within an Alexa Skill that uses an ALP document

My goal is to get an mp4 video i placed in dropbox to work within my Alexa Skill in which I am using an ALP document to include multimedia support. I am not interested in using Amazon S3 storage.
I was following a tutorial by dabbelab.
I could get their video to work: https://player.vimeo.com/external/373749691.hd.mp4?s=e43554c91fc796a20f051dcb8b45a74d035a6daa&profile_id=174
I could not get an mp4 video in my drop box to work:
https://www.dropbox.com/s/i8g0j8ghzprqyp3/Baby%20Cats%20-%20Cute%20and%20Funny%20Baby%20Cat%20Videos%20Compilation.mp4?dl=0
From what I can determine through Amazon's doc, I should be able to use any mp4 as long as I am using https. It is unclear to me what it is I am missing. Any advice greatly appreciated. Thank you.
First thing I'm seeing is the link. It ends with "dl=0." That link opens a dropbox page for playing the video, not the video itself.
Change that to "raw=1" and you should get the video itself like APL needs, not an HTML page.

How to store images in firebase using URL from cloud storage service?

Hi I am developing an ionic app using firebase as my database.
I read this question.
I understand it and have a more specific question.
I uploaded an image on amazon s3, imgur and filestack, and tried all three in firebase using data:url/<the url of image> and data:image/jpeg;<url of image>.
Am I typing something wrong into firebase?
The image does not come up. I do not want to write code in the app to upload the image etc, I just simply want an image to display on the app beside some data corresponding to an item in my firebase database.
I have read about base64, do I have to use it in this case?
(Optional) Perhaps If you could expand on the steps of doing this:
"You can use a filepicker to get the image file. Then you can host the image however you want, i prefer amazon s3. Once the image is hosted you can display the image using the url generated for the image."
I don't have much ionic experience, but why not just save the direct path to the image url and not include the data:url/ portion.
Simply store the url in firebase and then when it's retrieved inject it into your img src.

HTML5 video tag. Some .MP4 videos don't work in Chrome

We're making our webapp with ASP.NET MVC 5, and we're facing to an strange behaviour while playing our mp4 videos (codec h264 all of them) between web browsers.
These videos are not stored in filesystem, they're stored like BLOBs inside a table of our SQL Server.
The way we link our BLOBs with the HTML5 video tag is with a source that points to an Action that returns a FileStreamResult with ContentType header set properly.
Firefox and IE can play them, but Chrome can't with all. When I click on the 'Play' button, the videoplayer stills showing a black screen. When this happens and play button is clicked, network tab of the browser shows up two 200 HTTP responses: one with the video full size in bytes and the other one showing 0 bytes. No errors on console.
What's wrong with Chrome? What's wrong with us?
Thank you for your time guys, I'm so thankful to this site :)
After some time of researching, we found that MP4 videos with h264 codec that exceed 5MB/s bitrate are not played by Chrome HTML5 video player.
Until now our solution is reencoding MP4 videos that exceed that bitrate to solve this.
If anyone has a better answer, it obviously will be appreciated ;). We hope it could work for anyone that has the same problem.

Retrieve YouTube video format available

I'm currently trying to patch the Totem Youtube plug-in and I'd like to determine the best quality available for the current played video (&fmt parameter). It's possible in JavaScript but the plug-in is developped in C.
Is that possible?
Are you playing the videos in the YouTube video player?
If so, you can query the quality levels through the ActionScript or JavaScript API,
see http://code.google.com/apis/youtube/js_api_reference.html#Playback_quality.
I found the solution thanks to youtube-dl python script.
The test is to form the final url and try to open it (with curl for example), if the format is available it will return HTTP code 303 (See other location) with the real url into the headers.
If it's not available, it will return 404 (Not found).

Resources