Video is not playing fetched from azure blob storage - android

I am creating an application in which I upload any video from mobile through browser
It stores in blob storage but when I try to fetch it and play it in media player of android there is error in logcat saying "can't open the file" and same is happening if I upload a video from laptop which record by mobile
Why this is happening ? Does codec format of mobile video plays vital role in it ? If yes then what should I do
Thank you in advance

There are something we need to check when streaming video in Azure storage:
1. Check your upload tools.
Includes the tools and the settings, such as bit rate. Sometimes the issue comes with half-baked tools or the transmitting settings.
2. Check your Blob Type.
Make sure your videos are BlockBlobs. Check the header x-ms-blob-type. There are BlockBlobs and PageBlobs … but for streaming video you want BlockBlobs.
3. Check your storage version. It is no problem if we use General-purpose v2 accounts by default.
Azure Storage offers several types of storage accounts. Each type supports different features and has its own pricing model. Consider these differences before you create a storage account to determine the type of account that is best for your applications.
4. Check your video codec format and size.
Storage clients default to a 128 MiB maximum single blob upload. You can see the details in block blobs. For Input video codecs supported, you can refer to the docs.
Reference: this blog post by Tom.

Related

Video Streaming from Google Cloud Storage

How would we go about getting a video from google cloud storage and streaming that video to a mobile device?
I dont see anything related to videos in the Java API like there is for getting images with ImagesServiceFactory
The videos are only going to be a maximum of 10-15 seconds long if that makes any difference.
Any advice on how to proceed here would be great
There is no difference between streaming a video and downloading any other file from the Cloud Storage. Thus, no special video API.
If the files are not public, you need a servlet that will read the content of the video from Cloud Storage and stream it to the client. Note that you cannot run it on App Engine or managed VM as they do not support file streaming and the request size is limited to 32MB.
Your best option is to run this on a Compute Engine instance:
Bandwidth between Compute Engine and Cloud Storage is free.
Authentication is simple.
Alternatively, you may use a signed URL for your video files. This saves you from developing/deploying a separate Compute Engine instance just for the streaming purposes - signed URLs can be returned by your existing backend.

Protecting Assets in Cordova/Phonegap Application

I am working on a cordova android application which will display images and videos.I have the images and videos in the assets folder.I want to protect my resources.I don't want anyone to copy the resources.I have googled for the same and didn't get any proper solution.How to protect files in assets?
Is there any way to encrypt and store videos in assets folder and decrypt it during run time?
My video files will be maximum of 10 MB each file and there are 50 videos in the whole application.
You can definitely do this with DRM - it won't stop someone copying the video files, but as they are encrypted they will not be able to play them back without the correct key.
The process is roughly:
your content is encrypted before it is streamed or downloaded
when the user wants to playback the content the app must request a key for the content from owner of the content or the 'rights authority' (a service which handles keys for content)
The DRM system on the device will securely encrypt the content and play it back using the key it obtained. The video will not be stored in clear format at any point.
Native Android DRM is explained here:
http://developer.android.com/reference/android/drm/package-summary.html
To use this with cordova I think you will have to create a Native plugin - I could not see any cordova DRM API. Alternatively, if you are able to stream the content using the new MPEG DASH format, then you could use a HTML5 video player which supports DRM, such as BitDASH (https://www.dash-player.com).
You need to be aware that all DRM and encryption systems are really just hurdles that make it harder to copy content - at the end of the day if you have a very high quality display and a very high quality camera to record the display, then no DRM protection will save you.

How to play an encrypted video file in Android

I searched through a lot of questions on SO but I can't find the answer, that's why I ask the following question:
An Android app should be able to play an encrypted video file (stored on the SD card and retrieved from a webserver).
The file has to be stored on the SD card so that the app can play the video file without having an active internet connection.
Because the video files may not be copied, the plan is to encrypt them server side when uploading the files to a webserver.
What is the best option?
1) I have seen suggestions for running a local webserver which decrypts the file (and how to do this?)
2) or should we decrypt the file, save it as a temporary file and set this temporary file as the source for the videoplayer?
3) something completely different?
You are trying to implement a DRM scheme, and a naive one at that. Look into DRM schemes and report back if you cannot implement the impossible. All you can hope for is obfuscation, and there are plenty of ways of doing that (none of them are secure of course).
What you need is DRM. Digital Rights Management (DRM) controls the access to your digital content such as video. Firstly, you need to encrypt the video with an encryption video like AES-128. Then with the use of DRM play in exoplayer. Exoplayer has DRM support. you can check here. https://exoplayer.dev/drm.html
You will expose the user to a waiting time if you choose to decrypt a entire big video beforehand. As of the security, you can guess it's a poor idea to have the contents in clear in a file, even temporary. The local webserver is a better choice because it's a streaming method, so without file storage. There is no class for an http server in the SDK, you have to implement your own one, otherwise look for an existing library similar to LocalSingleHttpServer.

Securing Video in android

Im presently working on an android application which will allow the user to download video and audio content from a server and play them on the phone of the end user.
What I'm trying to do is to secure the audio and video. The files should not be accessible to other applications and the user must not be able to take them off the device and use them.
This is a shot in the dark but can i do this by storing the videos in theSQLLite database as blobs.
And also is it possible to play the videos in android if they are stored as blobs.
I wouldn't use blobs, they are only performant if the binary-files are 256KB or less.
I guess the only way to make the videos secure so the user can't use them is to stream them down from you'r server and deleting the buffer when the Application closes.
On a rootet Device, you have access to every directory, so you can't save the videos on the SDcard or the Phone-Memory.

how to store and search mp3 by its content in android

In my app i have to store a no of audio files in database in webserver and then after recording the audio in android mobile i have to send it to server to match with the previous audio files.
How to do this??
This involves a very high understanding of audio data parsing and fingerprinting.
If you are trying to make a clone of shazam, you should read up this post :
http://laplacian.wordpress.com/2009/01/10/how-shazam-works/
Bonus : the article contains a link to an article by the very developper of Shazam.
Good luck on your endeavour.

Categories

Resources