AndroidFFmpeg
AndroidFFmpeg copied to clipboard
obtainBuffer() track 0x..... disabled, restarting
I've managed to compile everything OK, and have local files able to play, but when trying to use HLS streaming, both live and VOD files, I keep getting the above error in the Log, and nothing plays. Any idea what might be causing this?
Maybe it's related to https://github.com/appunite/AndroidFFmpeg/issues/32
Try applying the patch on the last post
That seems to have solved most of the problems. Still a couple of streams I can't play but most are now working.
However I now have an issue on streams and local videos where we get 'blips' in the audio every couple of seconds the audio either seems to pause or drop-out temporarily (for a couple of frames only) or judder. There also seems to be a lot of GC going on in the Logcat.
Can you post a stream or upload a file so we can test it?
Here is a stream that doesn't load.... http://akamedia2.lsops.net/live/smil:bbcnews_en.smil/playlist.m3u8
I'll see if I can find something with the 'popping' issue....
Hmm, the 'popping/drop-out' issue - I've tried the same streams on a Galaxy SIII and the streams/files play without this issue showing itself, whereas on a Galaxy Tab 10 I get this problem. So I'm wondering if it is processor/memory related and a GT10 is a much older device. And the question then would be is there anything we can do to resolve the problem on older devices?
@iNdieboyjeff
The stream plays fine here. Regarding the popping/drop-out' issue I'm pretty sure it's related to device not being faster enough.
Although Galaxy tab 10 should be fast enough for this kind of stream, are you testing on https://review.appunite.com/#/c/4017 or on github's version? The latest version (https://review.appunite.com/#/c/4017) has speed improvements, see AnativeWindow for reference http://vec.io/posts/how-to-render-image-buffer-in-android-ndk-native-code.
I've tried doing a clean build based on https://review.appunite.com/#/c/4017 and I still can't play the HLS stream specified. I get the following Logcat:
05-08 10:42:43.840: E/ffmpeg(3867): max_analyze_duration 5000000 reached at 5000000 05-08 10:42:43.840: E/ffmpeg(3867): Could not find codec parameters for stream 0 (Unknown: none ([21][0][0][0] / 0x0015)): unknown codec 05-08 10:42:43.840: E/ffmpeg(3867): Consider increasing the value for the 'analyzeduration' and 'probesize' options 05-08 10:42:43.850: E/ffmpeg(3867): Estimating duration from bitrate, this may be inaccurate 05-08 10:42:45.500: E/ffmpeg(3867): max_analyze_duration 5000000 reached at 5000000 05-08 10:42:45.500: E/ffmpeg(3867): Could not find codec parameters for stream 0 (Unknown: none ([21][0][0][0] / 0x0015)): unknown codec 05-08 10:42:45.500: E/ffmpeg(3867): Consider increasing the value for the 'analyzeduration' and 'probesize' options 05-08 10:42:45.500: E/ffmpeg(3867): Estimating duration from bitrate, this may be inaccurate 05-08 10:42:48.810: E/ffmpeg(3867): max_analyze_duration 5000000 reached at 5000000 05-08 10:42:48.810: E/ffmpeg(3867): Could not find codec parameters for stream 0 (Unknown: none ([21][0][0][0] / 0x0015)): unknown codec 05-08 10:42:48.810: E/ffmpeg(3867): Consider increasing the value for the 'analyzeduration' and 'probesize' options 05-08 10:42:48.820: E/ffmpeg(3867): Estimating duration from bitrate, this may be inaccurate
Try adding this to VideoActivity:
private void setDataSource() {
HashMap<String, String> params = new HashMap<String, String>();
// set font for ass
File assFont = new File(Environment.getExternalStorageDirectory(),
"DroidSansFallback.ttf");
params.put("ass_default_font_path", assFont.getAbsolutePath());
+ params.put("analyzeduration", "0");
....
That didn't seem to help I'm afraid
Really? I'm testing with analyzeduration 0 and works great here.
Well try hardcoding it in player.c:
int player_open_input(struct Player *player, const char *file_path,
AVDictionary *dictionary) {
+ av_dict_set(&dictionary, "analyzeduration", "0", 0);
int ret;
if ((ret = avformat_open_input(&(player->input_format_ctx), file_path, NULL,
&dictionary)) < 0) {
.....
If above doesn't work make sure you've compiled ffmpeg with required options for playing hls streams.
Btw you've pulled fromm https://review.appunite.com/#/c/4017 and then applied the patch on https://github.com/appunite/AndroidFFmpeg/issues/32 no?
Yep all of that has been done. Latest from appunite, and patch 32. Other HLS streams do play so I'm assuming it's not the HLS support per-se. It does seem to be a very odd problem.
can you post the stream?
I'll try the code change you suggest - will take a little while to compile it up...
The stream is the one I mentioned earlier https://github.com/appunite/AndroidFFmpeg/issues/38#issuecomment-17550196, whereas other ones I use work fine (well appart from the judder/popping issue anyway).
Well the stream you posted works fine here with analyzeduration 0. You don't have to make a clean recompile. Just add the line above and then ndk-build -j2
Tried that and it didn't help - in fact made performance worse for some items. There definitely seems to be a problem with adaptive HLS streams.
I have this error with obtainBuffer() too with H.264/AAC Mpeg-TS HTTP streams (live stream and files), encoded with ffmpeg+libx264 high/baseline profile. But SD streams with low bitrate (lower than 1mbps) works better then HD and SD with bitrate > 1 mbps, HD plays with big audio freezes and low fps. How to solve this? Another players (VLC, MX Player) play this streams fine on android. Thank you for help.
@ksotik
Probably @jacek-marchwicki can speak wiser than me. But to solve this, player needs either hw acceleration or frame skippping algorithm for sw decoder. Neither of them are currently implemented
it‘s happened when I play .wmv,and the video paused.how can I fix it?