I had the same problem as here which I thought was because the files (recorded on iOS) were encoded as .mov instead of .mp4.
I then changed the encoding mechanism on my iOS app to encode them as mp4, and I'm still seeing the same problem.
When I load the file with
File videoFile = ...;
videoView.setVideoPath(videoFile.getAbsolutePath());
videoView.start();
I get E/MediaPlayer(2069): error (1, -2147483648)
.
When I load the file with the following (from the link above).
Uri uri = Uri.parse(VideoProvider.CONTENT_URI_BASE + Uri.encode(videoFile.getAbsolutePath()));
videoView.setVideoURL(url);
videoView.start();
I get this in logcat
07-17 08:05:58.283: W/VideoView(2276): Unable to open content: content://com.companyname.VideoProvider.files.files/%2Fdata%2Fdata%2Fcom.companyname.myappname%2Fcache%2FiX0mXVPxih.mp4
07-17 08:05:58.283: W/VideoView(2276): java.io.IOException: setDataSource failed.: status=0x80000000
ffmpeg tells me the following about the media file:
ffmpeg -i media.mp4
ffmpeg version 2.2 Copyright (c) 2000-2014 the FFmpeg developers
built on Mar 26 2014 15:29:01 with Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
configuration: --prefix=/usr/local/Cellar/ffmpeg/2.2 --enable-shared --enable-pthreads --enable-gpl --enable-version3 --enable-nonfree --enable-hardcoded-tables --enable-avresample --enable-vda --cc=clang --host-cflags= --host-ldflags= --enable-libx264 --enable-libfaac --enable-libmp3lame --enable-libxvid
libavutil 52. 66.100 / 52. 66.100
libavcodec 55. 52.102 / 55. 52.102
libavformat 55. 33.100 / 55. 33.100
libavdevice 55. 10.100 / 55. 10.100
libavfilter 4. 2.100 / 4. 2.100
libavresample 1. 2. 0 / 1. 2. 0
libswscale 2. 5.102 / 2. 5.102
libswresample 0. 18.100 / 0. 18.100
libpostproc 52. 3.100 / 52. 3.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'media.mp4':
Metadata:
major_brand : mp42
minor_version : 1
compatible_brands: mp41mp42isom
creation_time : 2014-07-17 08:59:24
Duration: 00:00:08.14, start: 0.000000, bitrate: 1084 kb/s
Stream #0:0(und): Video: h264 (Main) (avc1 / 0x31637661), yuv420p(tv, smpte170m), 360x480, 1027 kb/s, 24.46 fps, 29.97 tbr, 600 tbn, 1200 tbc (default)
Metadata:
creation_time : 2014-07-17 08:59:24
handler_name : Core Media Video
Stream #0:1(und): Audio: aac (mp4a / 0x6134706D), 44100 Hz, mono, fltp, 62 kb/s (default)
Metadata:
creation_time : 2014-07-17 08:59:24
handler_name : Core Media Audio
Any idea why this file might be failing to load?
EDIT: Seems that this is mostly an issue when running in the emulator, but on a device I seem to have succeeded it getting it to work if I use a SurfaceView
and MediaPlayer
instead of VideoView
.