I'm wondering what's the best practice to get thumbnails of videos on an external URL, i.e. HTTP videos that can be streamed.
I've tried using ThumbnailUtils.createVideoThumbnail(), and that works excellently for local videos, but doesn't work for videos on the web.
I've thought about a partial download of the file, and then see if it's somehow possible to get a thumbnail based on that, but I haven't tried it yet.
Any suggestions or thoughts?
Related
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?
I have video uploaded on server. which is trailer of movie. I can play this video direct to my videoView with the help of live url. My question: is there any method in android which help me out to get a video frame from url without download the video to local storage. I know one method name "createvideothumbnail" but it will not work in my case. because i need to get the video thumbnail without download the whole video. as you have seen the mechanism is implemented in imdb official app (Trailer section).
Please help, thanks in advance
Getting thumbnails without download the complete video is not possible until now (API Level 22) i´m pretty sure that the application that you describe load thumbnails that were created previously.
the current option would be using the class:
import android.provider.MediaStore.Video.Thumbnails;
or create the thumbnails in a separated process.
I am having an app requirements like whatsapp application. The thing is that webservices are not ready and it will take time. Meanwhile I want the test URL which use JSON format to upload and download the videos and images.
I know the sample URL's for JSON simulation
http://www.jsontest.com/
http://www.mocky.io/
For HTTP GET and POST simulation
http://httpbin.org/
Like this I want it for images and video in the form of JSON upload/download.
You don't need a webservice to test download from android, just a server container like tomcat installed on your computer and place files you want to download on tomcats directory.
But you will need one for uploading to receive (even if it does nothing).
You may use the following websites to download an image from
http://dummyimage.com/
Or this website
https://placehold.it/
You may also use the following website for video downloads
http://www.sample-videos.com/index.php#sample-mp4-video
The requirement is to list a Videos thumbnails and on clicking it should play related video into Application. i am able to play url where video is located using Video View. But now i want to implement this thing in a better ways like Watsapp and instagram. If anybody have a good experience in this reference please share with me. I want to play around caching video and playing videos from cache without buffering (Video view is showing buffering bar and very slow in performance user have to wait a lot for starting a Video). Any kind of help will be appreciated. thanks.
I did it own my own. It's very simple to implement What i do is to download the video with async task along with a progressing seek bar. Once it's downloaded i'll save it in a Folder in my sdcard. We should create a Folder named as Application name so easy to identify and also always available videos with out opening application as well and next time however when i want to watch video again in my application it just check weather it is available in sdcard if yes then play immediately if not then download it. I am happy.
I have problem with my app, it's very slow because of using Video and images. When I play video or show images it takes time to download, the app would close during this time or it will take for ever. How can I avoid this problem? Once we have seen the image or video it should not download from server again, please give me the solution for this(Like Facebook).
First you should download the video or image in an asynctask inner class, this is why the app freezes while downloading.
You are downloading on the UI thread and this freezes your app, AsyncTask is the way to go.
Second when download is complete you could save the video, image to sdcard so you won't have to download them again next time. When you want to view the video the second time you will only have to know the file name so you could grab it from sd card. You could make a method that determines if a video on sd card is considered outdated and delete that file if true.
Also as other comments say, AQuery ( Android Query) is a library (facilitates chaining like jQuery does for javascript) that offers a lot of convenience methods for file downloading and other cool stuff. A short Google query for AQuery term should reveal tutorials and download sources.
You can use AndroidVideoCache for caching video while streaming. It allow to use cached video after single viewing.