Grafika CameraCaptureActivity not working - android

I'm trying to test this sample in my galaxy S3 and everything seems to work well but when i try to play the recorded file, no player can play the file.
I send the video to my computer and tried with VLC, gom player, etc and always get an error like " entry format no recognized"
The file has the right size.
What is happening?
Edit: I tested the same sample in a moto G and works ok. Can be a galaxy S3 related issue?
Thanks

I'm sure that this is not the best way to overcome this. But anyway, anything is better than a infinite loop and a corrupted file so... i put a counter for EOS waiting iterations with a limit, if it is reached breaks the loop.
File is playable now.
No secondary problems for now.
Thanks

Related

Can't play video VideoView Android 12 (error (1, -2147483648))

I have an app with a VideoView to display an MP4 file. Everything was working perfectly fine, on all devices and all Android versions, until Android 12.
We have one user reporting that the VideoView is unable to play the videos, for every video he gets the following popup (the app doesn't crash, just this popup is shown):
My question: does anyone know what the problem might be? I'm expecting - or hoping - it has to do with the fact that it's the beta version of Android 12. If that's not the case, then how can I solve this issue? Anything that changed for Android 12 w.r.t. displaying videos?
Many thanks.
EDIT: The video files are located in local storage (R.raw folder)
EDIT 2: When running the emulator with Android 12, I get the MediaPlyaer error (1, -2147483648). This corresponds to MediaPlayer.MEDIA_ERROR_UNKNOWN and UNKNOWN_ERROR respectively, as explained in this SO post. However, the proposed solutions there don't solve the problem here (the format should not be the issue, since they are .mp4 files). Any ideas?
EDIT 3: I submitted an issue with Google about this. If you're interested in a solution, star it here. Hope we can find the cause soon!
What fixed it was saving the video in AVC/H264 format and using that file.
From reporting this issue on Google's Issuetracker here, it turned out that the problem was actually with the encoding of the video files in this case. The video that wasn't playing was encoded in MPEG-4 format (.mp4) and exceeded the capabilities of the MPEG-4 software decoder.
I don't know why this wasn't an issue before Android 12 (videos were playing fine before), but at least this does fix the issue.

In Unity 5.0, the audio for android have lag, any way to reduce the lag?

In my game, I need to have shoot, hit, blast sound effect, and they are all less than 1 seconds. However, when the sound plays, it have lag on some specific devices.
HTC One M8: 0.4s lag
Samsung Galaxy S6: 0.4s lag
Samsung Galaxy S3: 0.4s lag
Samsung Galaxy Tab 3: no lag
iPad Air: no lag
Any idea how to solve the problem?
I already tried the following:
AudioSettings, best latency;
All audio data are wav;
All audio data are imported and compressed as PCM;
All audio data are "decompress on load";
AudioSources bypass all the effects;
There is a Android latency plugin, seems not working on new Unity, there is no sound at all;
There is another audio plugin, which have the same problem.
I have an s3 and experience no lag with audio. Even with lots audio files playing and overlapping.
This is leading me to believe something else is causing lag which results in your audio doing this.
Theres nothing posted here with how you went about setting this up or what other logic is happening when the audio file gets Play()'d
Ive had similar effects on my s3 when using coroutines, but i eventually found it was my wrong doing, specifically with the coroutine.
Hope this is helpful in anyway for you and good luck!

Android SoundPool logs info as error

I'm developing an Android App using the SoundPool. Every time I play a sound, an error gets logged in LogCat of the type:
E/SoundPool(11873): sampleID=33, leftVolume=0.779528, rightVolume=0.779528, priority=1, loop=0, rate=1.000000
What does this error mean? Is it possible to disable these logs, I guess logging these errors is quite time consuming since I play a lot of sounds.
Thanks
I'm using API 8 and test the App on a Samsung Galaxy S Plus with Android 2.3.6
A took a quick look over the SoundPool class and didn't find anything immediately, but you should definitely look into what type of audio files you are playing. I think you should try maybe uncompressed file types like .wav to see if that alleviates the problem.

Accessing video from server on Android

We are trying to move some of our media files from our application to a server, but we can't seem to figure it out. I created a video, embedded it in my app, and it played fine. So I sent that same video file to someone to put on the server. I then went to my browser and typed in "http://www.server.com/Android-app/testVideo.mp4" and I get an error saying "Sorry, this video is not valid for streaming to this device." I am using a Samsung Moment. So I was thinking it was something wrong with the server. But the video does work on someone's Droid, so that makes it sound like a phone compatibility issue. But it is the exact same file that worked on the phone earlier.
Is there a setting (on phone or server) that needs to be changed? I just can't make since of it. Thanks for any help.
You haven't really given enough details to give a definitive answer, but the first thing I'd do would be to check the Content-Type in the response header.

Playing .MP4 video from raw resource folder

I've seen a number of similar questions, but so far I've not been able to get anything working.
I'm trying to playback a video (.MP4) from the res/raw folder and only get audio, no video. The video is short (about 3 seconds), small (350KB) and if I put the video on the device (Motorola Droid) directly, it plays fine. It also plays fine if I modify the app to read it from the SD card rather than the resource folder. The behavior is the same on both the emulator and the actual device.
Unfortunately, I need this video to be an intro shown just prior to the main screen for my app, so it has to be part of the package. Additionally, one of the app requirements is that the app is available offline, so I can't stream from a web server. I've tried a VideoView, SurfaceView and MediaPlayer, none of them work.
Is it possible to playback video from the resource folder? I've read something about compression possibly screwing the video up, is it possible to manually decompress the video and then play it, and if so, how would that work? This seems like it should be a pretty basic operation, am I just missing something?
I was having the same trouble, tried everything too, agree it should be easier... and documented. Just fixed by passing VideoView.setVideoUri a string with the android.resource protocol, as described here.
The first option doesn't work for me, but the second does:
Uri uri = Uri.parse("android.resource://[package]/"+R.raw.[video_resid]);
Hopefully works for you too.

Categories

Resources