I want to save a video in the firebase storage and play that video in an application. My current structure is:
FOR SAVE
Save mp4 video>in firebase storage>get url
FOR PLAY
get mp4 video by url<from firebase storage
But I think this will generate broadcast. So I want the next structure, because I think this should help me:
FOR SAVE
Save mp4 video>in firebase storage>coding video>get url
FOR PLAY
get video HEVC by url<transcoding<from Firebase Storage
I don't know how to do it.
I think I need to use Google Cloud Platform but I dont know how?
My project is a video on demand app.
better use Cloud Storage instead of Firebase; at least for the storage.
while the transcoding probably should already happen on upload.
for reference: Use Case.
Related
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.
I am using Agora RTC Engine in my flutter app for video chat.
I want to record and save that video chat also to the local storage of mobile.
Any idea how to do that? I am looking for the code from where Agora is uploading video frames to server.
Agora provide multiple solutions to save the video stream directly to the cloud but doesn't offer a inApp solution to save it on local storage. In order to do that, i suggest to use this package (https://pub.dev/packages/flutter_screen_recording) to capture and record the video and audio from the mobile screen.
I'm not sure whether Agora could let you save in your local storage.
But this one should help,
https://pub.dev/packages/ed_screen_recorder
Issue
I am building a backend service that creates mp3s for an Android client to stream via ExoPlayer.
Looking at Firebase's Storage Pricing in the long term, if there are 10 gbs stored and 10,000 users there would be 100,000 gb to transfer which is very expensive ($11,600).
What would be the best solution to stream mp3s on the cloud in order to avoid data transfer fees?
Possible Solutions
Use ExoPlayer to stream mp3s directly from the cloud without downloading.
Use a separate API to download the 10gb from Cloud Storage one time, and stream the mp3s to the mobile client from the separate API.
Possible solution #1 is the best solution: Use ExoPlayer to stream mp3s directly from the cloud without downloading.
Thank you Oliver Woodman on the ExoPlayer team for resolving this question on Github!
If a mp3 file is saved to the cloud, ie:Firebase Storage / Google Cloud Storage, can the file be streamed from Exoplayer without needing to download the full file size?
Yes. That's just what happens by default when you use ExoPlayer to play a stream.
If the mp3 can be streamed directly from Cloud Storage roughly what percentage of memory of the file is used in the transfer of the stream since the file itself is not being downloaded?
You can configure this by instantiating your own DefaultLoadControl, which you can pass to ExoPlayerFactory.newSimpleInstance when building the player. You can also implement your own LoadControl from scratch if you need more control.
Note that whilst buffering less far ahead saves on data transfer costs, it also makes re-buffers more likely to occur because the player will be less able to ride out temporary network connectivity issues.
I am developing a video player where downloaded video tutorials have to be played offline.
I want to secure these video files. What is the best and economical way to encrypt these files per user
once user get video, they can share it with others. I want to restrict that.
Please suggest me some ideas of how I can protect these videos from piracy.
Please help
You could create a key per user and encrypt the file with that before downloading it into the user device. Using the same key you could decrypt the file while playing in you app
I have been searching a lot about this by now and I got nothing:
I am trying to play a video from firebase storage and trying to be able to see its progress on the player as it loads and to be able to seek it backward and forward (stuff that any player does while streaming a video).
The problem:
Firebase team say that it is not possible to stream a video from the cloud storage (it is not supported).
Eventhough I was able to do this:
String url = "my_url_at_firebase_storage";
video_View.setVideoUri(Uri.parse(url));
video_View.start();
and I was able to load the video from firebase storage into a video view.
I checked:
I checked this link that has an answer that says you have to transcode the video to chunks and save the chuncks to firebase storage and then load them:
But I am lost here:
1) What are chunks of video?
2) How would you stream these chunks if firebase doesn't support streaming?
My question:
As this topic is rarely documented and the link above doesn't provide enough info about how to acheive it:
I ask:
If firebase doesnt support streaming how come we are able to load video directly to videoview?
Tried the same with exoplayer and didn't work?
Thanks for your efforts.
"Transcoding the video into chunks" means dividing it into multiple small pieces (separate files). Those parts are then uploaded to Firebase Cloud Storage.
Once you divided the video into those pieces, you can download them. Since Firebase does not support streaming, you have to download each chunk entirely before playing, but the trick is that you only have to download that chunk, not the entire video.
Does that answer your question?