How to get a thumbnail of a live stream? - java

I am currently using MediaMetadataRetriever.getFrameAtTime on Android to get thumbnails of videos and it is working great except for live streams (m3u8). Using the m3u8 directly doesn't seem to work and I have managed to get a bitmap back for a .ts segment file using that same method but it is always just a black bitmap. So how can I get a thumbnail of a live stream?
Thanks.

Related

Load thumbnails for video - JavaFx

In JavaFx we can load images easily from an external server:
imageView.setImage(new Image("http://...File.png"));
But is there a way to load the thumbnail of videos?
Something like: imageView.setImage(new Image("http://...File.mp4"));
I'm developing something like a "gallery" and would like to load the thumbnails of videos coming straight from my server, is it possible?
An mp3 or mp4 file can have an embedded thumbnail image as part of its metadata. There are third party libraries for reading mp3 / mp4 metadata. For example:
How to retrieve thumbnail picture of an mp3 file using java
App Engine Java - Extract thumbnail from mp4 video
If the file doesn't have a thumbnail, then you could conceivably pick a frame of the video and use it as a thumbnail, but the chances of picking an appropriate frame (i.e. one that is indicative of the movie) without the assistance of a human being are not great. But here is an example:
Extract Thumbnail for specific second from MP4 file in Android
But how do you make a video that is not local without downloading it altogether?
Approach #1: pick a 3rd-party metadata extraction library that can operate in stream mode. The metadata should be at / near the start of the stream.
Approach #2: get the server to do the extraction, and present you with the thumbnail separately from the main video.

Overlaying a [PNG] image while recording a video camera api android

I want to add a png image while recording video using camera api, the image must acts as a watermark on the video while video is saved.
One approach which I can suggest is use ffmpeg for android (check this). You will need to compile the library yourself, if you want the latest version. Readily available ffmpeg for android is this.
After implementing the ffmpeg, refer this question for adding watermark.
Hope this helps.

How to create a png image from frame buffer in android

Now iam using the '/dev/graphics/fb0' to get the frame buffer and iam saving it on sd card using 'cat /dev/graphics/fb0 > /sdcard/screen.raw'.
Now i want convert that raw data into a png image and display on to the screen.is it possible to convert as a png in android code by using (NDK/SDK).
Code to do this can be found in the Android source tree. The old screenshot tool reads from the framebuffer device and saves it to PNG.
Note this does not work on newer devices, which may use hardware composer overlays to avoid writing to a single framebuffer. On such devices you need to use the screencap tool instead.

Getting thumbnails from android gallery - sdcard

I have the absoluite path of an image file name in sdcard. Is there a way to get the thumbnail of it just like the way they show in android gallery? The reason i need is I have few images selected from the android gallery and http post it to a server. If the size of the file is huge, it takes a long time to upload because of slow mobile data. Instead of the file, if i can get the thumbnail of it, it will be easy to upload.
I can work on image resize to resize the image on my own before uploading it. But I would like to explore if there is a easier way?

Split the video into images in java

I want to split the video into images using Java. Then, I want to convert the images into bytes. I tried finding a solution, but was not able to solve it up.
Can anyone let me know the solution or example code of the same?
Thanks
Broadcast the video via an RTP stream from the PC. Use the Daroon player on the Android to play the video.

Categories