Git Product home page Git Product logo

Comments (14)

JulienDev avatar JulienDev commented on May 26, 2024 1

Unfortunately, it's not helping. These are the logs I get in the console when I'm watching a live stream and switch off the network :

flutter: mpv: cplayer: warn: Audio device underrun detected.
flutter: isBuffering:true

A few seconds later

flutter: isBuffering:false
flutter: mpv: ffmpeg/video: warn: h264: vt decoder cb: output image buffer is null: -12909
flutter: mpv: ffmpeg/video: error: h264: hardware accelerator failed to decode picture
flutter: mpv: vd: warn: Error while decoding frame (hardware decoding)!
flutter: mpv: ffmpeg/video: error: h264: No frame decoded?
flutter: mpv: vd: warn: Error while decoding frame (hardware decoding)!

IMO media_kit should at least inform the developer when the network requests are failing. Then the developer will decide what to do (display error, retry, close the player...).

from media-kit.

birros avatar birros commented on May 26, 2024 1

Knowing that:

  • the logs are now programmatically accessible: #62
  • the buffering information is easily accessible: #123 & #125
  • no one else has added a comment for a month

I decide to close this issue.
Feel free to reopen it or add comments if needed 🙂

from media-kit.

alexmercerind avatar alexmercerind commented on May 26, 2024

I'm pretty sure if you connect back to internet, it'll start playing back again. That's how mpv works. It's not an "error".

from media-kit.

JulienDev avatar JulienDev commented on May 26, 2024

I've tried and when the internet is back the stream doesn't play again, unfortunately, that's why I was expecting a way to know that an "error" happened

from media-kit.

alexmercerind avatar alexmercerind commented on May 26, 2024

There's also --network-timeout. Like other things on the page, I haven't exposed everything in my abstracted API. However, you can set it like this (do it before opening something to play).

Thanks!

from media-kit.

JulienDev avatar JulienDev commented on May 26, 2024

Thank you, I'll try ASAP

from media-kit.

Quackdoc avatar Quackdoc commented on May 26, 2024

@JulienDev follow up?

from media-kit.

JulienDev avatar JulienDev commented on May 26, 2024

Unfortunately I'm still not able to make it work. I played with parameters : network-timeout and cache but the error callback is never called. Also the stream is not restarted when internet is back. That's a bit frustrating because I have to restart the stream manually each time a network error is happening.

from media-kit.

birros avatar birros commented on May 26, 2024

As @alexmercerind suggested in pull request #62, with the addition of mpv logs support in main, @JulienDev can you check if you are getting now the logs you want?

You must create a player with these options:

final Player player = Player(
  configuration: const PlayerConfiguration(
    events: true,
    logLevel: MPVLogLevel.warn,
  ),
);

The warn parameter is used to catch warnings and errors.

You have now access to logs:

void pipeLogsToConsole(Player player) {
  player.streams.log.listen((event) {
    if (kDebugMode) {
      print("mpv: ${event.prefix}: ${event.level}: ${event.text}");
    }
  });
}

If that's not enough I don't think it's up to media_kit to handle network errors, since it's the mpv / ffmpeg duo that takes care of network requests, am I wrong?

from media-kit.

birros avatar birros commented on May 26, 2024

Tested with media_kit_test:

Like you, just after disabling the network, I get this:

flutter: mpv: cplayer: warn: Audio device underrun detected.

But unlike you, after a few seconds ffmpeg informs me of a tcp error:

flutter: mpv: ffmpeg: warn: http: Will reconnect at 10251354 in 0 second(s), error=Operation timed out.
flutter: mpv: ffmpeg: error: tcp: Connection to tcp://commondatastorage.googleapis.com:80 failed: Network is unreachable
flutter: mpv: ffmpeg: warn: http: Will reconnect at 10251354 in 1 second(s), error=Operation timed out.
flutter: mpv: ffmpeg: error: tcp: Connection to tcp://commondatastorage.googleapis.com:80 failed: Network is unreachable

from media-kit.

birros avatar birros commented on May 26, 2024

Since it is ffmpeg that takes care of network requests, if it doesn't report tcp errors every time, maybe there is an option missing in the ffmpeg build, or simply the normal behavior or a bug in ffmpeg.

from media-kit.

JulienDev avatar JulienDev commented on May 26, 2024

Tested with media_kit_test:

Like you, just after disabling the network, I get this:

flutter: mpv: cplayer: warn: Audio device underrun detected.

But unlike you, after a few seconds ffmpeg informs me of a tcp error:

flutter: mpv: ffmpeg: warn: http: Will reconnect at 10251354 in 0 second(s), error=Operation timed out.
flutter: mpv: ffmpeg: error: tcp: Connection to tcp://commondatastorage.googleapis.com:80 failed: Network is unreachable
flutter: mpv: ffmpeg: warn: http: Will reconnect at 10251354 in 1 second(s), error=Operation timed out.
flutter: mpv: ffmpeg: error: tcp: Connection to tcp://commondatastorage.googleapis.com:80 failed: Network is unreachable

Did you try with a live streaming video or just a static video?

from media-kit.

birros avatar birros commented on May 26, 2024

A static video: https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4

Also, the previous logs I provided were for the http address, here are the https ones:

flutter: mpv: ffmpeg: error: tls: read failed: error:14FFF3E7:SSL routines:(UNKNOWN)SSL_internal:unknown failure occurred
flutter: mpv: ffmpeg: warn: https: Will reconnect at 21728009 in 0 second(s), error=Input/output error.
flutter: mpv: ffmpeg: error: tcp: Connection to tcp://commondatastorage.googleapis.com:443 failed: Network is unreachable

Another test (https):

flutter: mpv: ffmpeg: error: tls: read failed: error:14FFF3E7:SSL routines:(UNKNOWN)SSL_internal:unknown failure occurred
flutter: mpv: ffmpeg: warn: https: Will reconnect at 21494536 in 0 second(s), error=Input/output error.
flutter: mpv: ffmpeg: error: tcp: Failed to resolve hostname commondatastorage.googleapis.com: nodename nor servname provided, or not known
flutter: mpv: ffmpeg: error: tls: read failed: error:14FFF3E7:SSL routines:(UNKNOWN)SSL_internal:unknown failure occurred
flutter: mpv: ffmpeg: warn: https: Will reconnect at 21494536 in 1 second(s), error=Input/output error.

from media-kit.

birros avatar birros commented on May 26, 2024

What protocol do you use? Maybe it comes from this.

From Discord: "I use http"


Also, according to my tests (https), the connection resumes by itself after the network is restored.

from media-kit.

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.