Android MediaPlayer error (1, -2147483648) - android

I have two different videos which I'm trying to load into a VideoView using
videoView.setVideoURI(Uri.parse(url));
The two videos, let them be video 1 and video 2, have the following specs (extracted using ffmpeg -i); in fact, they are two different encodings of the same video:
Video 1:
Seems stream 0 codec frame rate differs from container frame rate: 180000.00 (180000/1) -> 90000.00 (180000/2)
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '4fbfd5ece4b0932236fc234d.mp4':
Metadata:
major_brand : mp42
minor_version : 0
compatible_brands: mp42isomavc1
creation_time : 2011-12-03 04:43:46
genre : Trailer
artist : Paramount Pictures
title : Captain America: The First Avenger - Theatrical Trailer #2
encoder : HandBrake 4344svn 2011111001
date : 2011
Duration: 00:02:30.67, start: 0.000000, bitrate: 6738 kb/s
Stream #0.0(und): Video: h264 (High), yuv420p, 1920x800 [PAR 1:1 DAR 12:5], 6575 kb/s, 23.97 fps, 90k tbr, 90k tbn, 180k tbc
Metadata:
creation_time : 2011-12-03 04:43:46
Stream #0.1(eng): Audio: aac, 48000 Hz, stereo, s16, 159 kb/s
Metadata:
creation_time : 2011-12-03 04:43:46
Video 2:
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '500416ea44aeb4b95d5ae8a0_hd.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
creation_time : 2011-12-03 04:43:46
title : Captain America: The First Avenger - Theatrical Trailer #2
artist : Paramount Pictures
date : 2011
encoder : Lavf53.32.100
genre : Trailer
Duration: 00:02:30.69, start: 0.000000, bitrate: 2045 kb/s
Stream #0.0(und): Video: h264 (High), yuv420p, 1280x720 [PAR 27:20 DAR 12:5], 1889 kb/s, 23.99 fps, 90k tbr, 180k tbn, 180k tbc
Metadata:
creation_time : 2011-12-03 04:43:46
Stream #0.1(eng): Audio: aac, 44100 Hz, stereo, s16, 151 kb/s
Metadata:
creation_time : 2011-12-03 04:43:46
I am aware that AAC support came with Honeycomb, and therefore I tested the videos with several devices; the results are given below:
SGS II with custom 4.0.3 OS(Sensation ROM 3.4 with CF-Root kernel) - Video 1:OK - Video2:OK
SGS I with Samsung 2.3.3 OS - Video 1:error (1, -2147483648) - Video 2:OK
SGS I with custom 4.0.3 OS(ICS SGS TEAM ROM with Devil kernel) - Video 1:error (1, -2147483648) - Video 2:OK
Nexus One with original 2.3.6 OS - Video 1:See (1) below - Video 2:See (2) below
Emulator with 2.2 OS - Video 1:error (1, -2147483648) - Video 2:error (1, -2147483648)
Emulator with 4.0.3 OS - Video 1:error (1, -2147483648) - Video 2:error (1, -2147483648)
Both videos play fine in Google Chrome in a PC. It might be useful to add that in the OK case, video and audio both play correctly. In the error (1, -2147483648) case, the same log is spewed from all devices (except Nexus One):
07-18 10:25:10.996: I/MediaPlayer(17860): uri is:http://s3-eu-west-1.amazonaws.com/cf-templates-k6ohn88yswx5-eu-west-1/videos/4fbc88e7e4b0b0896e877764/4fbfd5ece4b0932236fc234d.mp4
07-18 10:25:10.996: I/MediaPlayer(17860): path is null
07-18 10:25:10.996: D/MediaPlayer(17860): Couldn't open file on client side, trying server side
07-18 10:25:39.859: D/MediaPlayer(17860): getMetadata
07-18 10:25:45.070: E/MediaPlayer(17860): error (1, -2147483648)
07-18 10:25:45.074: E/MediaPlayer(17860): Error (1,-2147483648)
07-18 10:25:45.078: D/VideoView(17860): Error: 1,-2147483648
In the (1) case, the following log is spewed from Nexus One, and the video never loads:
07-18 13:49:20.115: D/MediaPlayer(10109): Couldn't open file on client side, trying server side
07-18 13:49:20.115: I/StagefrightPlayer(68): setDataSource('http://s3-eu-west-1.amazonaws.com/cf-templates-k6ohn88yswx5-eu-west-1/videos/4fbc88e7e4b0b0896e877764/4fbfd5ece4b0932236fc234d.mp4')
07-18 13:49:20.135: I/NuHTTPDataSource(68): connect to s3-eu-west-1.amazonaws.com:80/cf-templates-k6ohn88yswx5-eu-west-1/videos/4fbc88e7e4b0b0896e877764/4fbfd5ece4b0932236fc234d.mp4 #0
07-18 13:49:20.155: I/ActivityManager(98): Displayed com.woisio/.video.VideoActivity: +450ms
07-18 13:49:20.795: I/NuCachedSource2(68): Keep alive
07-18 13:49:22.185: I/OMXCodec(68): [OMX.qcom.video.decoder.avc] allocating 4 buffers of size 460800 on input port
07-18 13:49:22.195: I/OMXCodec(68): [OMX.qcom.video.decoder.avc] allocating 8 buffers of size 2304000 on output port
07-18 13:49:25.325: D/dalvikvm(9499): GC_EXPLICIT freed 13K, 50% free 2726K/5379K, external 1625K/2137K, paused 116ms
07-18 13:49:27.525: I/NuCachedSource2(68): Keep alive
07-18 13:49:28.235: I/NuCachedSource2(68): Cache full, done prefetching for now
07-18 13:49:30.275: D/dalvikvm(9902): GC_EXPLICIT freed 8K, 50% free 2714K/5379K, external 1625K/2137K, paused 69ms
07-18 13:49:34.255: D/Finsky(9066): [1] 5.onFinished: Installation state replication succeeded.
07-18 13:49:35.855: I/NuCachedSource2(68): Keep alive
07-18 13:49:39.055: D/dalvikvm(9911): GC_EXPLICIT freed 22K, 50% free 2710K/5379K, external 1625K/2137K, paused 38ms
07-18 13:49:42.575: I/NuCachedSource2(68): Keep alive
07-18 13:49:43.285: I/NuCachedSource2(68): Keep alive
07-18 13:49:44.095: D/dalvikvm(9918): GC_EXPLICIT freed 7K, 50% free 2708K/5379K, external 1625K/2137K, paused 66ms
07-18 13:49:49.085: D/dalvikvm(9925): GC_EXPLICIT freed 15K, 49% free 3268K/6407K, external 1625K/2137K, paused 50ms
07-18 13:49:50.925: I/NuCachedSource2(68): Keep alive
07-18 13:49:54.115: D/dalvikvm(6756): GC_EXPLICIT freed 9K, 44% free 3774K/6727K, external 1625K/2137K, paused 77ms
07-18 13:49:57.685: I/NuCachedSource2(68): Keep alive
07-18 13:49:58.375: I/NuCachedSource2(68): Keep alive
07-18 13:49:59.105: D/dalvikvm(9066): GC_EXPLICIT freed 385K, 53% free 3186K/6727K, external 1625K/2137K, paused 66ms
07-18 13:50:05.955: I/NuCachedSource2(68): Keep alive
07-18 13:50:06.045: D/dalvikvm(8047): GC_EXPLICIT freed 9K, 47% free 3830K/7111K, external 1625K/2137K, paused 86ms
07-18 13:50:09.465: I/3gw.Service(488): Mobile Network not connected - not roaming
07-18 13:50:12.765: I/NuCachedSource2(68): Keep alive
07-18 13:50:13.465: I/NuCachedSource2(68): Keep alive
07-18 13:50:18.775: I/WindowManager(98): Setting rotation to 3, animFlags=0
07-18 13:50:18.795: I/ActivityManager(98): Config changed: { scale=1.0 imsi=286/2 loc=en_US touch=3 keys=1/1/2 nav=3/1 orien=2 layout=34 uiMode=17 seq=34}
07-18 13:50:18.895: D/dalvikvm(169): GC_EXTERNAL_ALLOC freed 108K, 48% free 3253K/6215K, external 5172K/5180K, paused 37ms
07-18 13:50:21.005: I/NuCachedSource2(68): Keep alive
07-18 13:50:21.265: D/dalvikvm(98): GC_EXPLICIT freed 394K, 42% free 6631K/11335K, external 4458K/5567K, paused 109ms
In the (2) case, the following log is spewed from Nexus One and as you can see, ends with an error (1, -2147483648):
07-18 13:47:03.595: D/MediaPlayer(10059): Couldn't open file on client side, trying server side
07-18 13:47:03.595: I/StagefrightPlayer(68): setDataSource('http://s3-eu-west-1.amazonaws.com/cf-templates-k6ohn88yswx5-eu-west-1/videos/4ff4514444aec3d2f9f07ead/500416ea44aeb4b95d5ae8a0_hd.mp4')
07-18 13:47:03.605: I/NuHTTPDataSource(68): connect to s3-eu-west-1.amazonaws.com:80/cf-templates-k6ohn88yswx5-eu-west-1/videos/4ff4514444aec3d2f9f07ead/500416ea44aeb4b95d5ae8a0_hd.mp4 #0
07-18 13:47:03.625: I/ActivityManager(98): Displayed com.woisio/.video.VideoActivity: +505ms
07-18 13:47:05.355: I/OMXCodec(68): [OMX.qcom.video.decoder.avc] allocating 4 buffers of size 460800 on input port
07-18 13:47:05.355: I/OMXCodec(68): [OMX.qcom.video.decoder.avc] allocating 8 buffers of size 1382400 on output port
07-18 13:47:05.365: I/NuCachedSource2(68): Keep alive
07-18 13:47:08.375: D/MediaPlayer(10059): getMetadata
07-18 13:47:08.745: D/dalvikvm(9925): GC_EXPLICIT freed 651K, 49% free 3275K/6407K, external 1625K/2137K, paused 68ms
07-18 13:47:09.205: I/3gw.Service(488): Mobile Network not connected - not roaming
07-18 13:47:11.565: I/NuCachedSource2(68): Cache full, done prefetching for now
07-18 13:47:12.095: I/NuCachedSource2(68): Keep alive
07-18 13:47:14.245: W/QCvdec(68): H264_Utils::check_header
07-18 13:47:14.245: W/QCvdec(68): check_header: start code 33
07-18 13:47:14.245: W/QCvdec(68): H264_Utils::check_header
07-18 13:47:14.245: W/QCvdec(68): check_header: start code 10
07-18 13:47:14.245: W/QCvdec(68): Parsing Error unsupported profile or level
07-18 13:47:14.245: W/QCvdec(68): ETB in Invalid State
07-18 13:47:14.245: E/OMXCodec(68): [OMX.qcom.video.decoder.avc] ERROR(0x8000100a, 0)
07-18 13:47:14.245: E/MediaPlayer(10059): error (1, -2147483648)
07-18 13:47:14.285: E/MediaPlayer(10059): Error (1,-2147483648)
07-18 13:47:14.285: D/VideoView(10059): Error: 1,-2147483648
From what I have read, the error (1, -2147483648) may correspond to unsupported codecs, corrupt metadata or incorrect file headers. If it is so, could you point me in the right direction as to use which codec? Thanks.

Just to clarify something for anyone reading this question based on the title.
When looking at the error value (1, -2147483648), the '1' value corresponds to the constant in MediaPlayer.MEDIA_ERROR_UNKNOWN.
-2147483648 corresponds to hexadecimal 0x80000000 which is defined as UNKNOWN_ERROR in frameworks/native/include/utils/Errors.h
This shows that the error's source is hard to pin down as it is quite a generic return value, thrown by codec and compatibility issues as mentioned above but also thread cancellations and several other types.
For your issue, I would recommend consulting the Android Supported Media Formats with compatible Android versions and see if the encoding type is the cause of your problem, but as mentioned above the Unknown Error response can be caused by a number of problems.

I was facing the same error on Android P (Pixel 2 XL), but all I had to do was put android:usesCleartextTraffic="true" on my AndroidManifest.xml application tag.

For streaming, the Android site has a note:
For 3GPP and MPEG-4 containers, the moov atom must precede any mdat
atoms, but must succeed the ftyp atom.
I got the same error before moving the moov atom. In order to fix this, you can use mp4Box with this command:
MP4Box -hint output.mp4
Most of my videos can stream after that. If it does not work, try this with ffmpeg:
ffmpeg -i input.flv -f mp4 -vcodec libx264 -vprofile baseline -acodec libfaac -ar 16k -ab 32k output.mp4
MP4Box -hint output.mp4
There are other tools you can find here.

I am also getting same MEDIA_ERROR_UNKNOWN error issue for playing video(rtsp).
In my case I am finding issue with my wifi. Some security reasons wifi is restricted for RTSP protocol. So that I'm facing this MEDIA_ERROR_UNKNOWN error issue. Once check with your network permissions.
When I am moving to mobile data for playing video it's working fine for me.
May be this will be helpful whoever facing same kind of error :).

Take care of the support media type and resolution of your device.
Error error (1, -2147483648) often, appear when your video media type, codecs, or resolution is not supported by your device.
Checkout the media type supported by Android in the documentation :
https://developer.android.com/guide/appendix/media-formats.html
For example, we can notice that device above 3.0 support .mp4, but not all of them support HD 720p.

If you are using MediaPlayer for playing audio, this was the case of error for me:
When performing .setDataSource() the argument I passed was a string with path to the given file. This results in all kind of exceptions I havent been able to find particular reasons for. However, when changed to FileDescriptor, according to Android Developers - .setDataSource() method, its sorted out.
I am getting the FileDescriptor object from FileInputStream.
Here is the code:
val player: MediaPlayer = MediaPlayer()
fun playRecording() {
try {
replayFileStream = FileInputStream(path)
val fd = replayFileStream?.fd
player.setDataSource(fd)
player.prepareAsync()
// start should be called from onPreparedListener
} catch (e: Exception) {
// catch exceptions
}
}
The actual start of the playback is handled in OnPreparedListener as suggested for example here: Android Media Player: Start called in state 4 error(-38,0)
.
The listener setup is following:
player.setOnPreparedListener(object: MediaPlayer.OnPreparedListener {
override fun onPrepared(player:MediaPlayer) {
player.start()
}
})
android kotlin mediaplayer

I had a similar issue. In my case the video would play fine when I downloaded it to the phone first and then played it. But when I tried to use Progressive HTTP I would get the same error noted in the OP.
I verified that the ftyp, moov and mdat atoms were in the correct order. It turned out that the problem was the the value of the ftyp field. It was set to 'qt '. I used MP4Box to extract the tracks and create a new mp4 file which had the ftyp set to 'isom'. This new file worked fine for Progressive HTTP.

I resolved this similarly to the way stated in #nam-trung's answer, however as my videos were already h264 and mp4 all I needed to do was run the following on each file:
ffmpeg -i input.mp4 -vprofile baseline output.mp4
After that, the videos all worked in VideoView when run on all devices I've tested on running API v19 through v25.

In my case the error was due to the mediaplayer not having file permissions on the locally stored video. Try storing the video onto the /mnt/sdCARD directory.

I was facing the same issue ,But what i did on my side is
Firstly i stop the media player and then Released it.
mMediaPlayer.stop();
mMediaPlayer.release();

In my case, I had Gzip Compression on the web address where the url info is. Compressed media files may not be decoded on android.

In my case, this problem was caused by a media URL with spaces! Here is the fix:
mMediaPlayer.setDataSource(source.replaceAll(" ", "%20"));

if you are using firebase , then you should copy the path(or url) from 1: Download Url which contains the https://firebasestorage.............
not from the storage location
2 : <uses-permission android:name="android.permission.INTERNET" />add this permission in manifest tag inside manifest folder
inside Rules of storage
inside Rules of storage :
rules_version = '2';
service firebase.storage {
match /b/{bucket}/o {
match /{allPaths=**} {
allow read, write: if true;
}
}
}

Related

How to make exoplayer play the video from Drive

Currently, I am trying to play a video from the web. I tried many ways to play a video from the web but nothing worked. I first used videoView and I was always saying that the video file can not be played. The link doesn't really have to be from Drive or to use the method I use right now. I just need to make it work.
Here is what the code looks like right now:
String url = "https://drive.google.com/file/d/1CRJ8tL-DyjD0Nwd7ezkboGm6570zMf4C/view?usp=sharing";
#Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_starter_yoga);
findViewById(R.id.backY).setOnClickListener(v -> {
onBackPressed();
});
SimpleExoPlayer simpleExoPlayer = new SimpleExoPlayer.Builder(this).build();
PlayerView playerView = findViewById(R.id.SY);
playerView.setPlayer(simpleExoPlayer);
MediaItem mediaItem = MediaItem.fromUri(url);
simpleExoPlayer.addMediaItem(mediaItem);
simpleExoPlayer.prepare();
simpleExoPlayer.play();
}
Manifest:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
android:usesCleartextTraffic="true"
Error:
2021-08-30 15:37:32.662 4582-6879/? E/TaskPersister: File error accessing recents directory
(directory doesn't exist?).
2021-08-30 15:37:35.676 4130-4254/? E/Netd: getNetworkForDns: getNetId from enterpriseCtrl
is
netid 0
2021-08-30 15:37:35.708 4130-4260/? E/Netd: getNetworkForDns: getNetId from enterpriseCtrl is netid 0
2021-08-30 15:37:35.778 4164-4184/? E/HYPER-HAL: [Request.cpp]acquire(): Request:: id :
10586920, No Resource to set
2021-08-30 15:37:36.179 4219-4242/? E/BufferQueueProducer:
[com.example.diligent/com.diligent_app.diligent.yoga.Yoga$_20925#0](id:107b0000491d,api:0,p:-1,c:4219) disconnect: not connected
2021-08-30 15:37:36.526 3933-3933/? E/vold: getUsedF2fsFileNode -> Cannot Get Used FileNode Number (errno=25 Inappropriate ioctl for device)
2021-08-30 15:37:36.718 20925-23908/com.example.diligent E/ExoPlayerImplInternal: Playback error
com.google.android.exoplayer2.ExoPlaybackException: Source error
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleIoException(ExoPlayerImplInternal.java:624)
at com.google.android.exoplayer2.ExoPlayerImplInternal.handleMessage(ExoPlayerImplInternal.java:594)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:246)
at android.os.HandlerThread.run(HandlerThread.java:67)
Caused by: com.google.android.exoplayer2.source.UnrecognizedInputFormatException: None of the available extractors (FlvExtractor, FlacExtractor, WavExtractor, FragmentedMp4Extractor, Mp4Extractor, AmrExtractor, PsExtractor, OggExtractor, TsExtractor, MatroskaExtractor, AdtsExtractor, Ac3Extractor, Ac4Extractor, Mp3Extractor, JpegExtractor) could read the stream.
at com.google.android.exoplayer2.source.BundledExtractorsAdapter.init(BundledExtractorsAdapter.java:92)
at com.google.android.exoplayer2.source.ProgressiveMediaPeriod$ExtractingLoadable.load(ProgressiveMediaPeriod.java:1025)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:409)
Replace the URL format like this:
String videoURL = "https://drive.google.com/u/1/uc?id=1hMzertAC6ap31Xup6_B0fJP-fbZP7GFX&export=download";
Where 1hMzertAC6ap31Xup6_B0fJP-fbZP7GFX is your video ID.
From the error, the problem is likely that the device does not support the video encoding.
From ffprobe (https://ffmpeg.org/ffprobe.html):
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from '/y_v_starter_yoga.mp4':
Metadata:
major_brand : isom
minor_version : 512
compatible_brands: isomiso2avc1mp41
encoder : Lavf58.29.100
Duration: 00:06:00.02, start: 0.000000, bitrate: 860 kb/s
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, bt709), 1080x2260 [SAR 1:1 DAR 54:113], 839 kb/s, 20 fps, 20 tbr, 10240 tbn, 40 tbc (default)
Metadata:
handler_name : VideoHandler
Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 14 kb/s (default)
Metadata:
handler_name : SoundHandler
You can see it is using 'High' Profile which many Android devices will not support - see here for the standard media support:
https://developer.android.com/guide/topics/media/media-formats
If you can re encode it using baseline profile you can verify this is the issue.
If you want to see working examples of ExoPlayer playing web video, ExoPlayer's own sample player includes these. You can also edit the samples JSON Media list to add in your own video links and test them directly with the ExoPlayer sample player.

Android Application crashing on Lg G2 but not on other phones [duplicate]

This question already has answers here:
Android - Signal 11, RS CPP error: Blur radius out of 0-25 pixel bound
(3 answers)
Closed 4 years ago.
So, I have an aplication that executes asynk task and on post execute it generates a listview.
After the json is recieved the app crashes on a LG G2 but not on other phones.
My Log cat is giving this report:
10-09 13:45:47.066: E/Entity Response :(16241): [{"id":"440","name":"Amici's East Coast Pizzeria","address":"226 Redwood Shores Pkwy, Redwood City, CA","lat":"37.5205","lng":"-122.252","promotype":"0.10","tipo":"Cabeleireiros","foto":"http:\/\/s1.postimg.org\/526tyzobj\/image.jpg","distance":"62.03","ranking":"6.202501588797353"},{"id":"446","name":"Applewood Pizza 2 Go","address":"1001 El Camino Real, Menlo Park, CA","lat":"37.453","lng":"-122.182","promotype":"0.50","tipo":"Cabeleireiros","foto":"http:\/\/s27.postimg.org\/yth8q6mb7\/image.jpg","distance":"52.89","ranking":"26.442939242734457"},{"id":"453","name":"Giorgio's","address":"1445 Foxworthy Ave, San Jose, CA","lat":"37.2746","lng":"-121.893","promotype":"1.00","tipo":"Cabeleireiros","foto":"http:\/\/s10.postimg.org\/lk0r9tbsp\/a_A.jpg","distance":"31.97","ranking":"31.973513511004338"},{"id":"447","name":"Pizza Antica","address":"334 Santana Row # 1065, San Jose, CA","lat":"37.3218","lng":"-121.948","promotype":"1.00","tipo":"Cabeleireiros","foto":"http:\/\/s11.postimg.org\/gt2rkwr8j\/image.jpg","distance":"36.08","ranking":"36.07806101584471"},{"id":"452","name":"Tony & Alba's Pizza & Pasta","address":"3137 Stevens Creek Blvd, San Jose, CA","lat":"37.3233","lng":"-121.952","promotype":"1.00","tipo":"Cabeleireiros","foto":"http:\/\/s11.postimg.org\/gt2rkwr8j\/image.jpg","distance":"36.20","ranking":"36.199980176527895"},{"id":"449","name":"House of Pizza","address":"527 S Almaden Ave, San Jose, CA","lat":"37.3264","lng":"-121.888","promotype":"1.00","tipo":"Cabeleireiros","foto":"http:\/\/s29.postimg.org\/9yarz4nmv\/image.jpg","distance":"37.63","ranking":"37.62658687732519"},{"id":"450","name":"Amici's East Coast Pizzeria","address":"225 W Santa Clara St, San Jose, CA","lat":"37.3347","lng":"-121.894","promotype":"1.00","tipo":"Cabeleireiros","foto":"http:\/\/s1.postimg.org\/526tyzobj\/image.jpg","distance":"38.38","ranking":"38.38406330985574"},{"id":"309","name":"Round Table Pizza: Sunnyvale-Mary-Central Expy","address":"415 N Mary Ave, Sunnyvale, CA","lat":"37.39","lng":"-122.042","promotype":"1.00","tipo":"Cabeleireiros","foto":"http:\/\/s1.postimg.org\/526tyzobj\/image.jpg","distance":"43.53","ranking":"43.52522799537428"},{"id":"303","name":"Frankie Johnnie & Luigo Too","address":"939 W El Camino Real, Mountain View, CA","lat":"37.3863","lng":"-122.086","promotype":"1.00","tipo":"Cabeleireiros","foto":"http:\/\/s29.postimg.org\/9yarz4nmv\/image.jpg","distance":"43.62","ranking":"43.62472294523851"},{"id":"305","name":"Kapp's Pizza Bar & Grill","address":"191 Castro St, Mountain View, CA","lat":"37.3939","lng":"-122.079","promotype":"1.00","tipo":"Cabeleireiros","foto":"http:\/\/s27.postimg.org\/yth8q6mb7\/image.jpg","distance":"44.36","ranking":"44.3553242060947"},{"id":"306","name":"Round Table Pizza: Mountain View","address":"570 N Shoreline Blvd, Mountain View, CA","lat":"37.4027","lng":"-122.079","promotype":"1.00","tipo":"Cabeleireiros","foto":"http:\/\/s11.postimg.org\/gt2rkwr8j\/image.jpg","distance":"45.32","ranking":"45.32142235623846"},{"id":"308","name":"Oregano's Wood-Fired Pizza","address":"4546 El Camino Real, Los Altos, CA","lat":"37.4017","lng":"-122.115","promotype":"1.00","tipo":"Cabeleireiros","foto":"http:\/\/s29.postimg.org\/9yarz4nmv\/image.jpg","distance":"45.81","ranking":"45.8134266627868"},{"id":"443","name":"Pizz'a Chicago","address":"4115 El Camino Real, Palo Alto, CA","lat":"37.4141","lng":"-122.126","promotype":"1.00","tipo":"Cabeleireiros","foto":"http:\/\/s10.postimg.org\/lk0r9tbsp\/a_A.jpg","distance":"47.38","ranking":"47.37868781103179"},{"id":"444","name":"California Pizza Kitchen","address":"531 Cowper St, Palo Alto, CA","lat":"37.4481","lng":"-122.159","promotype":"1.00","tipo":"Cabeleireiros","foto":"http:\/\/s29.postimg.org\/9yarz4nmv\/image.jpg","distance":"51.78","ranking":"51.77711350584475"},{"id":"441","name":"North Beach Pizza","address":"240 E 3rd Ave, San Mateo, CA","lat":"37.5653","lng":"-122.323","promotype":"1.00","tipo":"Cabeleireiros","foto":"http:\/\/s27.postimg.org\/yth8q6mb7\/image.jpg","distance":"69.05
10-09 13:46:54.676: D/dalvikvm(16241): GC_FOR_ALLOC freed 455K, 32% free 17111K/25000K, paused 15ms, total 15ms
10-09 13:46:54.696: I/dalvikvm-heap(16241): Grow heap (frag case) to 28.377MB for 9849616-byte allocation
10-09 13:46:54.816: V/RenderScript(16241): Application requested CPU execution
10-09 13:46:54.826: V/RenderScript(16241): 0x61248f10 Launching thread(s), CPUs 4
10-09 13:46:54.836: E/rsC++(16241): RS CPP error: Blur radius out of 0-25 pixel bound
10-09 13:46:54.836: E/rsC++(16241): RS CPP error (masked by previous error): Allocation creation failed
10-09 13:46:54.836: E/rsC++(16241): RS CPP error (masked by previous error): Allocation creation failed
10-09 13:46:54.836: A/libc(16241): Fatal signal 11 (SIGSEGV) at 0x00000028 (code=1), thread 16241
(le.dbjsonstring)
10-09 13:51:59.936: D/HyLog(20453): I : /data/font/config/dfactpre.dat, No such file or directory (2)
10-09 13:52:00.046: D/dalvikvm(20453): GC_FOR_ALLOC freed 85K, 16% free 21227K/25000K, paused 12ms, total 12ms
10-09 13:52:00.046: I/dalvikvm-heap(20453): Grow heap (frag case) to 30.101MB for 7441936-byte allocation
10-09 13:52:00.186: D/dalvikvm(20453): GC_FOR_ALLOC freed 1K, 12% free 28494K/32268K, paused 14ms, total 14ms
10-09 13:52:00.206: I/dalvikvm-heap(20453): Grow heap (frag case) to 49.578MB for 20422912-byte allocation
10-09 13:52:00.406: I/Adreno-EGL(20453): <qeglDrvAPI_eglInitialize:385>: EGL 1.4 QUALCOMM build: ()
10-09 13:52:00.406: I/Adreno-EGL(20453): OpenGL ES Shader Compiler Version: E031.24.00.02
10-09 13:52:00.406: I/Adreno-EGL(20453): Build Date: 01/20/14 Mon
10-09 13:52:00.406: I/Adreno-EGL(20453): Local Branch: PMH2-KK_3.5-RB1-AU61-554722-586267-set2
10-09 13:52:00.406: I/Adreno-EGL(20453): Remote Branch:
10-09 13:52:00.406: I/Adreno-EGL(20453): Local Patches:
10-09 13:52:00.406: I/Adreno-EGL(20453): Reconstruct Branch:
10-09 13:52:00.426: D/OpenGLRenderer(20453): Enabling debug mode 0
10-09 13:52:00.666: I/ActivityManager(20453): Timeline: Activity_idle id: android.os.BinderProxy#428d7ac8 time:183390382
What can it be?
Encountered the issue and I found this post. After experimenting sometime, I found out the exact solution of this problem. Though its very late, but i am posting it here for future help of others.
The problem is self-explanatory.
E/rsC++(16241): RS CPP error: Blur radius out of 0-25 pixel bound
Setting a shadowRadius larger than 25px on a View will crash your app with a segmentation fault. This is due to RenderScript, more specifically ScriptIntrinsicBlur.
More from here: https://developer.android.com/reference/android/renderscript/ScriptIntrinsicBlur.html#setRadius(float)
So use shadowRadius value less than 25px and the problem will be resolved.
So, After a while I found that the problem is on the shadow radius of a textview.
After removing that shaddow it runned great. The strange thing is that the app was running on 3 differente phones and one tablet.
Well, I'll continue my journey through android lolol

ts file not playing in android tablet

I am trying to play a file i have recorded. The file plays well in vlc(linux pc) and in Moboplayer(android tablet). While using the default player in the android tablet it shows this in logcat.
I/ActivityManager( 201): START {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.example.mymediaplayer/.MyVideoView bnds=[656,246][752,342]} from pid 417
I/System.out(20286): MyVideoView.onCreate()
I/System.out(20286): MyVideoView.onResume()
V/TabletStatusBar( 281): setLightsOn(true)
I/AwesomePlayer( 141): setDataSource_l('/sdcard/video/TunerOut.ts')
I/avc_utils( 141): found AVC codec config (720 x 480, Baseline-profile level 3.1)
I/MPEG2TSExtractor( 141): haveAudio=1, haveVideo=1
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.TI.DUCATI1.VIDEO.DECODER'
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.Nvidia.h264.decode'
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.qcom.7x30.video.decoder.avc'
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.qcom.video.decoder.avc'
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.TI.Video.Decoder'
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.SEC.AVC.Decoder'
E/OMXCodec( 141): Successfully allocated OMX node 'OMX.SEC.AVC.Decoder'
I/OMXCodec( 141): [OMX.SEC.AVC.Decoder] AVC profile = 66 (Baseline), level = 31
E/OMXCodec( 141): [OMX.SEC.AVC.Decoder] Video O/P format.eColorFormat 0x40b452b1
I/OMXCodec( 141): [OMX.SEC.AVC.Decoder] video dimensions are 720 x 480
D/OpenGLRenderer( 417): Flushing caches (mode 1)
I/ActivityManager( 201): Displayed com.example.mymediaplayer/.MyVideoView: +323ms
W/InputManagerService( 201): Starting input on non-focused client com.android.internal.view.IInputMethodClient$Stub$Proxy#4106dc38 (uid=10036 pid=20503)
W/IInputConnectionWrapper(20503): showStatusIcon on inactive InputConnection
E/OMXCodec( 141): Attempting to allocate OMX node 'OMX.Nvidia.mp2.decoder'
**E/MediaPlayer(20286): error (1, -2147483648)
E/MediaPlayer(20286): Error (1,-2147483648)
D/VideoView(20286): Error: 1,-2147483648**
D/OpenGLRenderer( 417): Flushing caches (mode 0)
W/InputManagerService( 201): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#41033300
D/AudioHardware( 141): AudioHardware pcm playback is going to standby.
what is error 1,-2147483648
I just had that error too. The reason (in my case) was that the mp3 has the wrong format, i.e.
MPEG ADTS, layer II, v1, 192 kbps, 44.1 kHz, Stereo
while a "good" mp3 has this format:
MPEG ADTS, layer III, v1, 128 kbps, 44.1 kHz, JntStereo

Adobe Air Camera Issue

Dont know if anyone has come across this issue but I am creating an app for mobile devices and it runs fine on my galaxy s2 running ics 4.0.4 however when I run it on the galaxy tab running 2.3.3 it keeps throwing errors.
All that I am doing is getting the device camera and attaching it to a flash.media.Video. I have the suspicion that the amount of errors caused by this issues is severly affecting the perfomance.
I have attached an fxp file ( https://www.box.com/s/77a9460edcf8a7ce95ee ) so that you can see that I am not doing anything out of the ordinary.
THanks for your help!
P.S.
Here is a sample segment of the logcat-
D/TvOut-Engine( 79): (isHdmiCableConnected): mHdmiCableConnected 0
D/CameraHardwareSec( 75): MemoryHeapBase(fd(26), size(5760128), width(800), height(600))
W/AudioFlinger( 75): RecordThread: buffer overflow
D/dalvikvm(12597): GC_FOR_MALLOC freed 1206K, 48% free 4217K/8007K, external 4034K/4493K, paused 91ms
V/AudioHardwareALSA( 75): resampler read error -32
D/AudioHardwareALSA( 75): AudioStreamInALSA::read error -32
D/AudioHardwareALSA( 75): AudioStreamInALSA::snd_pcm_recover error 0
E/v4l2_utils( 75): Error = Invalid argument from qbuf
E/CameraHardwareSec( 75): ERR(int android::CameraHardwareSec::previewThread()):overlay queueBuffer fail
I/dalvikvm-heap(12597): Grow heap (frag case) to 16.060MB for 5760016-byte allocation
D/dalvikvm(12597): GC_FOR_MALLOC freed 203K, 30% free 9638K/13639K, external 3975K/4493K, paused 26ms
E/v4l2_utils( 75): Error = Invalid argument from qbuf
E/CameraHardwareSec( 75): ERR(int android::CameraHardwareSec::previewThread()):overlay queueBuffer fail
D/dalvikvm(12597): GC_CONCURRENT freed 91K, 31% free 9547K/13639K, external 3975K/4493K, paused 2ms+13ms
D/dalvikvm(12597): GC_FOR_MALLOC freed 76K, 31% free 9471K/13639K, external 3975K/4493K, paused 43ms
E/v4l2_utils( 75): Error = Invalid argument from qbuf
E/CameraHardwareSec( 75): ERR(int android::CameraHardwareSec::previewThread()):overlay queueBuffer fail
I/dalvikvm-heap(12597): Grow heap (frag case) to 21.133MB for 5760016-byte allocation
E/v4l2_utils( 75): Error = Invalid argument from qbuf
E/CameraHardwareSec( 75): ERR(int android::CameraHardwareSec::previewThread()):overlay queueBuffer fail

Can't play mp4 video in my Android app

I very want to play mp4 video in my android app. I even wrote a bit of code for it:
String sourceUrl = "http://tvstream.cn.ru/storage/1kanal/20120530/"
+ "1kanal-20120530-01-14-00-20120530-03-16-00.mp4";
final VideoView videoView = (VideoView) findViewById(R.id.videoView);
getWindow().setFormat(PixelFormat.TRANSLUCENT);
final MediaController mediaController = new MediaController(this);
mediaController.setMediaPlayer(videoView);
videoView.setMediaController(mediaController);
videoView.setVideoURI(Uri.parse(sourceUrl));
videoView.setOnPreparedListener(new OnPreparedListener() {
public void onPrepared(MediaPlayer mp) {
videoView.requestFocus();
videoView.start();
mediaController.show();
}
});
But nothing works :( When I launch my app in emulator (Android 2.3.3) I've got weird stacktrace with some common error codes:
After few hours off googling and experiments I decided to try to launch my app on real device and watch logcat:
D/test.tv.activity.PlayerActivity( 3428): Player source: http://tvstream.cn.ru/storage/1kanal/20120530/1kanal-20120530-01-14-00-20120530-03-16-00.mp4
D/VideoView( 3428): onMeasure()
I/VideoView( 3428): Setting size: 320x430
I/Launcher( 260): onWindowFocusChanged(false)
D/Launcher( 260): setWallpaperDimension() called
D/Launcher( 260): USE_NON_SCROLLABLE_IMAGE_WALLPAPER is true
I/ActivityManager( 163): Start proc org.reactivephone for broadcast org.reactivephone/ru.yandex.common.clid.ClidBroadcastReceiver: pid=3448 uid=10073 gids={1015, 3003}
I/ActivityManager( 163): No longer want com.sec.android.provider.badge (pid 2310): hidden #16
I/MediaPlayer( 3428): uri is:http://tvstream.cn.ru/storage/1kanal/20120530/1kanal-20120530-01-14-00-20120530-03-16-00.mp4
I/MediaPlayer( 3428): path is null
D/MediaPlayer( 3428): Couldn't open file on client side, trying server side
D/Launcher( 260): It's image wallpaper. suggestDesiredDimensions(-1,-1)
I/ActivityManager( 163): Displayed test.tv/.activity.PlayerActivity: +943ms
D/VideoView( 3428): onMeasure()
I/VideoView( 3428): Setting size: 320x430
W/dalvikvm( 3406): threadid=5: spin on suspend #1 threadid=22 (pcf=0)
W/dalvikvm( 3406): threadid=5: spin on suspend resolved in 1154 msec
W/SearchableInfo( 163): Invalid searchable metadata for org.reactivephone/.ui.RegionForm: Search label must be a resource reference.
I/ActivityManager( 163): Start proc com.google.android.googlequicksearchbox for broadcast com.google.android.googlequicksearchbox/.SourceUpdateReceiver: pid=3457 uid=10027 gids={3003}
I/WindowOrientationListener( 163): orientation 295.6932 gives new rotation = 2
I/OrientationDebug( 163): [pwm] in MyOrientationListener.onOrientationChanged() rotation=3 mFancyRotationAnimation=0 now call mWindowManager.setRotation()
I/OrientationDebug( 163): [wms] in setRotation() rotation=3 alwaysSendConfiguration=false animFlags=0
I/OrientationDebug( 163): [wms] in setRotation() now call setRotationUnchecked()
I/WindowManager( 163): Setting rotation to 3, animFlags=0
I/ActivityManager( 163): Config changed: { scale=1.0 imsi=250/1 loc=ru_RU touch=3 keys=1/1/2 nav=1/1 orien=2 layout=18 uiMode=17 seq=7}
D/PhoneApp( 241): updateProximitySensorMode: lock already released.
I/ActivityThread( 3457): Pub com.google.android.googlequicksearchbox.shortcuts: com.google.android.googlequicksearchbox.WebHistoryProvider
I/ActivityThread( 3457): Pub com.google.android.googlequicksearchbox.google: com.google.android.googlequicksearchbox.google.GoogleSuggestionProvider
I/ActivityManager( 163): No longer want com.sec.android.widgetapp.clockweather.clockwidget (pid 1214): hidden #16
D/Finsky ( 3406): [1] 2.run: Loaded library for account: [Y091GklnFtI4Ab1gmLOw-nJkJXQ]
D/Finsky ( 3406): [1] 2.run: Finished loading 1 libraries.
W/dalvikvm( 3406): VFY: unable to resolve instance field 78
D/DfeApi ( 3406): [1] DfeApiContext.getSmallestScreenWidthDp: smallestScreenWidthDp does not exist, using pre-ics hack.
E/QCvdec ( 95): Setparameter: unknown param 2130706451
W/TimedEventQueue( 95): Event 3 was not found in the queue, already cancelled?
E/QCvdec ( 95): Omx Flush issued when vdec is not initialized yet.
W/QCvdec ( 95): ======================================================================
W/QCvdec ( 95): Open Max Statistics
W/QCvdec ( 95): ======================================================================
W/QCvdec ( 95): empty this buffer rate = NaN
W/QCvdec ( 95): empty this buffer total time = 0
W/QCvdec ( 95): empty this buffer count = 0
W/QCvdec ( 95): ======================================================================
D/test.tv.activity.PlayerActivity( 3428): Player source: http://tvstream.cn.ru/storage/1kanal/20120530/1kanal-20120530-01-14-00-20120530-03-16-00.mp4
D/VideoView( 3428): onMeasure()
I/VideoView( 3428): Setting size: 480x270
I/MediaPlayer( 3428): uri is:http://tvstream.cn.ru/storage/1kanal/20120530/1kanal-20120530-01-14-00-20120530-03-16-00.mp4
I/MediaPlayer( 3428): path is null
D/MediaPlayer( 3428): Couldn't open file on client side, trying server side
D/VideoView( 3428): onMeasure()
I/VideoView( 3428): Setting size: 480x270
D/WifiService( 163): [mPersistState] : On
D/BatteryService( 163): update start
D/BatteryService( 163): update start
D/BatteryService( 163): update start
E/QCvdec ( 95): Setparameter: unknown param 2130706451
I/VideoView( 3428): start()
D/WifiService( 163): [mPersistState] : On
D/WifiService( 163): [mPersistState] : On
D/WifiWatchdogService( 163): (android.server.ServerThread) wntk (1c:af:f7:2e:7f:c8) does not require the watchdog
E/QCvdec ( 95): Unsupported profile, level, or widht, height
E/QCvdec ( 95): Unsupported clip
E/QCvdec ( 95): Unsupported profile, level, or widht, height
E/QCvdec ( 95): Unsupported clip
E/QCvdec ( 95): Omx Flush issued when vdec is not initialized yet.
E/QCvdec ( 95): Omx Flush issued when vdec is not initialized yet.
E/QCvdec ( 95): Empty this buffer in Invalid State
E/OMXCodec( 95): [OMX.qcom.video.decoder.avc] ERROR(0x8000100a, 0)
E/OMXCodec( 95): [OMX.qcom.video.decoder.avc] ERROR(0x8000100a, 0)
E/OMXCodec( 95): read : mState[9] is wrong...
E/MediaPlayer( 3428): error (1, -2147483648)
E/OMXCodec( 95): [OMX.qcom.video.decoder.avc] ERROR(0x8000100a, 0)
E/QCvdec ( 95): Omx Flush issued when vdec is not initialized yet.
D/VideoView( 3428): onMeasure()
I/VideoView( 3428): Setting size: 335x270
I/VideoView( 3428): start()
E/MediaPlayer( 3428): start called in state 0
E/MediaPlayer( 3428): error (-38, 0)
E/MediaPlayer( 3428): Error (1,-2147483648)
D/VideoView( 3428): Error: 1,-2147483648
E/MediaPlayer( 3428): Error (-38,0)
D/VideoView( 3428): Error: -38,0
D/PowerManagerService( 163): reactivateScreenLocksLocked mProxIgnoredBecauseScreenTurnedOff=false
I/PowerManagerService( 163): Ulight 1->3|0
W/InputManagerService( 163): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#40873ab8
I/PowerManagerService( 163): Light Animator Finished curIntValue=141
D/Finsky ( 3406): [1] 5.onFinished: Installation state replication succeeded.
D/BatteryService( 163): update start
D/BatteryService( 163): update start
D/BatteryService( 163): update start
I try to find something about "OMX.qcom.video.decoder.avc] ERROR(0x8000100a, 0)", but didn't find nothing interesting. About "Couldn't open file on client side, trying server side" problem stackoverflow has many answers, but no one helped.
When I launch this app on ICS (in emulator) I've got similar errors:
06-01 10:22:14.674: I/NuCachedSource2(37): ERROR_END_OF_STREAM
06-01 10:22:15.375: I/OMXCodec(37): [OMX.google.h264.decoder] AVC profile = 100 (High), level = 30
06-01 10:22:15.384: I/OMXCodec(37): [OMX.google.h264.decoder] video dimensions are 320 x 240
06-01 10:22:15.384: I/OMXCodec(37): [OMX.google.h264.decoder] Crop rect is 320 x 240 # (0, 0)
06-01 10:22:16.253: W/NetworkManagementSocketTagger(89): setKernelCountSet(10013, 0) failed with errno -2
06-01 10:22:16.374: I/Launcher(553): setLoadOnResume
06-01 10:22:16.584: D/MediaPlayer(602): getMetadata
06-01 10:22:16.614: I/NuCachedSource2(37): new range: offset= 0
06-01 10:22:16.694: I/ChromiumHTTPDataSource(37): connect to http://tvstream.cn.ru/storage/1kanal/20120530/1kanal-20120530-01-14-00-20120530-03-16-00.mp4 #0
06-01 10:22:16.834: E/SoftAVC(37): Decoder failed: -2
06-01 10:22:16.844: E/OMXCodec(37): [OMX.google.h264.decoder] ERROR(0x80001001, -1007)
06-01 10:22:16.884: D/AudioSink(37): bufferCount (4) is too small and increased to 12
As I know, Android supports playback of video decoded with h264 (http://developer.android.com/guide/appendix/media-formats.html). So, can anyone tell me what I do wrong.
Probably your file is using an unsupported profile, notice that official media formats page only lists Baseline Profile as supported for H.264 AVC.
Try transcoding the video specifying Baseline Profile as suggested in this stackoverflow question, i.e. if your container is MP4 run:
ffmpeg -i yourfile.mp4 -c:v libx264 -profile:v baseline -level 1 yourfile_BaselineProfile.mp4
If this works it's not a issue in your code, you just have to use supported formats.
Try this
File clip=new File(Environment.getExternalStorageDirectory(),
"test.mp4");
if (clip.exists()) {
video=(VideoView)findViewById(R.id.video);
video.setVideoPath(clip.getAbsolutePath());
ctlr=new MediaController(this);
ctlr.setMediaPlayer(video);
video.setMediaController(ctlr);
video.requestFocus();
video.start();
VideoView classes does not allow playing MP4 file format videos. Please go through this link for Android Media Formats. Try checking your video with Daroon Player

Categories

Resources