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

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.

Related

Picture is too late to be displayed VLC Android

I used libvlc in my android application and I got it to work. The problem now is, it keeps giving me an error of:
core video output: picture is too late to be displayed (missing 29787 ms)
Using the VLC player, I don't get any lags. What seems to be the problem?
Are you using any LibVLC options? If not, you should. Here is what VLC for Android uses https://github.com/videolan/vlc-android/blob/master/application/resources/src/main/java/org/videolan/resources/VLCOptions.kt
My guess is you have not properly configured hardware decoding, which leads to the video output displaying the picture later than it should.

Android Kitkat Webview Plays Only the Sound of the Video

Before you downgrade I know there are similar questions related to this topic when you google it. Even it had been answered for several times here in Stackoverflow.
Yet although I read all of those topics none of them solved my problem. My code works great for Jelly Bean, lollipop and marshmallow variations. Only for kitkat it is impossible to play a video via webview. For example on Youtube you can hear the audio but you can't see the video at all. This is also happening in vimeo.You can see in this screenshot from emulator. I can actually listen the audio but cannot see the video.
I know with 4.4.4 Webview started using chromium. I know I should add this: mWebView.setWebChromeClient(new WebChromeClient(){}); Also I should add android:hardwareAccelerated="false" to my manifest file. However when accelaration is false video never loads. If I add android:hardwareAccelerated="true" This time audio comes but video doesn't appear.
At last I am still unable to play videos. If you could help me with this I will very much appreciate it. Thanks in advance.
If it helps these are some of the error logs:
E/chromium: [ERROR:gles2_cmd_decoder.cc(5942)] [.Compositor-Onscreen-0xb8bb47f8]GL ERROR :GL_INVALID_OPERATION : glUseProgram: program not linked
E/chromium: [ERROR:gles2_cmd_decoder.cc(5718)] [.Compositor-Onscreen-0xb8bb47f8]GL ERROR :GL_INVALID_OPERATION : glUniformMatrix4fv: wrong uniform function for type
Set software Accelerated in webview activity,
mWebView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);

chrome plays mp3 in base64 format in android 4.0 up without sound

The following snippet plays well in chrome pc version.
var base64Data=results.rows.item(0).vocData; //mp3 in base64 format fetched from webSQL
audioPlayer.src ='data:audio/mp3;base64,'+base64Data;
audioPlayer.load();
audioPlayer.play();
However, when I played it in chrome for Android, it did play without error (audioPlayer.error=null),but without any sound.
Does anyone know what's wrong with the codes, or is there any limitation under Android 4.0.4?
is there any workaound? thanks.
This is most certainly a bug. Any time that you have it working on desktop and it fails to work on Chrome for Android that it is 99.5% likely to be a bug.
I have raised the bug here: https://code.google.com/p/chromium/issues/detail?id=253466 with a demo of the error here: http://jsbin.com/ajocid/latest
Right now there are no workarounds because you can't even load it into a blob and attach it. The only potential solution is to save it up to a server somewhere and then use that URI.... which is less than optimal.

VideoView MP4 isn't working

I've been struggling to make VideoView work with mp4 files. The thing is that with some mp4 files (that have lower resolution) it works, but in case of higher resolution 480x268 it rejects to play. This issue resembles me the same situation here. It's said that Android can only play mp4 files below certain resolution. Does it holds for today ?
P.S. I'm building against Android 2.3.
Thanks.
did u add the hardware support while creating the emulator for playing video and audio. Maybe thats y it isnt working

Android Video Streaming Problem

I am new to android and trying to streaming video from my server.
When i run the application it gives Error "sorry,this video is not valid for streaming to this Device.." than i download and push to sdcard of my device(samsung Galaxy 5)this time video is playing.... i convert this video by SOTHINK VIDEO CONVERTER..
Any Help??
Thanks..
We ran into exactly the same problem, and I found a solution at this link:
http://code.google.com/p/android/issues/detail?id=9044
In short, if you have access to a Mac, you can encode the videos using HandBrake. Be sure to check the "Web optimized" checkbox. I'm encoding as format:MP4 file, Video Codec: H.264. After I did this and uploaded I was able to view the videos (or at least listen to them) in a 2.1 simulator, which had been giving that exact warning message before. I have not been able to get a hold of an actual 2.1 device, but I suspect it will work. When I confirm that I'll check back in here to let you know.
It seems that you are talking about sothink video encoder engine. Actually this program only supports the apple devices in ios system, for example, iphone, ipad and ipod.
Here is the official product homepage of sothink video encoder engine, and hope it helps!
http://www.sothinkmedia.com/flash-video-encoder-command-line/
The only issue for error "sorry,this video is not valid for streaming to this Device.." is that there is some problem in video format. Just correct the format/codec of mp4 and then it would run gracfully.

Categories

Resources