Chinaunix首页 | 论坛 | 博客
  • 博客访问: 860784
  • 博文数量: 182
  • 博客积分: 1992
  • 博客等级: 上尉
  • 技术积分: 1766
  • 用 户 组: 普通用户
  • 注册时间: 2010-10-18 11:49
文章分类

全部博文(182)

文章存档

2019年(1)

2016年(5)

2015年(29)

2014年(38)

2013年(21)

2012年(36)

2011年(52)

我的朋友

分类: Android平台

2016-06-16 09:40:04


问题描述:

使用VideoView播放过MP4视频,碰到下面的问题:(MediaPlay 播放高频mp3,在版本android也有这个问题)

MediaPlayer   error (1, -2147483648)


解决方法:

1其实代表MEDIA_ERROR_UNKNOWN.

原因在于,MP4有多种编码格式,例如H.264,H.263等,而Android版本较低的机器只支持部分编码。

一旦遭遇不被支持的编码格式,MediaPlayer可能就会抛出上面的错误信息。

可以使用一些视频软件查看视频的编码格式,然后转换为普遍支持的格式。 

stackoverflow:1

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.


stackoverflow:1

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.


阅读(8745) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~