VideoView fails to play video on certain devices - android

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.

Related

HD Video Playback issue with android things

Has anyone been able to successfully play a HD video using Android Things on a Raspberry Pi? If so was there anything special you had to do to get it to work? If not does any one know why it isn't working?
I made a simple video player that plays a local video from disk. The app runs fine on a phone but with android things maximum frames are getting dropped.
I am using ExoPlayer for the video playback and the same issue is observed when Media Player is used.Hardware acceleration is also enabled in the manifest file.

Cannot play video in TextureView Android

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.

Video uploading and streaming using the samsung note 3 is not working

I am working on an android application. In my application, I am implementing video uploading to the server and also streaming the uploaded video from the server to my mobile in real time like streaming in you tube. I am able to upload and stream videos taken from mobile like micromax, nexus 7 and moto g. But when I tried with samsung devices, though i successfully uploaded the video taken from samsung device, and when I tried to stream it I am getting some error like "IOexception . setdatasource failed". Even the media player wgich is trying to stream the video is displaying the duration of video as 00:00. Please help me. Thanks in advance, Prince

Android Media Player Streaming issue on Samsung Devices

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.

Android 3.1 / Galaxy Tab / VideoView won't play

My app downloads a video file from a server and plays it using VideoView. I am using a H264 (AVC) encoded file in an .mp4 container.
On my Motorola Xoom with 3.0.1, it works perfectly.
On my Samsung Galaxy Tab 10.1 with 3.1, it does not work. I simply get an error message 'Sorry, the video cannot be played'. Trapping the error in code simply gives me 'MEDIA_ERROR_UNKNOWN'.
I suspect a codec problem (despite my codec being valid, according to http://developer.android.com/guide/appendix/media-formats.html). I take the same video file and manually copy it to the device - the device prompts me to convert the video. The resulting file plays fine in the Video app on the device. I take the file back off the device (inspected it in VLC tells me the video codec is now mp4v) and try to play it through my app - same result.
Is there something specific about 3.1, or the Galaxy Tab, that is causing this problem?
Double check the download/play location. Since it's a different device manufacture the path to the file might be slightly different
The issue is as described here:
Can a videoview play a video stored on internal storage?
My app stores the files on internal storage. The Xoom I was using to test was rooted, and therefore permissions were not a problem. However the Galaxy is not rooted, so videos would not play.

Categories

Resources