1

I am encountering problems developing small apk to use with my ip camera. I am able to play test video from apple (http://devimages.apple.com/iphone/samples/bipbop/gear4/prog_index.m3u8), but I am unable to play .m3u8 from my cam. The adress for file is ip_adress/web/list.m3u8 and i can reach it in chrome without authentication. List.m3u8 looks like this:

EXTM3U 
EXT-X-TARGETDURATION:2
EXT-X-MEDIA-SEQUENCE:1581
EXTINF:2,
HLS-0001581.ts
EXTINF:2,
HLS-0001582.ts
EXTINF:2,
HLS-0001583.ts

From what i understand, error "can't play that video" is coming not from m3u8 but from .ts files. Is that correct? What can i do to play .ts files in my apk? Im using android 4.1.2 and MPEG-2 TS is supported. Has anyone have an idea whats wrong?

01-05 04:19:15.223: E/Trace(16138): error opening trace file: No such file or directory (2)
01-05 04:19:15.223: D/ActivityThread(16138): setTargetHeapUtilization:0.25
01-05 04:19:15.223: D/ActivityThread(16138): setTargetHeapIdealFree:8388608
01-05 04:19:15.223: D/ActivityThread(16138): setTargetHeapConcurrentStart:2097152
01-05 04:19:17.153: D/libEGL(16138): loaded /system/lib/egl/libEGL_adreno200.so
01-05 04:19:17.303: D/libEGL(16138): loaded /system/lib/egl/libGLESv1_CM_adreno200.so
01-05 04:19:17.303: D/libEGL(16138): loaded /system/lib/egl/libGLESv2_adreno200.so
01-05 04:19:17.303: I/Adreno200-EGL(16138): <qeglDrvAPI_eglInitialize:299>: EGL 1.4QUALCOMMbuild(Merge)
01-05 04:19:17.303: I/Adreno200-EGL(16138): Build Date: 07/09/13 Tue
01-05 04:19:17.303: I/Adreno200-EGL(16138): Local Branch: AU_41
01-05 04:19:17.303: I/Adreno200-EGL(16138): Remote Branch: 
01-05 04:19:17.303: I/Adreno200-EGL(16138): Local Patches: 
01-05 04:19:17.303: I/Adreno200-EGL(16138): Reconstruct Branch: 
01-05 04:19:17.593: D/OpenGLRenderer(16138): Enabling debug mode 0
01-05 04:19:17.613: E/MediaPlayer(16138): Uri is  <URL suppressed>
01-05 04:19:17.613: D/MediaPlayer(16138): Couldn't open file on client side, trying server side
01-05 04:19:17.623: I/Choreographer(16138): Skipped 37 frames!  The application may be doing too     much work on its main thread.
01-05 04:19:17.983: D/MediaPlayer(16138): getMetadata
01-05 04:19:17.983: D/MediaPlayer(16138): start() mUri is <URL suppressed>
01-05 04:19:18.083: E/MediaPlayer(16138): error (1, -1007)
01-05 04:19:18.083: E/MediaPlayer(16138): Error (1,-1007)
01-05 04:19:18.083: D/VideoView(16138): Error: 1,-1007

It says that the file is not there - files are in the same place as the playlist (ip/web/). I am able to "catch" them in chrome directly. The video codec is H264 MPEG-4 AVC, resolution is 640x352.

Camera webpage, gets the list like that:

img2345.src = "/list.m3u8?" + (new Date()).getTime();

2
  • Difficult one to answer. I'd suggest you setup a test project , download one of the files directly to SD card and try playing from there. If it still won't play then the issue is obviously not with the network access or with processing the m3u8. Remember, a TS file is simply a container and depending on the types of streams it contains may or may not be compatible - in particular bit-rate, sample size etc etc can be contributing factors to playback problems.
    – Squonk
    Jan 5, 2015 at 4:05
  • Thank you for your answer - I did that and received the same error with addition of not being able to create MediaPlayer. If you would be so kind, and have the knowledge, would you tell me how should i approach playlist file? It constantly changes, instead of using "-1" as length of video - does android take care of it himself? Sorry for newbie questions. ;)
    – tomtom
    Jan 5, 2015 at 4:37

1 Answer 1

0

Error -1007 is MEDIA_ERROR_MALFORMED.

Android supports only the Baseline profile of H.264 AVC. If your encoding doesn't use the Baseline profile it might not be able to play it.

To check the encoding take on of the .ts segments and look at it with ffprobe or MediaInfo or similar and check the profile.

Android Supported Media Formats

MediaInfo

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.