Comments (14)
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.
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.
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.
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.
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.
Thank you, I'll try ASAP
from media-kit.
@JulienDev follow up?
from media-kit.
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.
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.
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.
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.
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.
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.
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)
- Application freezed sometimes when playing at rate 2 speed.
- How to show and hide controls programmatically?
- how to play ftp link video HOT 2
- Subtitle names are not available
- [Linux] GPU Acceleration HOT 6
- Use interactive viewer HOT 1
- In Flutter web, google chrome (not mobile's browser, desktop browser) does not play video HOT 5
- [HLS] Seek does not work on macos & android HOT 7
- Audio does not play again after setting new Audio track after calling player.stop() HOT 12
- add PlayingState ? HOT 1
- [Crash][macOS] Abort Signal on macOS HOT 5
- Non-C locale detected error HOT 1
- [Improvement advice] Performance update
- Android background playback.
- The vertical screen is full screen, and the subtitles are in the wrong position.
- [android] how to enable libass on Android? HOT 14
- No video, only sound on Android
- [Android] Video is completely black on real device HOT 14
- How to setup upscaling for video?
- VideoController scale, width, and height not being set
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from media-kit.