befovy / fijkplayer

ijkplayer for flutter. ijkplayer 的 flutter 封装。 Flutter video/audio player. Flutter media player plugin for android/iOS based on ijkplayer. fijkplayer 是基于 ijkplayer 封装的 flutter 媒体播放器,开箱即用,无需编译 ijkplayer
https://fijkplayer.befovy.com
MIT License
1.65k stars 352 forks source link

Green artefacts #201

Open pharshdev opened 4 years ago

pharshdev commented 4 years ago

Green artefacts when playing videos on Firestick 4k.

Screenshot 2020-03-23 at 7 59 20 AM

Audio and video works fine, its just the green thing!

befovy commented 4 years ago

Can you provide the log?

pharshdev commented 4 years ago

There are actually none from the plugin. I double checked. There's no error/exception nothing.

befovy commented 4 years ago

Have you tried hard video decoding and soft video decoding? Have this issue on other devices?

pharshdev commented 4 years ago

Have you tried hard video decoding and soft video decoding?

No, I've used the example as is. I'm not sure how to use the flags if that's what you meant. Please tell.

Have this issue on other devices?

So far I have tested on firestick 4k and non 4k, android tv, shield and all of them on both 4k and 1080 displays. Only firestick 4k gave the green issue on both 4k and 1080 displays.

Now you could blame the hardware but then Kodi which uses the same ffplay, plays the video just without any issues.

befovy commented 4 years ago

Enable mediacodec using setOption.

player.setOption(FijkOption.playerCategory, "mediacodec-all-videos" , 1);

See https://github.com/befovy/fijkplayer/issues/176#issuecomment-587260649 for details

pharshdev commented 4 years ago

I have already set all the flags mentioned in the comment #176. Doesn't solve the green issue unfortunately.

befovy commented 4 years ago

@pharshdev Have you tried the native ijkplayer demo? https://github.com/befovy/ijkplayer

Or have you tried other flutter video player plugin?

pharshdev commented 4 years ago

@pharshdev Have you tried the native ijkplayer demo? https://github.com/befovy/ijkplayer

Yes, the issue persists with native ijkplayer too.

Or have you tried other flutter video player plugin?

VLC player and flt player works fine after playing with their options.

befovy commented 4 years ago

@pharshdev Thanks for the reply. But I can't give a solution for this problem

pharshdev commented 4 years ago

Oh my god, I'm so hyped right now! Not sure how but I actually found a way around the green issue!

Looks like if i comment out mediacodec option, i do not get the green issue. But then the videoplayback is choppy. If i uncomment it, the playback is smooth but there is this green artefact!>

@override
  void initState() {
    super.initState();
    player.setDataSource(widget.link, autoPlay: true);
    player.setOption(FijkOption.playerCategory, "reconnect", 5);
    player.setOption(FijkOption.playerCategory, "framedrop", 5);
    player.setOption(FijkOption.playerCategory, "enable-accurate-seek", 1);
   // player.setOption(FijkOption.playerCategory, "mediacodec_all_videos", 1);
    player.setOption(FijkOption.playerCategory, "packet-buffering", 1);
    player.setOption(FijkOption.playerCategory, "soundtouch", 1);
    player.setOption(FijkOption.playerCategory, "start-on-prepared", 1);
    player.setOption(FijkOption.formatCategory, "fflags", "fastseek");
  }

I have been doing some reading and it looks like it has something to do with YUV format. Idk can you please take a look now https://github.com/bilibili/ijkplayer/issues/3743. Thank you so much, this player otherwise is excellent!

Also : https://github.com/bilibili/ijkplayer/pull/4560