Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Video lag and stream interruptions on Android TV devices & Adding function subtitles and audio #614

Open
azulmouad opened this issue Nov 22, 2023 · 23 comments

Comments

@azulmouad
Copy link

Hello, I’m experiencing issues with your package. The video works well on mobile devices, but when I launch the app on Android TV devices, it lags and the stream videos stop and start. This issue is only present on Android TV, and I’m not sure why. Could it be because the player is not optimized for big screens?

Also, I have a request. Is it possible to add a function for subtitles and audio? I’m using stream video formats m3u8, and the URL has multiple subtitles and audios. Would it be possible to use your player for this?

@alexmercerind
Copy link
Member

I'm kind of confused by the word lag now, is it:

  • Jank in Flutter UI.
  • Pauses due to buffering e.g. due to slow internet.
  • Overall slowness or less frame-rate in video playback.

@alexmercerind
Copy link
Member

Adding function subtitles and audio.

Read documentation carefully & search there.

@azulmouad
Copy link
Author

I'm kind of confused by the word lag now, is it:

  • Jank in Flutter UI.
  • Pauses due to buffering e.g. due to slow internet.
  • Overall slowness or less frame-rate in video playback.

When using the app on Android devices, the video experiences lag and buffering issues. Despite having a fast internet connection, the video plays smoothly on mobile devices, but the same content encounters problems when played on a television.

@azulmouad
Copy link
Author

Adding function subtitles and audio.

Read documentation carefully & search there.

In your document, I discovered instructions on manually adding subtitles through a URL. However, on our end, we don't provide separate subtitle URLs; subtitles are embedded within the M3U8 or .MKV video URLs. When using VLC Player, it automatically decodes subtitles from the URL. I'm interested in knowing if your package provides a similar feature.

@azulmouad
Copy link
Author

Hey AnyUpdates ?

@SpaceXM
Copy link

SpaceXM commented Dec 24, 2023

the lag in Android TV is a frame drop due to the use of flutter framework, i have used native bridge to solve the problem with a native player (i used amazon exoplayer) with custom ffmpeg module to support audio decode. I have tried soo many different pack to solve the problem but only native implementation solve this

@azulmouad
Copy link
Author

the lag in Android TV is a frame drop due to the use of flutter framework, i have used native bridge to solve the problem with a native player (i used amazon exoplayer) with custom ffmpeg module to support audio decode. I have tried soo many different pack to solve the problem but only native implementation solve this

If everything is satisfactory for you, could you please share the project on GitHub? It would greatly assist us, as we are still encountering these issues. Thank you very much.

@adam-hoang-vn
Copy link

adam-hoang-vn commented Mar 1, 2024

Any update for this post? I met the same issue with author and don't have any solutions for it. @alexmercerind ?

@alexmercerind
Copy link
Member

Sorry no updates from my end. I don't have Android TV.

@adam-hoang-vn
Copy link

How about you? @azulmouad Do you have the solution for this issue?

@azulmouad
Copy link
Author

How about you? @azulmouad Do you have the solution for this issue?

No still facing same issues

@jeremylcarter
Copy link

I am using media-kit on Android TV and there is considerable frame loss. I will swap out with another player to isolate.

@bl1nch
Copy link

bl1nch commented Apr 21, 2024

Hi, I'm trying to play FullHD video on my Android TV box but the performance is very slow. The video is glitchy and plays at about 10 fps. In addition, the media.codec loads the cpu at 100%.
PID USER PR NI VIRT RES SHR S[%CPU] %MEM TIME+ ARGS
438 mediacodec 20 0 188M 68M 62M S 98.3 3.3 52:53.81 media.codec hw/android.hardware.media.omx@1.0-service

@JulienDev
Copy link

@jeremylcarter @bl1nch could you please try to initialize VideoController with one of these configurations?

const configuration = VideoControllerConfiguration(vo: 'mediacodec_embed', hwdec: 'mediacodec');
OR
const configuration = VideoControllerConfiguration(vo: 'gpu', hwdec: 'mediacodec');

videoController = VideoController(player, configuration: configuration);

@jeremylcarter
Copy link

The video lag has gone with const configuration = VideoControllerConfiguration(vo: 'gpu', hwdec: 'mediacodec'); on Android TV but now the audio is not playing. Ill get the exact codec information and post it.

@jeremylcarter
Copy link

Very strange the codec is AC3, so perhaps passthrough is not working?

@azulmouad
Copy link
Author

The video lag has gone with const configuration = VideoControllerConfiguration(vo: 'gpu', hwdec: 'mediacodec'); on Android TV but now the audio is not playing. Ill get the exact codec information and post it.

If the Audio not playing try to test the app in a real device. i faced the same issues using Simulator .

@syleishere
Copy link

I can give an example of buffering issues or lack of being able to configure buffers...
https://mp3.sunsaturn.com/dog.mkv

Try loading that in video player and can see buffering issues...

Needs a way to buffer a bunch ahead of time, before playing...

@abdelaziz-mahdy
Copy link
Member

I can give an example of buffering issues or lack of being able to configure buffers... https://mp3.sunsaturn.com/dog.mkv

Try loading that in video player and can see buffering issues...

Needs a way to buffer a bunch ahead of time, before playing...

please test using latest github commit the cache problem should be fixed since it was set to auto not yes

dependency_overrides:
  media_kit: 
    git:
      url: https://github.com/media-kit/media-kit
      path: media_kit
  media_kit_video: 
    git:
      url: https://github.com/media-kit/media-kit
      path: media_kit_video
  media_kit_libs_video: 
    git:
      url: https://github.com/media-kit/media-kit
      path: libs/universal/media_kit_libs_video

@syleishere
Copy link

syleishere commented Apr 25, 2024

I'm just donating some bandwidth off my dedicated server in Kansas City for developers to test with. For a true test you want a good quality mkv as other formats are generally inferior and you could download them faster negating the pre-buffer test. If mediakit can stream that file without problems, then I envision no other users will have any other problems regarding this issue.

It's only a 11gig file, not typical 20 gig 4k. Server will support CORS bypass for your testing.

@azulmouad
Copy link
Author

I'm still encountering problems with video playback on the web. When I try to play the video, I only see a black screen. The video URL works fine on mobile and desktop platforms, but it seems to be incompatible with web browsers

http://raised27416.cdngold.me:80/4bf6f0714d0c/9ec8791592/639182

@abdelaziz-mahdy
Copy link
Member

I'm still encountering problems with video playback on the web. When I try to play the video, I only see a black screen. The video URL works fine on mobile and desktop platforms, but it seems to be incompatible with web browsers

http://raised27416.cdngold.me:80/4bf6f0714d0c/9ec8791592/639182

web support is limited as mentioned here
https://github.com/media-kit/media-kit?tab=readme-ov-file#supported-formats

@syleishere
Copy link

syleishere commented Apr 26, 2024

I am actually wondering if you can install audio/video codecs on windows 11, whether web would then work as it uses native backend? If that doesn't work, maybe an addon to chrome for codec

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants