I have an Android app that uses the MediaPlayer component to play movies.
It works fine with all the Android devices, except on the Kindle Fire HD (and probably other Amazon devices as well as I haven't had the chance to test on others).
On the Kindle logcat prints the following output:
09-02 09:37:46.971 23979-23979/it.hearst.elledecortest I/VideoControllerView: VideoControllerView
09-02 09:37:46.971 23979-23979/it.hearst.elledecortest I/VideoControllerView: VideoControllerView
09-02 09:37:46.986 23979-23979/it.hearst.elledecortest D/MovieViewController: onViewAttachedToWindow
09-02 09:37:47.010 108-108/? E/ASFDummyExtractor: isASFParserAvailable
09-02 09:37:47.010 108-108/? W/ASFDummyExtractor: ASF parser is not available
09-02 09:37:47.010 108-108/? I/AwesomePlayer: Awsomeplayer is created
09-02 09:37:47.010 108-108/? I/AwesomePlayer: board file present
09-02 09:37:47.010 108-108/? I/AwesomePlayer: cabc present
09-02 09:37:47.010 108-108/? I/AwesomePlayer: setCabc file open !
09-02 09:37:47.010 108-108/? I/AwesomePlayer: setCabc ret = -22
09-02 09:37:47.010 108-108/? I/AwesomePlayer: cabc present
09-02 09:37:47.010 108-108/? I/AwesomePlayer: setCabc file open !
09-02 09:37:47.010 108-108/? I/AwesomePlayer: setCabc ret = -22
09-02 09:37:47.010 108-24246/? I/AwesomePlayer: cabc present
09-02 09:37:47.010 108-24246/? I/AwesomePlayer: setCabc file open !
09-02 09:37:47.010 108-24246/? I/AwesomePlayer: setCabc ret = -22
09-02 09:37:47.010 23979-23989/it.hearst.elledecortest E/MediaPlayer: error (1, -2147483648)
09-02 09:37:47.119 23979-23979/it.hearst.elledecortest E/MediaPlayer: Error (1,-2147483648)
09-02 09:37:47.142 23979-23979/it.hearst.elledecortest E/MediaPlayer: prepareAsync called in state 0
Anyone who has any insights on what could be going on?
Thanks!
error (1, -2147483648) is the general error for MediaPlayer. Oftenly, this error is associated to a non-readable file.
You should try reading this file with a file explorer
Hope it helps
Related
my app is stoped in splash with message error in console:
09-02 23:26:29.099 3684-3684/? I/zygote: Not late-enabling -Xcheck:jni (already on)
09-02 23:26:29.117 3684-3684/? W/zygote: Unexpected CPU variant for X86 using defaults: x86
09-02 23:26:29.253 3684-3684/com.x.X k E/com.facebook.internal.AttributionIdentifiers: getAttributionIdentifiers should not be called from the main thread
09-02 23:26:29.275 3684-3700/com.x.X k D/NetworkSecurityConfig: No Network Security Config specified, using platform default
In my code from where I call webview activity I added the following statement:
webview.getSettings().setJavaScriptEnabled(true);
webview.getSettings().setDomStorageEnabled(true);
Still it doesn't work for me on Android 5.1.1
My log cat displaying me this:
09-02 14:22:05.258 19661-19661/com.example.obs I/Timeline: Timeline: Activity_launch_request id:com.example.obs time:12875631 beginning of system
09-02 14:22:05.311 19661-19675/com.example.obs W/art: Suspending all threads took: 13.479ms 09-02 14:22:05.396 19661-19661/com.example.obs I/WebViewFactory: Loading com.google.android.webview version 51.0.2704.81 (code 270408150)
09-02 14:22:05.409 19661-19661/com.example.obs I/cr_LibraryLoader: Time to load native libraries: 1 ms (timestamps 5781-5782)
09-02 14:22:05.409 19661-19661/com.example.obs I/cr_LibraryLoader: Expected native library version number "51.0.2704.81", actual native library version number "51.0.2704.81"
09-02 14:22:05.416 19661-19661/com.example.obs V/WebViewChromiumFactoryProvider: Binding Chromium to main looper Looper (main, tid 1) {21b37efb}
09-02 14:22:05.416 19661-19661/com.example.obs I/cr_LibraryLoader: Expected native library version number "51.0.2704.81", actual native library version number "51.0.2704.81"
09-02 14:22:05.416 19661-19661/com.example.obs I/chromium: [INFO:library_loader_hooks.cc(143)] Chromium logging enabled: level = 0, default verbosity = 0
09-02 14:22:05.438 19661-19661/com.example.obs I/cr_BrowserStartup: Initializing chromium process, singleProcess=true
09-02 14:22:05.488 19661-20394/com.example.obs W/cr_media: Requires BLUETOOTH permission
09-02 14:22:05.503 19661-19661/com.example.obs I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$WebResourceErrorImpl>
09-02 14:22:05.503 19661-19661/com.example.obs I/art: Rejecting re-init on previously-failed class java.lang.Class<com.android.webview.chromium.WebViewContentsClientAdapter$WebResourceErrorImpl>
09-02 14:22:05.528 19661-20396/com.example.obs D/ConnectivityManager.CallbackHandler: CM callback handler got msg 524290
09-02 14:22:05.547 19661-19661/com.example.obs I/art: Rejecting re-init on previously-failed class java.lang.Class<org.chromium.content.browser.FloatingWebActionModeCallback>
09-02 14:22:05.547 19661-19661/com.example.obs I/art: Rejecting re-init on previously-failed class java.lang.Class<org.chromium.content.browser.FloatingWebActionModeCallback>
09-02 14:22:05.561 19661-19661/com.example.obs D/cr_Ime: [InputMethodManagerWrapper.java:30] Constructor
09-02 14:22:05.569 19661-19661/com.example.obs W/cr_AwContents: onDetachedFromWindow called when already detached. Ignoring
09-02 14:22:05.570 19661-19661/com.example.obs D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
09-02 14:22:05.611 19661-19661/com.example.obs I/cr_Ime: ImeThread is not enabled.
09-02 14:22:05.637 19661-20403/com.example.obs E/libEGL: validate_display:255 error 3008 (EGL_BAD_DISPLAY)
09-02 14:22:05.656 19661-20403/com.example.obs W/VideoCapabilities: Unrecognized profile 2130706433 for video/avc
09-02 14:22:05.663 19661-20403/com.example.obs W/AudioCapabilities: Unsupported mime audio/qcelp
09-02 14:22:05.664 19661-20403/com.example.obs W/AudioCapabilities: Unsupported mime audio/evrc
09-02 14:22:05.669 19661-20403/com.example.obs W/VideoCapabilities: Unsupported mime video/mpeg2
09-02 14:22:05.670 19661-20403/com.example.obs W/VideoCapabilities: Unsupported mime video/mpeg2
09-02 14:22:05.675 19661-20403/com.example.obs W/VideoCapabilities: Unsupported mime video/x-ms-wmv
09-02 14:22:05.677 19661-20403/com.example.obs W/VideoCapabilities: Unsupported mime video/divx
09-02 14:22:05.680 19661-20403/com.example.obs W/VideoCapabilities: Unsupported mime video/divx311
09-02 14:22:05.680 19661-20403/com.example.obs W/Utils: could not parse size range '64x64-1920X1088'
09-02 14:22:05.683 19661-20403/com.example.obs W/VideoCapabilities: Unsupported mime video/divx4
09-02 14:22:05.688 19661-20403/com.example.obs W/Utils: could not parse size range '64x64-1920X1080'
09-02 14:22:05.691 19661-20403/com.example.obs W/VideoCapabilities: Unsupported mime video/mp4v-esdp
09-02 14:22:05.704 19661-20403/com.example.obs I/VideoCapabilities: Unsupported profile 4 for video/mp4v-es
09-02 14:22:05.708 19661-20403/com.example.obs W/AudioCapabilities: Unsupported mime audio/ac3
09-02 14:22:05.710 19661-20403/com.example.obs W/AudioCapabilities: Unsupported mime audio/x-ape
09-02 14:22:05.711 19661-20403/com.example.obs W/AudioCapabilities: Unsupported mime audio/ffmpeg
09-02 14:22:05.712 19661-20403/com.example.obs W/AudioCapabilities: Unsupported mime audio/vnd.dts
09-02 14:22:05.714 19661-20403/com.example.obs W/AudioCapabilities: Unsupported mime audio/mpeg-L2
09-02 14:22:05.716 19661-20403/com.example.obs W/AudioCapabilities: Unsupported mime audio/vnd.rn-realaudio
09-02 14:22:05.717 19661-20403/com.example.obs W/AudioCapabilities: Unsupported mime audio/x-ms-wma
09-02 14:22:05.718 19661-20403/com.example.obs W/VideoCapabilities: Unsupported mime video/divx
09-02 14:22:05.720 19661-20403/com.example.obs W/VideoCapabilities: Unsupported mime video/x-flv
09-02 14:22:05.722 19661-20403/com.example.obs W/VideoCapabilities: Unsupported mime video/mpeg2
09-02 14:22:05.726 19661-20403/com.example.obs W/VideoCapabilities: Unsupported mime video/vnd.rn-realvideo
09-02 14:22:05.728 19661-20403/com.example.obs W/VideoCapabilities: Unsupported mime video/vc1
09-02 14:22:05.730 19661-20403/com.example.obs W/VideoCapabilities: Unsupported mime video/ffmpeg
09-02 14:22:05.732 19661-20403/com.example.obs W/VideoCapabilities: Unsupported mime video/x-ms-wmv
09-02 14:22:05.736 19661-20396/com.example.obs D/ConnectivityManager.CallbackHandler: CM callback handler got msg 524290
09-02 14:22:05.863 19661-19795/com.example.obs V/RenderScript: Application requested CPU execution
09-02 14:22:05.866 19661-19795/com.example.obs V/RenderScript: 0x5586157780 Launching thread(s), CPUs 8
09-02 14:22:05.889 19661-19661/com.example.obs W/cr_BindingManager: Cannot call determinedVisibility() - never saw a connection for the pid: 19661
09-02 14:22:05.890 19661-19661/com.example.obs D/cr_Ime: [InputMethodManagerWrapper.java:59] isActive: false
09-02 14:22:05.894 19661-19661/com.example.obs I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy#4a1d642 time:12876268
I try to use cordova in windows for create a simple android app. I create the first project using command cordova create hello com.example.hello HelloWorld
I add the Android platform, I try to build and build success, but when I emulate the app don't start and receive the error on screen:
Unfortunaly, HelloWorld has stopped.
logcat:
03-16 16:44:19.073 2442-2442/com.example.hello W/System﹕ ClassLoader referenced unknown path: /data/app/com.example.hello-1/lib/x86
03-16 16:44:19.266 2442-2442/com.example.hello I/WebViewFactory﹕ Loading com.android.webview version 44.0.2403.119 (code 246011910)
03-16 16:44:19.310 2442-2442/com.example.hello W/System﹕ ClassLoader referenced unknown path: /system/app/webview/lib/x86
03-16 16:44:19.377 2442-2442/com.example.hello I/LibraryLoader﹕ Time to load native libraries: 62 ms (timestamps 9389-9451)
03-16 16:44:19.377 2442-2442/com.example.hello I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
03-16 16:44:19.392 2442-2442/com.example.hello I/LibraryLoader﹕ Expected native library version number "",actual native library version number ""
03-16 16:44:19.392 2442-2442/com.example.hello I/chromium﹕ [INFO:library_loader_hooks.cc(120)] Chromium logging enabled: level = 0, default verbosity = 0
03-16 16:44:19.483 2442-2442/com.example.hello I/BrowserStartupController﹕ Initializing chromium process, singleProcess=true
03-16 16:44:19.484 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:19.486 2442-2442/com.example.hello E/SysUtils﹕ ApplicationContext is null in ApplicationStatus
03-16 16:44:19.568 2442-2442/com.example.hello W/chromium﹕ [WARNING:resource_bundle.cc(285)] locale_file_path.empty()
03-16 16:44:19.571 2442-2442/com.example.hello E/libEGL﹕ validate_display:255 error 3008 (EGL_BAD_DISPLAY)
03-16 16:44:19.571 2442-2442/com.example.hello E/libEGL﹕ validate_display:255 error 3008 (EGL_BAD_DISPLAY)
03-16 16:44:19.571 2442-2442/com.example.hello E/chromium﹕ [ERROR:gl_surface_egl.cc(327)] No suitable EGL configs found.
03-16 16:44:19.571 2442-2442/com.example.hello E/chromium﹕ [ERROR:gl_surface_android.cc(23)] GLSurfaceEGL::InitializeOneOff failed.
03-16 16:44:19.571 2442-2442/com.example.hello E/chromium﹕ [ERROR:browser_main_loop.cc(698)] GLSurface::InitializeOneOff failed
03-16 16:44:19.628 2442-2468/com.example.hello W/AudioManagerAndroid﹕ Requires BLUETOOTH permission
03-16 16:44:19.667 2442-2442/com.example.hello E/DataReductionProxySettingListener﹕ No DRP key due to exception:java.lang.ClassNotFoundException: com.android.webview.chromium.Drp
03-16 16:44:19.757 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:19.762 2442-2442/com.example.hello W/AwContents﹕ onDetachedFromWindow called when already detached. Ignoring
03-16 16:44:20.182 2442-2442/com.example.hello D/SystemWebViewEngine﹕ CordovaWebView is running on device made by: unknown
03-16 16:44:20.188 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:20.188 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:20.246 2442-2452/com.example.hello I/art﹕ Background sticky concurrent mark sweep GC freed 7609(505KB) AllocSpace objects, 3(60KB) LOS objects, 64% free, 861KB/2MB, paused 1.373ms total 448.240ms
03-16 16:44:20.310 2442-2466/com.example.hello W/chromium﹕ [WARNING:data_reduction_proxy_config.cc(423)] SPDY proxy OFF at startup
03-16 16:44:20.368 2442-2442/com.example.hello D/gralloc_goldfish﹕ Emulator without host-side GPU emulation detected.
03-16 16:44:20.376 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:20.410 2442-2442/com.example.hello W/art﹕ Attempt to remove non-JNI local reference, dumping thread
03-16 16:44:20.586 2442-2452/com.example.hello I/art﹕ Background partial concurrent mark sweep GC freed 1447(97KB) AllocSpace objects, 2(2MB) LOS objects, 35% free, 926KB/1438KB, paused 2.668ms total 209.255ms
03-16 16:44:20.587 2442-2480/com.example.hello A/chromium﹕ [FATAL:gl_surface_android.cc(58)] Check failed: kGLImplementationNone != GetGLImplementation() (0 vs. 0)
03-16 16:44:20.587 2442-2480/com.example.hello A/libc﹕ Fatal signal 6 (SIGABRT), code -6 in tid 2480 (GpuThread)
This is almost exactly the same error as Error in Android Programming while connecting to Phonegap. It seems to be related to this bug from ionic.
According to them, "switching from Snapshot to Host GPU solved this problem."
This makes sense as three of the last errors are related to opengl.
Note to various moderators: I tried to close one as a duplicate of the other, but that can't be done because there's no answer. Tried looking on meta for 'duplicate unanswered' but they simply say not to do it. I figure I'll post a possible answer and if either one is accepted, I'll close the other as a dup.
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
I have an app that downloads a very large file (over 50MB). Unfortunately I'm getting reports that the download fails.
Below is the logcat of one such failure, which ends with a java.net.SocketException: The operation timed out. In-between it has various messages from the WifiMonitor. I don't know how to interpret these messages.
Is there something special that I should do to download a large file, or is this simply a connection problem?
09-02 16:41:19.925 I/ActivityManager( 646): Displayed activity com.example/com.example.sp.MainActivity: 1110 ms (total 3786 ms)
09-02 16:41:21.935 W/InputManagerService( 646): Window already focused, ignoring focus gain of: com.android.internal.view.IInputMethodClient$Stub$Proxy#45133d08
09-02 16:41:23.495 I/global ( 7345): Default buffer size used in BufferedInputStream constructor. It would be better to be explicit if an 8k buffer is required.
09-02 16:41:23.895 D/dalvikvm( 7345): GC freed 5348 objects / 307096 bytes in 160ms
09-02 16:41:25.885 D/dalvikvm( 7345): GC freed 15282 objects / 713544 bytes in 124ms
09-02 16:41:27.405 D/dalvikvm( 7345): GC freed 11775 objects / 524576 bytes in 131ms
09-02 16:41:28.982 I/wpa_supplicant( 7284): CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys
09-02 16:41:28.985 V/WifiMonitor( 646): Event [CTRL-EVENT-DISCONNECTED - Disconnect event - remove keys]
09-02 16:41:28.985 V/WifiStateTracker( 646): New network state is DISCONNECTED
09-02 16:41:28.985 I/wpa_supplicant( 7284): CTRL-EVENT-STATE-CHANGE id=0 state=0
09-02 16:41:28.985 V/WifiMonitor( 646): Event [CTRL-EVENT-STATE-CHANGE id=0 state=0]
09-02 16:41:28.995 V/WifiStateTracker( 646): Changing supplicant state: COMPLETED ==> DISCONNECTED
09-02 16:41:29.086 I/wpa_supplicant( 7284): CTRL-EVENT-STATE-CHANGE id=0 state=2
09-02 16:41:29.086 V/WifiMonitor( 646): Event [CTRL-EVENT-STATE-CHANGE id=0 state=2]
09-02 16:41:29.086 V/WifiStateTracker( 646): Changing supplicant state: DISCONNECTED ==> SCANNING
09-02 16:41:29.086 W/wpa_supplicant( 7284): Failed to initiate AP scan.
09-02 16:41:29.095 I/wpa_supplicant( 7284): CTRL-EVENT-SCAN-RESULTS Ready
09-02 16:41:29.095 I/wpa_supplicant( 7284): Trying to associate with 00:1c:f0:6e:2a:56 (SSID='WLANR' freq=2412 MHz)
09-02 16:41:29.095 E/wpa_supplicant( 7284): Set_key: Wrong Key
09-02 16:41:29.095 E/wpa_supplicant( 7284): Set_key: Wrong Key
09-02 16:41:29.095 E/wpa_supplicant( 7284): Set_key: Wrong Key
09-02 16:41:29.095 E/wpa_supplicant( 7284): Set_key: Wrong Key
09-02 16:41:29.095 E/wpa_supplicant( 7284): Set_key: Wrong Key
09-02 16:41:29.095 I/wpa_supplicant( 7284): CTRL-EVENT-STATE-CHANGE id=0 state=3
09-02 16:41:29.105 V/WifiMonitor( 646): Event [Trying to associate with 00:1c:f0:6e:2a:56 (SSID='WLANR' freq=2412 MHz)]
09-02 16:41:29.105 V/WifiMonitor( 646): Event [CTRL-EVENT-STATE-CHANGE id=0 state=3]
09-02 16:41:29.125 V/WifiStateTracker( 646): Changing supplicant state: SCANNING ==> ASSOCIATING
09-02 16:41:29.825 I/wpa_supplicant( 7284): CTRL-EVENT-STATE-CHANGE id=0 state=4
09-02 16:41:29.825 V/WifiMonitor( 646): Event [CTRL-EVENT-STATE-CHANGE id=0 state=4]
09-02 16:41:29.825 V/WifiStateTracker( 646): Changing supplicant state: ASSOCIATING ==> ASSOCIATED
09-02 16:41:29.825 I/wpa_supplicant( 7284): Associated with 00:1c:f0:6e:2a:56
09-02 16:41:29.825 I/wpa_supplicant( 7284): CTRL-EVENT-STATE-CHANGE id=0 state=7
09-02 16:41:29.825 I/wpa_supplicant( 7284): CTRL-EVENT-CONNECTED - Connection to 00:1c:f0:6e:2a:56 completed (reauth) [id=0 id_str=]
09-02 16:41:29.825 I/wpa_supplicant( 7284): wpa_supplicant - IPC_EVENT_AUTH_SUCC
09-02 16:41:29.825 V/WifiMonitor( 646): Event [Associated with 00:1c:f0:6e:2a:56]
09-02 16:41:29.825 V/WifiMonitor( 646): Event [CTRL-EVENT-STATE-CHANGE id=0 state=7]
09-02 16:41:29.845 V/WifiStateTracker( 646): Changing supplicant state: ASSOCIATED ==> COMPLETED
09-02 16:41:29.855 V/WifiMonitor( 646): Event [CTRL-EVENT-CONNECTED - Connection to 00:1c:f0:6e:2a:56 completed (reauth) [id=0 id_str=]]
09-02 16:41:29.855 V/WifiStateTracker( 646): New network state is CONNECTED
09-02 16:41:29.865 D/WifiStateTracker( 646): Deconfiguring interface and stopping DHCP
09-02 16:41:29.865 E/wpa_supplicant( 7284): prepare_filter_struct: type=5
09-02 16:41:29.945 E/FileUtils( 7345): Download failed
09-02 16:41:29.945 E/FileUtils( 7345): java.net.SocketException: The operation timed out
The phone disconnects from Wi-Fi when going into sleep mode, which I guess was the cause here? Take a look at WifiManager's WifiLock to see how you can prevent it.