Android的MediaPlayer的错误(1,-2147483648) [英] Android MediaPlayer error (1, -2147483648)

查看:4725
本文介绍了Android的MediaPlayer的错误(1,-2147483648)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有两个不同的视频时,我试图加载到一个 VideoView

I have two different videos which I'm trying to load into a VideoView using

videoView.setVideoURI(Uri.parse(url));

这两个视频,让他们的视频1 视频2 的,都使用以下规格(提取的ffmpeg -i );事实上,它们是同一个视频的两个不同的编码

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:

  1. 视频1:

  1. 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

  • 视频2:

  • 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
    

  • 据我所知,支持AAC带着蜂窝,因此,我测试了几个设备的视频;的结果如下:

    I am aware that AAC support came with Honeycomb, and therefore I tested the videos with several devices; the results are given below:

    1. SGS II定制4.0.3操作系统(迷情ROM 3.4与CF-根内核) - 视频1:确定 - 视频2:确定
    2. SGS我与三星2.3.3 OS - 视频1:错误(1,-2147483648) - 视频2:确定
    3. SGS我定制OS 4.0.3(ICS SGS TEAM ROM与魔鬼的内核) - 视频1:错误(1,-2147483648) - 视频2:确定
    4. 的Nexus One与原来的2.3.6操作系统 - 视频1:见(1)所示 - 视频2:见(2)以下
    5. 仿真器与2.2操作系统 - 视频1:错误(1,-2147483648) - 视频2:错误(1,-2147483648)
    6. 仿真器4.0.3 OS - 视频1:错误(1,-2147483648) - 视频2:错误(1,-2147483648)
    1. SGS II with custom 4.0.3 OS(Sensation ROM 3.4 with CF-Root kernel) - Video 1:OK - Video2:OK
    2. SGS I with Samsung 2.3.3 OS - Video 1:error (1, -2147483648) - Video 2:OK
    3. SGS I with custom 4.0.3 OS(ICS SGS TEAM ROM with Devil kernel) - Video 1:error (1, -2147483648) - Video 2:OK
    4. Nexus One with original 2.3.6 OS - Video 1:See (1) below - Video 2:See (2) below
    5. Emulator with 2.2 OS - Video 1:error (1, -2147483648) - Video 2:error (1, -2147483648)
    6. Emulator with 4.0.3 OS - Video 1:error (1, -2147483648) - Video 2:error (1, -2147483648)

    这两个视频播放罚款,谷歌浏览器在PC中。这可能是有益的补充,在正常情况下,视频和音频播放正常。在错误(1,-2147483648)的情况下,相同的日志会从所有设备喷出(除的Nexus One):

    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
    

    在(1)的情况下,以下日志从Nexus One的喷出,并且视频从未加载:

    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
    

    在(2)情况下,以下日志从Nexus One的喷出,正如你所看到的,结束一个错误(1,-2147483648):

    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
    

    这是我看过的错误(1,-2147483648)可对应于不支持codeCS,腐败的元数据或不正确的文件头。如果是这样,你能在正确的方向上要使用的codeC指向我?谢谢。

    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.

    当看着误差值(1,-2147483648)中,'1'值对应于<一个恒href="https://developer.android.com/reference/android/media/MediaPlayer.html#MEDIA_ERROR_UNKNOWN">MediaPlayer.MEDIA_ERROR_UNKNOWN.

    When looking at the error value (1, -2147483648), the '1' value corresponds to the constant in MediaPlayer.MEDIA_ERROR_UNKNOWN.

    -2147483648对应于被定义为在UNKNOWN_ERROR框架十六进制0x80000000的/天然/包含/ utils的/ Errors.h

    -2147483648 corresponds to hexadecimal 0x80000000 which is defined as UNKNOWN_ERROR in frameworks/native/include/utils/Errors.h

    这表明误差的来源是很难牵制,因为它是一个相当普通的返回值,抛出codeC和兼容性问题,如上面提到的,而且线程取消等几个类型。

    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.

    有关您的问题,我会建议咨询href="http://developer.android.com/guide/appendix/media-formats.html">的Andr​​oid支持的媒体格式兼容的Andr​​oid版本的

    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.

    这篇关于Android的MediaPlayer的错误(1,-2147483648)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    相关文章
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆