I have a problem with playing video on some devices. I am using textureview with mediaplayer, every methods of SurfaceTextureView are called but when I just call mediaPlayer.start(), immediately the listener with completition of playing is called. In log is this error:
E/MediaPlayer﹕ error (1, -2147483648)
When I list log from all applications, I can see some errors and I dont know if it is somehow related http://pastebin.com/rRxxQgdJ
This log is from CyanogenMod with Android 4.3.1 but on some other devices like Samsung Galaxy S3 mini this error is happening.
On my Nexus 4 everything works fine. I've tried convert that video with mp4 codec for android H.264 and even with ffmpeg but the result is still the same. I am using TextureVideoView implementation from here:
https://github.com/dmytrodanylyk/video-crop/blob/master/library/src/com/dd/crop/TextureVideoView.java
Thanks for any advice
As I already pointed it out here it may be due to the fact that video encoding parameters (profile, level, pixel format, etc.) are not supported on the platform, try playing around with the source.
Related
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.
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.
I'm trying to use live streaming in my application. To do that, I've used MediaPlayer to play the video, SurfaceView to display the video and HLS protocol. It is working well, but on some devices, I've received some problems which the most important one is:
E/MediaPlayer: Error (1,-2147483648)
I've searched a lot about this problem (here in StackOverflow site and the others) but found no appropriate solution. according to this site the HLS protocol is supported by android since API 16 as well, but that problem is reported on devices with API greater than 16. My major question is:
why this problem occurs? (Consider I'm using live streaming in HLS protocol, not local file)
After recording a .mp4 video from a Samsung Galaxy S4 and uploading it to a server, I try to stream it on my Nexus 5 device in a VideoView which fails and Logcat shows this
E/MediaPlayer﹕ Error (1,-2147483648)
D/MediaPlayer﹕ Couldn't open file on client side, trying server side
The video turns out to be around 4.82mb and is recorded via intents
//VIDEO CAMERA
Intent cameraIntent = new Intent( MediaStore.ACTION_VIDEO_CAPTURE);
cameraIntent.putExtra( MediaStore.EXTRA_DURATION_LIMIT, 20);
cameraIntent.putExtra( MediaStore.EXTRA_VIDEO_QUALITY, 1 );
startActivityForResult( cameraIntent, TAKE_VIDEO_REQUEST_CODE );
The recorded video is playing properly on the Samsung device, and also when I download the file from the server to my PC it plays properly. I have tried downloading the file to my Nexus device and it still fails to play, tried to stream it within the VideoView and it fails with errors mentioned above each time. I have tried uploading a video from Nexus 5 and the Samsung device plays it properly. I am at a lost as to why this is happening, has anyone encountered a similar problem and found a fix or maybe I am doing something wrong?
Edit
It fails to play in any of the systems video players as well, but still plays on the original Samsung device.
Also I have tested a lower resolution and it works then, so now I think I need to find a way to change the resolution after video capture or send an instruction to use a certain resolution if possible. Any help with this aspect?
These messages are not indicative of an error:
E/MediaPlayer﹕ Error (1,-2147483648)
D/MediaPlayer﹕ Couldn't open file on client side, trying server side
You get these because streaming content can only be opened on the server side. You should get another error after these, e.g. Error (1,-1001). Most likely the S4 uses a profile that is not supported on Nexus 5.
As for resolution, the intent API you are using only supports 2 quality settings (high and low). Low means really low, and is device dependent.
To have more control over a video capture, you could use the Camera and the MediaRecorder interface. There is a guide at http://developer.android.com/guide/topics/media/camera.html#capture-video.
For a more advanced example, there is a sample project at http://developer.android.com/samples/MediaRecorder/index.html.
I'm streaming the audio file (.mp3) from internet with Android Media Player.
It works quite well except Samsung Devices. As far as I see, it doesn't stream the audio but tries to download. It sometimes pushes Media Player Error (1 -1004). Nothing is getting played.
I also tried to redirect the Application to the Media Player with URL of audio file, it goes to Music Player application, indicating "Preparing..." for a while, but then It shows the message "sorry, player does not support this type of audio" with Toast.
Anybody else had the same error before ? Any advise to find a solution ?
Thanks.
There are some bugs in native sound libraries on Samsung Galaxy S2 for instance (look here). I had those problems (random crashes / freezes) and solved it by using OpenSL library for that specific case.