Capture screen shot on Android phone when playing video and camera preview - android

I have two HTC phones, one is HTC desire and another is HTC aria. I'm using ddms to capture the screenshot on HTC desire before, it works fine. However recently I buy one HTC aria, and I found when doing screenshot on camera preview and video playing (e.g. youtube clips), the result goes black.
I think that might be some overlay issue, but just can't figure out how do capture screenshots on camera preview.

Sorry, this is probably just not possible. Prior to Android 3.0, the DDMS screenshot facility was done by taking a copy of the framebuffer. For surfaces in an overlay (often the case with video playback), this doesn't exist in the framebuffer so can't be included in the screenshot.

Related

Unable to get 4k video output on android + opencv

I'm trying to connect a 4k camera on a Android tv device.
My problem is that i can't seem to get 4k output from the camera onto my 4k tv screen. The highest video resolution that I am able to get is 1920x1080.
I'm using opencv for android and have tried to set the resolution in initializeCamera() inside the JavaCameraView class.
params.setPictureSize(highestSupportedSize.width, highestSupportedSize.height);
params.setPreviewSize(highestSupportedSize.width, highestSupportedSize.height);
I search for the highest common resolution between the pictureSizes and previewSizes. The problem lays in the fact that the highest preview size that I can get is 1920x1080. Which is very strange since both my screen and camera support 4k.
If I manually set the picture size to 3840x2160, I get a very large green area on the screen and the camera preview part stays 1920,1080.
If I try to manually set the preview size to 3840x2160, the app crashes.
Would really appreciate someone that knows how to get 4k video output on a JavaCameraView.
Edit: I now have the feeling that the issue is the Android tv I'm using (Nvidia shield tv). Which might not support 4k camera input. Still trying to fix this.
Edit2: For anyone facing the same issue: According to Logitech customer service, the Android tv boxes don't support anything higher than 720p at the moment. There are also no plans from logitech or nvidia to create support for this.
You chan check my question:
android tv box 4K activity
You can select 4k for your actviti, if available.
I think a lot of tv boxes GPU only supports 4k video, but fullHD openGL surface /activities.
Maybe JavaCameraView is video over opengl.
Can you get a real 4K resolution with others non video apps, like launcher?
I downloaded a lot of apps to display screen resolution, and I always get a
logical fullHD resolution with a 4K#60Hz display.

When StageVideo is being rendered by software, black screen and audio only on Android. When hardware accelerated, everything works

We developed an Android app using Adobe AIR. We basically loop HD and FullHD H.264 videos using the StageVideo resource, that takes benefit from hardware acceleration.
This app is running perfectly on our Yarvik Noble tablet and on our Tronsmart MK908. On the Vega sometimes we get a black screen with audio, but on some other times it works perfectly. There is no pattern or specific video, it sometimes happens and then gets back to normal.
We did some other tests and found out that the Vega swaps between HARDWARE ACCELERATION (works perfectly) and SOFTWARE (black screen with audio). The strange thing about it is that the same video sometimes is decoded in one way and some other times in the other way.
Meanwhile our other hardwares always decode the vĂ­deos using HARDWARE ACCELERATION.
I shot a small video showing the problem. As soon the app is opened, the video on the tablet (muted) is perfectly displayed while the TV (not muted) displays a black screen and just the audio. A very curious fact is that there is no pattern to repeat the problem. Sometimes the first video works and other videos fail.
Video - http://hahmann.com.br/air/IMG_7104.mp4
All the Vega S89 units we own are Android 4.4.2, Build 108k4 and Kernel 3.10.33.
Apk and source - http://hahmann.com.br/air/source_apk.zip
Bug opened at Adobe - bugbase.adobe.com/index.cfm?event=bug&id=3836848
I appreciate some help.
Best Regards,
Peter

Capturing preview image with cwac-camera?

This question may be slightly philosophical in nature, but would it be crazy to just capture a photo from the live preview instead of going through takePhoto?
I've found a few examples of how to do so: How to capture preview image frames from Camera Application in Android Programming? and Capture an image from the camera preview.
Right now I'm juggling through inconsistent different EXIF rotation behavior on various phones (it looks like you have a FullExifFixup for all Samsung devices, but I'm having different behavior between my S2 and S4) and I'm wondering if it wouldn't just be easier to grab the preview image.
Is this a stupid idea?
but would it be crazy to just capture a photo from the live preview instead of going through takePhoto?
It would be crazy with the library as it stands, simply because I don't expose the preview frames. :-) That's on the issue list.
it looks like you have a FullExifFixup for all Samsung devices, but I'm having different behavior between my S2 and S4
I don't have an S2 at the moment. If you can provide me with a reproducible test case (including details of the specific model of S2), post an issue, and I can see what I can do.
I'm wondering if it wouldn't just be easier to grab the preview image
It won't be at full resolution of the camera -- you'll be capped at the preview frame size. That being said, plenty of apps work with just the preview frames. Vine, for example, captures its video by capturing the preview frames, due to various problems they ran into when using MediaRecorder (there's a conference talk from a Vine employee that goes into more details).

Can I detect the orientation of an image without saving it to file?

I am trying to build a receipt scanning Android app and the way that I am handling really long receipts is to take multiple pictures and compile them into one long image. I tried doing image stitching with opencv but I ran into too many memory issues on older devices.
I am now running into the issue that with certain devices, specifically the Samsung Galaxy Player and Samsung Galaxy Tab 2, the preview and image capture orientation are not correct. The receipt needs to be scanned in portrait mode.
I have tried using this code to rotate the preview: http://developer.android.com/reference/android/hardware/Camera.html#setDisplayOrientation%28int%29
I added a line of code that rotates the camera by the same value that it rotates the preview.
On the Galaxy Player, this makes the preview display as still rotated but now flipped. The pictures that it returns are still rotated as if the camera was not rotated.
On the Galaxy Tab the preview displays correctly but the image that it creates is upside down.
Is there a way to detect the top and bottom of the image without saving it to file and getting the EXIF? Would that even make a difference on these devices or is there a deeper issue with those devices?
Thanks!

Using Camera without preview or surface in android

I was looking for a method to use the camera on android devices without a surfaceview or a preview. I found out that, it is impossible to take picture without that preview. However, I have found a tutorial which is actually working taking pictures without a preview. Here is the link: http://www.vogella.com/articles/AndroidCamera/article.html
After switching the camera in the code from front to back-facing the app didn't crashed but it gave me an error 100. So it is only working with the front cam at the moment.
I am using a Samsung Galaxy S3(4.1.2) and i will test it on a Galaxy S2 and a Galaxy S3 Mini.
Anyone a good explanation for this?
You cannot take a picture without starting preview.
While some Android devices are more flexible, and allow takePicture to be called without preview running, this is technically against the API specifications.
It won't work on a large number of devices, so please don't rely on it. That tutorial is wrong, and presumably tested only on one of the devices that allows this behavior.
If you don't want a visible preview, see this question for ways to do that in Android versions >= 3.0.
Actually the time interval of question and answer is large, but may help others.
You can try this library to take picture even from service:
https://github.com/kevalpatel2106/android-hidden-camera
It uses a feature to draw over other apps and create a fake surface. Hope it helps.

Categories

Resources