how to get stats/properties of video? - android

i need to retreive properties of video like resolution(height/width) ,file format ,bitrate .. etc ..i used MediaMetadataRetriever to get some properties .Is there any other way of getting those properties.

I seek for the same information and i found that the best solution is use MediaMetadataRetriever
Retrieve the width and Height of a video in Android
I use this solution and the result are perfect, efficient and precise.

Related

Android: Animated gif image resize in kmagick

I am using kmagick for resizing gif images in android. It works fine for static but gives incorretc output for gif or animated webp files.
Magick.initialize().use {
val wand = MagickWand()
// getting image
wand.readImage(src)
// resizing image
wand.resizeImage(512,512,FilterType.UndefinedFilter)
// Saving image
wand.writeImage(dst)
promise.resolve("Done at ${dst}")
}
Input: (animated gif having multiple frames)
Output: I think its single frame and that also messed up but resizes according to input for height width.
Whats happening here. How to fix it?
Just want to reference for future, this was already answered in
https://github.com/cherryleafroad/kmagick/issues/3#issuecomment-1068044815
Anyways, to sum up what's going on,
Gifs are able to save the difference between frames to save space.
It's due to the way gif images work. Because the cli uses the api in a certain way, and kmagick bindings are only direct bindings to the c api, if you want to achieve the same results that the cli does, you have to use the api in the same way. (kmagick isn't doing anything to the image, it's imagemagick that's doing it; so it's more relevant to check imagemagick api docs / ask them so you can do it in the same way and get the same results).
I'm not sure what imagemagick api they're using off the top of my head however to achieve those results, but I think that doing something like extracting each frame individually then resizing them one by one would solve it.

How to change image display duration in VLC lists for Android?

I have set this duration for lists on Windows over the setting 'demuxer', however the android version does not contain this option.
I'm actually creating the list dynamically over a php file in a server, so it looks like this:
#EXTM3U
#EXTINF:-1,
image1.png
#EXTINF:-1,
video1.m4v
So I wonder if there is an option in android to make images (not videos) display over a minute and if there is no such option, maybe I can add something to the list to make images display longer?
I have seen a tutorial for the list to use 1000 but it is a tag based language (html?), which seems not to be the case of my list. (link to tutorial: http://chris-reilly.org/blog/vlc-slideshow-duration/)
It is worth mentioning that in the Android version there is a small input for VLClib, but I was unable to find anything related to what I'm looking for.
Any help will be appreciated.
The answer is #EXTVLCOPT:image-duration=100 after each image file. (change 100 for the number of seconds.
Found in https://forum.videolan.org/viewtopic.php?t=148945

Can we add a invisible image watermark to another image in Android? If yes then how?

I need the code to add invisible watermark to another image in Android
As the comments mentioned, Stackoverflow isn't a free coding service. I will provide you with a high level design advice from which you can implement your own code.
Invisible watermark could just be metadata. The point is to make your particular photo unique and identifiable, right? I would recommend you looking into image metadata manipulation for a simple solution.
That being said, if you are looking for some high tech stealthy watermarking, then you might be looking for pixel manipulation. You can change a few of the pixel colors so if it's compared with the original image with the naked eye, it looks identical but if compared with their base64 encoding you can see a difference. Simply create your own pattern as some sort of signature to attach to images to identify them.
Both method allows you to determine if an image is yours due to the "watermark" you leave on it.

How to retrieve a Bitmap/image from videoview

I'm trying to get a snapshot of the current position of playback of a video, but I couldn't find an appropriate way to do that. Is there a method I can use?
Any help would be appreciated.
Thanks.
VideoView extends SurfaceView, so it seems there is no easy way to do it. Take a look at this post: http://groups.google.com/group/android-platform/browse_thread/thread/c4720072d659f4f0/9b207dc411c5e800?lnk=raot
You may need to read the movie raw file, implement your own drawing mechanism, and access directly the file instead of the Canvas for the screenshot.

How to get metadata from a picture?

I am browsing the web but no way to find how to get metadata from a picture.
Does anyone has an idea ?
I can't see anything in the Bitmap/BitmapFactory/BitmapFactory.Options documentation that would give me a hint.
I would like to retrieve standard information such as :
name
date it was taken
dimension
size
and maybe more.
Any idea ?
You can get at least the size of the image by setting BitmapFactory.Options.inJustDecodeBounds to true.
If the image is in the MediaStore, you might be able to get more information.
According to this thread
http://osdir.com/ml/AndroidDevelopers/2009-02/msg00821.html
you have to use ImageManager

Categories

Resources