media-kit / media-kit

A cross-platform video player & audio player for Flutter & Dart.
https://github.com/media-kit/media-kit
MIT License
893 stars 126 forks source link

horizontally flip a video in player #772

Open vadapalliravikumar opened 1 month ago

vadapalliravikumar commented 1 month ago

Is it possible to horizontally flip (mirror) a video in the video player ? Use case is to let the users dynamically select the flipped view or normal view of the selfie video recording.

Gieted commented 4 weeks ago

Mpv has command vf toggle hflip. To execute command do:

final nativePlayer = player.platform as NativePlayer;
  final command = 'vf toggle hflip'.toNativeUtf8();
  nativePlayer.mpv.mpv_command_string(
    nativePlayer.ctx,
    command.cast(),
  );
  calloc.free(command);

Hope it works, haven't tested that.