Code Monkey home page Code Monkey logo

Comments (19)

myrmidon-media avatar myrmidon-media commented on May 18, 2024

Maybe it's related to #32

Try applying the patch on the last post

from androidffmpeg.

iNdieboyjeff avatar iNdieboyjeff commented on May 18, 2024

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.

from androidffmpeg.

myrmidon-media avatar myrmidon-media commented on May 18, 2024

Can you post a stream or upload a file so we can test it?

from androidffmpeg.

iNdieboyjeff avatar iNdieboyjeff commented on May 18, 2024

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

from androidffmpeg.

iNdieboyjeff avatar iNdieboyjeff commented on May 18, 2024

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?

from androidffmpeg.

myrmidon-media avatar myrmidon-media commented on May 18, 2024

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

from androidffmpeg.

iNdieboyjeff avatar iNdieboyjeff commented on May 18, 2024

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

from androidffmpeg.

myrmidon-media avatar myrmidon-media commented on May 18, 2024

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");

....

from androidffmpeg.

iNdieboyjeff avatar iNdieboyjeff commented on May 18, 2024

That didn't seem to help I'm afraid

from androidffmpeg.

myrmidon-media avatar myrmidon-media commented on May 18, 2024

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) {



.....

from androidffmpeg.

myrmidon-media avatar myrmidon-media commented on May 18, 2024

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 #32 no?

from androidffmpeg.

iNdieboyjeff avatar iNdieboyjeff commented on May 18, 2024

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.

from androidffmpeg.

myrmidon-media avatar myrmidon-media commented on May 18, 2024

can you post the stream?

from androidffmpeg.

iNdieboyjeff avatar iNdieboyjeff commented on May 18, 2024

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 #38 (comment), whereas other ones I use work fine (well appart from the judder/popping issue anyway).

from androidffmpeg.

myrmidon-media avatar myrmidon-media commented on May 18, 2024

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

from androidffmpeg.

iNdieboyjeff avatar iNdieboyjeff commented on May 18, 2024

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.

from androidffmpeg.

ksotik avatar ksotik commented on May 18, 2024

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.

from androidffmpeg.

myrmidon-media avatar myrmidon-media commented on May 18, 2024

@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

from androidffmpeg.

wankey avatar wankey commented on May 18, 2024

it‘s happened when I play .wmv,and the video paused.how can I fix it?

from androidffmpeg.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.