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

Request Feature: Custom parameter passed to mpv #710

Closed
hndrbrm opened this issue Feb 20, 2024 · 2 comments
Closed

Request Feature: Custom parameter passed to mpv #710

hndrbrm opened this issue Feb 20, 2024 · 2 comments

Comments

@hndrbrm
Copy link

hndrbrm commented Feb 20, 2024

In class NativeVideoController the creation of the MPV

    NativeLibrary.ensureInitialized();
    final mpv = MPV(DynamicLibrary.open(NativeLibrary.path));
    final values = {
      'vo': configuration.vo ?? 'libmpv',
      'hwdec': configuration.hwdec ?? 'auto',
      'vid': 'auto',
    };

I need to pass low latency parameter in there, since i want to stream live rtsp.
Something like this:

    final values = {
      'vo': configuration.vo ?? 'libmpv',
      'hwdec': configuration.hwdec ?? 'auto',
      'vid': 'auto',

      // Add this
      'profile': 'low-latency',
      'untimed': '',
      'no-cache': '',
      'no-demuxer-thread': '',
      'vd-lavc-threads': '1',
      
    };

I tried parameter above and its worked, the video stream with low latency.

Is it possible to add some mechanism for that, something like this:

    final values = {
      'vo': configuration.vo ?? 'libmpv',
      'hwdec': configuration.hwdec ?? 'auto',
      'vid': 'auto',
      
      // Add something like this,
      // so the user could add any probable native parameter in there
      if (configuration.extras != null)
      ...configuration.extras,
    };
@abdelaziz-mahdy

This comment was marked as resolved.

@reteset
Copy link

reteset commented Mar 9, 2024

In class NativeVideoController the creation of the MPV

    NativeLibrary.ensureInitialized();
    final mpv = MPV(DynamicLibrary.open(NativeLibrary.path));
    final values = {
      'vo': configuration.vo ?? 'libmpv',
      'hwdec': configuration.hwdec ?? 'auto',
      'vid': 'auto',
    };

I need to pass low latency parameter in there, since i want to stream live rtsp. Something like this:

    final values = {
      'vo': configuration.vo ?? 'libmpv',
      'hwdec': configuration.hwdec ?? 'auto',
      'vid': 'auto',

      // Add this
      'profile': 'low-latency',
      'untimed': '',
      'no-cache': '',
      'no-demuxer-thread': '',
      'vd-lavc-threads': '1',
      
    };

I tried parameter above and its worked, the video stream with low latency.

Is it possible to add some mechanism for that, something like this:

    final values = {
      'vo': configuration.vo ?? 'libmpv',
      'hwdec': configuration.hwdec ?? 'auto',
      'vid': 'auto',
      
      // Add something like this,
      // so the user could add any probable native parameter in there
      if (configuration.extras != null)
      ...configuration.extras,
    };

Hi
You can use something like below

final player = Player();
NativePlayer native = player.platform as NativePlayer;
native.setProperty('profile', 'low-latency');

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

3 participants