Git Product home page Git Product logo

Comments (26)

abdelaziz-mahdy avatar abdelaziz-mahdy commented on September 25, 2024 3

i was able to fix the example by moving the init controller for video to the initstate and now it works all the time, can you check on your device too

import 'package:flutter/material.dart';
import 'package:media_kit/media_kit.dart';
import 'package:media_kit_video/media_kit_video.dart';

void main() {
  MediaKit.ensureInitialized();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'MPV Test',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final Player _player = Player();
  late final VideoController _controller;

  @override
  void initState() {
    super.initState();
    _controller = VideoController(_player);
  }

  bool videoing = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Center(
            child: videoing
                ? Stack(
                    children: [
                      Video(
                        controller: _controller,
                        controls: MaterialVideoControls,
                      ),
                      Align(
                        alignment: Alignment.centerLeft,
                        child: IconButton(
                          icon: const Icon(Icons.arrow_back),
                          onPressed: () {
                            _player.stop().then((_) {
                              setState(() {
                                videoing = false;
                              });
                            });
                          },
                        ),
                      )
                    ],
                  )
                : TextField(
                    onSubmitted: (value) {
                      _player
                          .open(Media(
                              value // for example https://file-examples.com/storage/fe83e1f11c664c2259506f1/2017/04/file_example_MP4_480_1_5MG.mp4
                              ))
                          .then((_) {
                        setState(() {
                          videoing = true;
                        });
                      });
                    },
                  )));
  }
}

and yes i noticed the difference in the logs too, will need to check why it doesnt get called

from media-kit.

Bonfra04 avatar Bonfra04 commented on September 25, 2024 2

I'd like also to point out that comparing the logs of this non-working run with the ones of a run that instead worked, nothing about the surface is printed. Eg. "com.alexmercerind.media_kit_video.VideoOutputManager.setSurfaceTextureSize" or "com.alexmercerind.media_kit_video.VideoOutputManager.createSurface"

from media-kit.

Bonfra04 avatar Bonfra04 commented on September 25, 2024 1

Yes, it works in this PoC and the main app I'm developing! Thanks a lot

from media-kit.

abdelaziz-mahdy avatar abdelaziz-mahdy commented on September 25, 2024 1

@aykxt how to disable impeller?

The default is disabled, you changed the android manifest to enable it, or you added it to the run command

Removing the change should disable it

Check https://docs.flutter.dev/perf/impeller#android for more info

from media-kit.

wiedymi avatar wiedymi commented on September 25, 2024

I have same issue

from media-kit.

codesimo avatar codesimo commented on September 25, 2024

Same issue!

from media-kit.

abdelaziz-mahdy avatar abdelaziz-mahdy commented on September 25, 2024

Anyone using impeller? It's not supported yet

from media-kit.

abdelaziz-mahdy avatar abdelaziz-mahdy commented on September 25, 2024

Also please provide any logs related to the issue, an error, or a not understandable log will help

from media-kit.

Bonfra04 avatar Bonfra04 commented on September 25, 2024

@abdelaziz-mahdy Nope, just a clean installation of flutter following the wiki and a normal flutter run on the project. Logs coming

from media-kit.

Bonfra04 avatar Bonfra04 commented on September 25, 2024

Logs of the app from startup, to link pasted, to playing: (logLevel: MPVLogLevel.trace)

Launching lib\main.dart on DN2103 in debug mode...
√ Built build\app\outputs\flutter-apk\app-debug.apk
D/VRI[MainActivity](18909):  debugCancelDraw some OnPreDrawListener onPreDraw return false,cancelDraw=true,count=50,android.view.ViewRootImpl@ca76c4
Connecting to VM Service at ws://127.0.0.1:62124/a6YsWvhf-WY=/ws
I/Quality (18909): Skipped: false 7 cost 82.7343 refreshRate 11207485 bit true processName com.example.mpv_test
D/hw-ProcessState(18909): Binder ioctl to enable oneway spam detection failed: Invalid argument
D/BLASTBufferQueue(18909): [SurfaceView[com.example.mpv_test/com.example.mpv_test.MainActivity]#1](f:0,a:1) acquireNextBufferLocked size=1080x2268 mFrameNumber=1 applyTransaction=true mTimestamp=20788780204854(auto) mPendingTransactions.size=0 graphicBufferId=81213536600064 transform=0
D/VRI[MainActivity](18909): registerCallbacksForSync syncBuffer=false
D/BLASTBufferQueue(18909): [VRI[MainActivity]#0](f:0,a:1) acquireNextBufferLocked size=1080x2400 mFrameNumber=1 applyTransaction=true mTimestamp=20788797482700(auto) mPendingTransactions.size=0 graphicBufferId=81213536600065 transform=0
D/VRI[MainActivity](18909): Received frameCommittedCallback lastAttemptedDrawFrameNum=1 didProduceBuffer=true syncBuffer=false
W/Parcel  (18909): Expecting binder but got null!
D/VRI[MainActivity](18909):  debugCancelDraw  cancelDraw=false,count = 277,android.view.ViewRootImpl@ca76c4
D/VRI[MainActivity](18909): draw finished.
D/VRI[MainActivity](18909): onFocusEvent true
V/AutofillManager(18909): requestHideFillUi(null): anchor = null
D/OplusInputMethodManagerInternal(18909): get inputMethodManager extension: com.android.internal.view.IInputMethodManager$Stub$Proxy@7e5fec0
D/InputMethodManager(18909): showSoftInput() view=io.flutter.embedding.android.FlutterView{4673ab6 VFED..... .F....ID 0,0-1080,2268 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
V/AutofillManager(18909): receiver results: flags=7 enabled=true, enabledForAugmentedOnly: false
V/AutofillManager(18909): startSessionLocked(): id=1073741824:-1052044933, bounds=Rect(0, 1098 - 1080, 1170), value=null, flags=0, state=UNKNOWN, compatMode=false, augmentedOnly=false, enabledAugmentedOnly=false, enteredIds=null
I/Quality (18909): Skipped: false 1 cost 20.246971 refreshRate 16935028 bit true processName com.example.mpv_test
I/AssistStructure(18909): Flattened final assist data: 384 bytes, containing 1 windows, 3 views
D/InputConnectionAdaptor(18909): The input method toggled cursor monitoring on
W/OnBackInvokedCallback(18909): OnBackInvokedCallback is not enabled for the application.
W/OnBackInvokedCallback(18909): Set 'android:enableOnBackInvokedCallback="true"' in the application manifest.
D/InsetsController(18909): show(ime(), fromIme=true)
D/OplusWindowManager(18909): get WMS extension: android.os.BinderProxy@b1a1b6d
V/AutofillManager(18909): requestHideFillUi(null): anchor = null
D/InputMethodManager(18909): showSoftInput() view=io.flutter.embedding.android.FlutterView{4673ab6 VFED..... .F...... 0,0-1080,2268 #1 aid=1073741824} flags=0 reason=SHOW_SOFT_INPUT
V/AutofillManager(18909): updateSessionLocked(): id=1073741824:-1052044933, bounds=null, value=[type=1, value=96_chars], action=4, flags=128
D/InsetsController(18909): show(ime(), fromIme=true)
V/AutofillManager(18909): notifyViewExited(1073741824, -1052044933
V/AutofillManager(18909): updateSessionLocked(): id=1073741824:-1052044933, bounds=null, value=null, action=3, flags=0
I/flutter (18909): media_kit: wakelock: _count = 1
D/AudioManagerExtImpl(18909): getStreamVolume packageName=com.example.mpv_test, index=0, streamType=3
I/media_kit(18909): com.alexmercerind.media_kit_video.VideoOutputManager.create: -5476376633240732080
D/BufferQueueConsumer(18909): [](id:49dd00000002,api:0,p:-1,c:18909) connect: controlledByApp=true
I/media_kit(18909): flutterJNIAPIAvailable = true
I/media_kit(18909): com.alexmercerind.media_kit_video.VideoOutput: id = 0
D/AudioManagerExtImpl(18909): getStreamVolume packageName=com.example.mpv_test, index=0, streamType=3
I/flutter (18909): {id: 0}
W/AudioCapabilities(18909): Unsupported mime audio/x-adpcm-dvi-ima
W/AudioCapabilities(18909): Unsupported mime audio/x-adpcm-dvi-ima
W/AudioCapabilities(18909): Unsupported mime audio/x-adpcm-ms
W/AudioCapabilities(18909): Unsupported mime audio/x-adpcm-ms
W/AudioCapabilities(18909): Unsupported mime audio/alac
W/AudioCapabilities(18909): Unsupported mime audio/alac
W/AudioCapabilities(18909): Unsupported mime audio/ape
W/AudioCapabilities(18909): Unsupported mime audio/ape
W/AudioCapabilities(18909): Unsupported mime audio/ffmpeg
D/MediaCodecListExtImpl(18909): mIsDisableAv1=false
W/VideoCapabilities(18909): Unsupported mime image/vnd.android.heic
W/VideoCapabilities(18909): Unsupported mime image/vnd.android.heic
W/VideoCapabilities(18909): Unsupported mime image/vnd.android.heic
W/VideoCapabilities(18909): Unsupported mime image/vnd.android.heic
W/VideoCapabilities(18909): Unrecognized profile/level 32768/256 for video/mp4v-es
W/VideoCapabilities(18909): Unrecognized profile/level 32768/256 for video/mp4v-es
W/VideoCapabilities(18909): Unsupported mime video/x-ms-wmv
W/VideoCapabilities(18909): Unsupported mime video/x-ms-wmv
W/VideoCapabilities(18909): Unsupported mime video/ffmpeg
D/MediaCodec(18909): CreateByComponentName: name c2.mtk.avc.decoder
D/CCodecBufferChannel(18909): isHighPerformance=0,model=MT6893
D/CCodecBufferChannel(18909): mBufferCountDebug=0 mIsUserLoad=1
D/OplusCCodec(18909): OplusCCodec [130]: (0xb400007793a6ba80)
W/libc    (18909): Access denied finding property "vendor.oplus.media.vpp.stutter"
D/ListServiceUtils(18909): mListServiceUtils::init CallingPid 18909
D/ListServiceUtils(18909): mListServiceUtils::init this 0xb4000075f84b49c0
V/ListServiceUtils(18909): checkInListByUid module:sr-osie-whitelist uid:10618 cost 162us return (null)
D/CCodecBufferChannel(18909): isHighPerformance=0,model=MT6893
D/CCodecBufferChannel(18909): mBufferCountDebug=0 mIsUserLoad=1
D/MediaCodec(18909): [0xb4000075f8299000] init: CCodec 0xb400007793a6ba80, CCodecBufferChannel 0xb4000075f8334a18
D/MediaCodec(18909): [0xb4000075f8299000] setState: 1
D/CCodec  (18909): allocate(c2.mtk.avc.decoder)
I/Codec2Client(18909): Available Codec2 services: "default" "software"
I/CCodec  (18909): setting up 'default' as default (vendor) store
I/CCodec  (18909): Created component [c2.mtk.avc.decoder]
D/CCodecBufferChannel(18909): [0xb4000075f8334a18] setComponent: mName c2.mtk.avc.decoder#95, mPipelineWatcher 0xb4000075f8334e80
D/CCodecBufferChannel(18909): PipelineWatcher debug info [c2.mtk.avc.decoder#95] enable=0
D/CCodecConfig(18909): read media type: video/avc
D/ReflectedParamUpdater(18909): extent() != 1 for single value type: algo.buffers.max-count.values
D/ReflectedParamUpdater(18909): extent() != 1 for single value type: output.subscribed-indices.values
D/ReflectedParamUpdater(18909): extent() != 1 for single value type: input.buffers.allocator-ids.values
D/ReflectedParamUpdater(18909): extent() != 1 for single value type: output.buffers.allocator-ids.values
D/ReflectedParamUpdater(18909): extent() != 1 for single value type: algo.buffers.allocator-ids.values
D/ReflectedParamUpdater(18909): extent() != 1 for single value type: output.buffers.pool-ids.values
D/ReflectedParamUpdater(18909): extent() != 1 for single value type: algo.buffers.pool-ids.values
D/ReflectedParamUpdater(18909): ignored struct field coded.color-format.locations
D/CCodecConfig(18909): ignoring local param raw.size (0xd2001800) as it is already supported
D/CCodecConfig(18909): ignoring local param raw.crop (0xd2001801) as it is already supported
D/CCodecConfig(18909): ignoring local param default.color (0x5200180b) as it is already supported
D/CCodecConfig(18909): ignoring local param raw.hdr-static-info (0xd200180a) as it is already supported
I/CCodecConfig(18909): query failed after returning 17 values (BAD_INDEX)
D/CCodecConfig(18909): c2 config diff is Dict {
D/CCodecConfig(18909):   c2::i32 algo.priority.value = 1
D/CCodecConfig(18909):   c2::float algo.rate.value = 0
D/CCodecConfig(18909):   c2::float coded.frame-rate.value = 30
D/CCodecConfig(18909):   c2::u32 coded.pl.level = 20496
D/CCodecConfig(18909):   c2::u32 coded.pl.profile = 20481
D/CCodecConfig(18909):   c2::u32 coded.vui.color.matrix = 0
D/CCodecConfig(18909):   c2::u32 coded.vui.color.primaries = 0
D/CCodecConfig(18909):   c2::u32 coded.vui.color.range = 2
D/CCodecConfig(18909):   c2::u32 coded.vui.color.transfer = 0
D/CCodecConfig(18909):   c2::u32 default.color.matrix = 0
D/CCodecConfig(18909):   c2::u32 default.color.primaries = 0
D/CCodecConfig(18909):   c2::u32 default.color.range = 0
D/CCodecConfig(18909):   c2::u32 default.color.transfer = 0
D/CCodecConfig(18909):   c2::u32 input.buffers.max-size.value = 2097152
D/CCodecConfig(18909):   c2::u32 input.delay.value = 4
D/CCodecConfig(18909):   string input.media-type.value = "video/avc"
D/CCodecConfig(18909):   c2::u32 output.delay.value = 12
D/CCodecConfig(18909):   string output.media-type.value = "video/raw"
D/CCodecConfig(18909):   c2::u32 raw.color.matrix = 0
D/CCodecConfig(18909):   c2::u32 raw.color.primaries = 0
D/CCodecConfig(18909):   c2::u32 raw.color.range = 2
D/CCodecConfig(18909):   c2::u32 raw.color.transfer = 0
D/CCodecConfig(18909):   c2::u32 raw.crop.height = 239
D/CCodecConfig(18909):   c2::u32 raw.crop.left = 0
D/CCodecConfig(18909):   c2::u32 raw.crop.top = 0
D/CCodecConfig(18909):   c2::u32 raw.crop.width = 319
D/CCodecConfig(18909):   c2::float raw.hdr-static-info.mastering.blue.x = 0
D/CCodecConfig(18909):   c2::float raw.hdr-s
W/ColorUtils(18909): expected specified color aspects (2:0:0:0)
D/MediaCodec(18909): [0xb4000075f8299000] setState: 2
I/MediaCodec(18909): [0xb4000075f8299000] [c2.mtk.avc.decoder] configure, format : AMessage(what = 0x00000000) = {
I/MediaCodec(18909):   Buffer csd-1 = {
I/MediaCodec(18909):     00000000:  00 00 00 01 68 cb 8c b2                           ....h...
I/MediaCodec(18909):   }
I/MediaCodec(18909):   string mime = "video/avc"
I/MediaCodec(18909):   int32_t width = 480
I/MediaCodec(18909):   Buffer csd-0 = {
I/MediaCodec(18909):     00000000:  00 00 00 01 67 42 c0 1e  d9 01 e0 8f eb 01 10 00  ....gB..........
I/MediaCodec(18909):     00000010:  00 03 00 10 00 00 03 03  c0 f1 62 e4 80           ..........b..
I/MediaCodec(18909):   }
I/MediaCodec(18909):   int32_t height = 270
I/MediaCodec(18909): }
D/MediaCodec(18909): flushMediametrics
D/MediaCodec(18909): [0xb4000075f8299000] setState: 3
V/ListServiceUtils(18909): checkInListByUid module:sr-osie-whitelist uid:10618 cost 73us return (null)
D/OplusCCodec(18909): debug enabled , debugType :0
D/OplusCCodec(18909): [initiateConfigureComponent:L500] OplusFeedbackInfo  mFeedbackID:-5476376633304237440
W/AString (18909): ctor got NULL, using empty string instead
V/ListServiceUtils(18909): checkInListByUid pid:18909 procName: cost 46us return -1
D/AtlasEventUploadUtils(18909): setEvent event:atlas_event_video_monitor_network_switch
D/IAtlas  (18909): IAtlas::init CallingPid 18909
D/IAtlas  (18909): IAtlas::init this 0xb4000075f94b7740
V/ListServiceUtils(18909): checkInListByUid start module:check-first-IRAP uid:10618  time 20794291451us
V/ListServiceUtils(18909): checkInListByUid end module:check-first-IRAP uid:10618  time 20794291529us
D/ListServiceUtils(18909): checkInListByUid module:check-first-IRAP uid:10618 cost 77us return 0
V/ListServiceUtils(18909): checkInListByUid start module:notify-network-optimize uid:10618  time 20794291540us
V/ListServiceUtils(18909): checkInListByUid end module:notify-network-optimize uid:10618  time 20794291597us
D/ListServiceUtils(18909): checkInListByUid module:notify-network-optimize uid:10618 cost 57us return 0
V/ListServiceUtils(18909): checkInListByUid start module:video-statistics uid:10618  time 20794291607us
V/ListServiceUtils(18909): checkInListByUid end module:video-statistics uid:10618  time 20794291643us
D/ListServiceUtils(18909): checkInListByUid module:video-statistics uid:10618 cost 36us return 0
V/ListServiceUtils(18909): checkInListByUid module:video-resolution-blurry uid:10618 cost 40us return (null)
V/ListServiceUtils(18909): checkInListByUid start module:mtkomx-color-convert uid:10618  time 20794291699us
V/ListServiceUtils(18909): checkInListByUid end module:mtkomx-color-convert uid:10618  time 20794291740us
D/ListServiceUtils(18909): checkInListByUid module:mtkomx-color-convert uid:10618 cost 40us return 0
V/ListServiceUtils(18909): checkInListByPid module:mtkomx-color-convert pid:18909 cost 103us return 0
V/ListServiceUtils(18909): getListValueByTopActivity module:mtk-vdec-cpu-boost pid:18909 cost 95us return 0
D/CCodec  (18909): [c2.mtk.avc.decoder] buffers are bound to CCodec for this session
D/CCodec  (18909): Client requested ByteBuffer mode decoder w/o color format set: using default planar color format
D/CCodecConfig(18909): no c2 equivalents for csd-1
D/CCodecConfig(18909): no c2 equivalents for flags
D/CCodecConfig(18909): c2 config diff is   c2::u32 raw.size.height = 270
D/CCodecConfig(18909):   c2::u32 raw.size.width = 480
W/ColorUtils(18909): expected specified color aspects (2:0:0:0)
W/Codec2Client(18909): query -- param skipped: index = 1107298332.
D/CCodec  (18909): encoding statistics level = 0
D/CCodec  (18909): setup formats input: AMessage(what = 0x00000000) = {
D/CCodec  (18909):   string mime = "video/avc"
D/CCodec  (18909):   int32_t width = 480
D/CCodec  (18909):   int32_t profile = 65536
D/CCodec  (18909):   int32_t priority = -1
D/CCodec  (18909):   int32_t frame-rate = 30
D/CCodec  (18909):   int32_t height = 270
D/CCodec  (18909):   int32_t level = 65536
D/CCodec  (18909):   int32_t max-input-size = 2097152
D/CCodec  (18909):   Rect crop(0, 0, 318, 238)
D/CCodec  (18909): }
D/CCodec  (18909): setup formats output: AMessage(what = 0x00000000) = {
D/CCodec  (18909):   int32_t android._color-format = 2135033992
D/CCodec  (18909):   int32_t android._video-scaling = 1
D/CCodec  (18909):   int32_t sar-width = 1
D/CCodec  (18909):   int32_t color-standard = 0
D/CCodec  (18909):   int32_t color-range = 2
D/CCodec  (18909):   int32_t color-transfer = 0
D/CCodec  (18909):   int32_t android._dataspace = 268435456
D/CCodec  (18909):   int32_t width = 480
D/CCodec  (18909):   int32_t rotation-degrees = 0
D/CCodec  (18909):   int32_t sar-height = 1
D/CCodec  (18909):   int32_t max-width = 320
D/CCodec  (18909):   int32_t max-height = 240
D/CCodec  (18909):   int32_t priority = -1
D/CCodec  (18909):   string mime = "video/raw"
D/CCodec  (18909):   Rect crop(0, 0, 318, 238)
D/CCodec  (18909):   Buffer hdr-static-info = {
D/CCodec  (18909):     00000000:  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
D/CCodec  (18909):     00000010:  00 00 00 00 00 00 00 00  00                       .........
D/CCodec  (18909):   }
D/CCodec  (18909):   int32_t frame-rate = 30
D/CCodec  (18909):   int32_t height = 270
D/CCodec  (18909):   int32_t color-format = 19
D/CCodec  (18909): }
I/CCodecConfig(18909): query failed after returning 17 values (BAD_INDEX)
D/CCodecConfig(18909): c2 config diff is   c2::u32 raw.max-size.height = 270
D/CCodecConfig(18909):   c2::u32 raw.max-size.width = 480
W/ColorUtils(18909): expected specified color aspects (2:0:0:0)
D/MediaCodec(18909): [0xb4000075f8299000] setState: 4
D/MediaCodec(18909): [0xb4000075f8299000] setState: 5
W/Codec2Client(18909): query -- param skipped: index = 1342179345.
W/Codec2Client(18909): query -- param skipped: index = 2415921170.
W/Codec2Client(18909): query -- param skipped: index = 1610614798.
D/C2Store (18909): Using ION
D/CCodecBufferChannel(18909): [c2.mtk.avc.decoder#95] Created input block pool with allocatorID 16 => poolID 17 - OK (0)
D/CCodecBufferChannel(18909): [c2.mtk.avc.decoder#95] Configured output block pool ids 1 => OK
D/CCodecBufferChannel(18909): [0xb4000075f8334a18] [c2.mtk.avc.decoder#95] start: output->outputDelay 12, output->numSlots 16
D/CCodecBufferChannel(18909): [c2.mtk.avc.decoder#95] Configured output usage [0x1]
E/ion     (18909): ioctl c0044901 failed with code -1: Invalid argument
D/MediaCodec(18909): [0xb4000075f8299000] setState: 6
D/CCodecBuffers(18909): [c2.mtk.avc.decoder#95:1D-Input.Impl[N]] converted 8 buffers to array mode of 8
D/CCodecBuffers(18909): [c2.mtk.avc.decoder#95:2D-BB-Output.Impl[N]] converted 0 buffers to array mode of 16
D/CCodecConfig(18909): c2 config diff is   c2::u32 output.delay.value = 14
D/CCodecConfig(18909):   c2::u32 raw.color.range = 0
W/ColorUtils(18909): expected specified color aspects (0:0:0:0)
D/CCodecBufferChannel(18909): [c2.mtk.avc.decoder#95] onWorkDone: updating output delay 14
D/CCodecBufferChannel(18909): [c2.mtk.avc.decoder#95] Ignoring stale input buffer done callback: last flush index = 0, frameIndex = 0
D/Codec2-OutputBufferQueue(18909): set max dequeue count 21 from update
D/CCodecConfig(18909): c2 config diff is   c2::u32 raw.crop.height = 270
D/CCodecConfig(18909):   c2::u32 raw.crop.width = 480
D/CCodecConfig(18909):   c2::u32 raw.pixel-format.value = 842094169
W/ColorUtils(18909): expected specified color aspects (0:0:0:0)
D/CCodecBuffers(18909): [c2.mtk.avc.decoder#95:Output[N]] popFromStashAndRegister: at 0us, output format changed to AMessage(what = 0x00000000) = {
D/CCodecBuffers(18909):   int32_t android._color-format = 2135033992
D/CCodecBuffers(18909):   int32_t android._video-scaling = 1
D/CCodecBuffers(18909):   int32_t sar-width = 1
D/CCodecBuffers(18909):   int32_t color-standard = 0
D/CCodecBuffers(18909):   int32_t color-range = 0
D/CCodecBuffers(18909):   int32_t color-transfer = 0
D/CCodecBuffers(18909):   int32_t android._dataspace = 0
D/CCodecBuffers(18909):   int32_t width = 480
D/CCodecBuffers(18909):   int32_t rotation-degrees = 0
D/CCodecBuffers(18909):   int32_t sar-height = 1
D/CCodecBuffers(18909):   int32_t max-width = 480
D/CCodecBuffers(18909):   int32_t max-height = 270
D/CCodecBuffers(18909):   int32_t priority = -1
D/CCodecBuffers(18909):   string mime = "video/raw"
D/CCodecBuffers(18909):   Rect crop(0, 0, 479, 269)
D/CCodecBuffers(18909):   Buffer hdr-static-info = {
D/CCodecBuffers(18909):     00000000:  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
D/CCodecBuffers(18909):     00000010:  00 00 00 00 00 00 00 00  00                       .........
D/CCodecBuffers(18909):   }
D/CCodecBuffers(18909):   int32_t frame-rate = 30
D/CCodecBuffers(18909):   int32_t height = 270
D/CCodecBuffers(18909):   int32_t color-format = 19
D/CCodecBuffers(18909): }
E/ion     (18909): ioctl c0044901 failed with code -1: Invalid argument
D/CCodecBuffers(18909): [c2.mtk.avc.decoder#95:Output[N]] updating image-data
D/CCodecBuffers(18909): [c2.mtk.avc.decoder#95:Output[N]] updating stride = 480, width: 480, height: 270
D/CCodecBuffers(18909): [c2.mtk.avc.decoder#95:Output[N]] updating vstride = 270
D/xample.mpv_test(18909): PlayerBase::PlayerBase()
D/xample.mpv_test(18909): TrackPlayerBase::TrackPlayerBase()
I/libOpenSLES(18909): android_audioPlayer_realize, channel mask 0x3
I/libOpenSLES(18909): android_audioPlayer_realize, create default channel mask 0x3, channels 2
I/libOpenSLES(18909): Emulating old channel mask behavior (ignoring positional mask 0x3, using default mask 0x3 based on channel count of 2)
D/AudioTrackExtImpl(18909): AudioTrackExtImpl init
D/AudioTrack(18909): set(): streamType 3, sampleRate 48000, format 0x5, channelMask 0x3, frameCount 0, flags #104, notificationFrames -8, sessionId 3329, transferType 0, uid -1, pid -1
I/AudioTrack(18909): set(): 0xb4000075f8399800, Create AudioTrackThread, tid = 20042
E/AudioSystem(18909): invalid attributes { Content type: AUDIO_CONTENT_TYPE_UNKNOWN Usage: AUDIO_USAGE_UNKNOWN Source: AUDIO_SOURCE_DEFAULT Flags: 0x0 Tags:  } when converting to stream
I/AudioTrack(18909): createTrack_l(119): AUDIO_OUTPUT_FLAG_FAST successful; frameCount 0 -> 2048
I/AudioTrack(18909): createTrack_l(432) on outputId(29) : 0xb4000075f8399800, mCblk = 0x784ff17000,  mLatency = 84, mAfLatency = 42, frameCount = 2048, mSampleRate = 48000, mFlags = 0x4, mReqFrameCount = 2048, mNotificationFramesAct = 256
V/ListServiceUtils(18909): checkInListByUid module:audio-choppy-boost uid:10618 cost 69us return (null)
V/ListServiceUtils(18909): checkInListByUid start module:change-futex-timeout uid:10618  time 20794389321us
V/ListServiceUtils(18909): checkInListByUid end module:change-futex-timeout uid:10618  time 20794389371us
D/ListServiceUtils(18909): checkInListByUid module:change-futex-timeout uid:10618 cost 49us return 0
D/AudioTrack(18909): start(432): prior state:STATE_STOPPED output 29 stream 3 session 3329
D/AudioTrackExtImpl(18909): setAudioBoostTid
D/AudioTrackExtImpl(18909): oplusDumpValue PID is 18909  Tid is 19988
D/xample.mpv_test(18909): PlayerBase::stop() from IPlayer
D/AudioTrack(18909): stop(432): prior state:STATE_ACTIVE output 29 stream 3 session 3329
D/AudioTrack(18909): stop(432): called with 0 frames delivered
D/AudioTrackExtImpl(18909): clearAudioBoostTid
D/AudioTrackExtImpl(18909): clearAudioBoostTid  pid 18909  tid 19988
I/AudioTrack(18909): stop(432): 0xb4000075f8399800 stop done
E/libOpenSLES(18909): Configuration error: unknown key
W/libOpenSLES(18909): Leaving AndroidConfiguration::GetConfiguration (SL_RESULT_PARAMETER_INVALID)
D/AudioTrack(18909): start(432): prior state:STATE_STOPPED output 29 stream 3 session 3329
D/AudioTrackExtImpl(18909): setAudioBoostTid
D/AudioTrackExtImpl(18909): oplusDumpValue PID is 18909  Tid is 19988
I/OplusFeedbackInfo(18909): 0xb4000075f8294600 c2.mtk.avc.decoder 480x270 inputFps=39 outputFps=40 renderFps=0, discardFps=31
I/OplusFeedbackInfo(18909): 0xb4000075f8294600 c2.mtk.avc.decoder 480x270 inputFps=28 outputFps=28 renderFps=0, discardFps=30
I/OplusFeedbackInfo(18909): 0xb4000075f8294600 c2.mtk.avc.decoder 480x270 inputFps=31 outputFps=31 renderFps=0, discardFps=30
D/CCodecBufferChannel(18909): [c2.mtk.avc.decoder#95] DEBUG: elapsed: mInputMetEos 18, hasPendingOutputsInClient 0, n=1 [in=4 pipeline=0 out=14]
D/PipelineWatcher(18909): [0xb4000075f8334e80] elapsed: mFramesInPipeline 0, n 18
I/OplusFeedbackInfo(18909): 0xb4000075f8294600 c2.mtk.avc.decoder 480x270 inputFps=27 outputFps=27 renderFps=0, discardFps=30
D/BufferPoolAccessor2.0(18909): bufferpool2 0xb40000772cdcfc28 : 10(20971520 size) total buffers - 8(16777216 size) used buffers - 0/10 (recycle/alloc) - 10/154 (fetch/transfer)
D/BufferPoolAccessor2.0(18909): evictor expired: 1, evicted: 1
I/OplusFeedbackInfo(18909): 0xb4000075f8294600 c2.mtk.avc.decoder 480x270 inputFps=29 outputFps=29 renderFps=0, discardFps=30
I/OplusFeedbackInfo(18909): 0xb4000075f8294600 c2.mtk.avc.decoder 480x270 inputFps=37 outputFps=30 renderFps=0, discardFps=30

from media-kit.

abdelaziz-mahdy avatar abdelaziz-mahdy commented on September 25, 2024

i will leave issue opened until a fix for that problem is released, but my workaround should work for now

from media-kit.

aykxt avatar aykxt commented on September 25, 2024

I experience the same issue when impeller is enabled. Disabling impeller resolves this problem.

from media-kit.

abdelaziz-mahdy avatar abdelaziz-mahdy commented on September 25, 2024

I experience the same issue when impeller is enabled. Disabling impeller resolves this problem.

Yes since impeller is not enabled and migration to not complete

from media-kit.

wiedymi avatar wiedymi commented on September 25, 2024

@aykxt how to disable impeller?

from media-kit.

2shrestha22 avatar 2shrestha22 commented on September 25, 2024

i was able to fix the example by moving the init controller for video to the initstate and now it works all the time, can you check on your device too

import 'package:flutter/material.dart';
import 'package:media_kit/media_kit.dart';
import 'package:media_kit_video/media_kit_video.dart';

void main() {
  MediaKit.ensureInitialized();
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      title: 'MPV Test',
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({super.key});

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  final Player _player = Player();
  late final VideoController _controller;

  @override
  void initState() {
    super.initState();
    _controller = VideoController(_player);
  }

  bool videoing = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        body: Center(
            child: videoing
                ? Stack(
                    children: [
                      Video(
                        controller: _controller,
                        controls: MaterialVideoControls,
                      ),
                      Align(
                        alignment: Alignment.centerLeft,
                        child: IconButton(
                          icon: const Icon(Icons.arrow_back),
                          onPressed: () {
                            _player.stop().then((_) {
                              setState(() {
                                videoing = false;
                              });
                            });
                          },
                        ),
                      )
                    ],
                  )
                : TextField(
                    onSubmitted: (value) {
                      _player
                          .open(Media(
                              value // for example https://file-examples.com/storage/fe83e1f11c664c2259506f1/2017/04/file_example_MP4_480_1_5MG.mp4
                              ))
                          .then((_) {
                        setState(() {
                          videoing = true;
                        });
                      });
                    },
                  )));
  }
}

and yes i noticed the difference in the logs too, will need to check why it doesnt get called

This solved my all issue.

  • video sometimes not showing
  • video does not showing in release mode.

from media-kit.

alexmercerind avatar alexmercerind commented on September 25, 2024

Has there been any major change in recent Flutter versions which caused this? I had to very precisely come up with current implementation so that everything worked correctly with Android surface creation/destruction.

from media-kit.

lifei avatar lifei commented on September 25, 2024

I tried both two methods, no lucky.

disable impeller

        <meta-data
            android:name="io.flutter.embedding.android.EnableImpeller"
            android:value="false" />

move controller initialization process into initState()

  final player = Player();
  late final VideoController controller;

  StreamSubscription<String>? errorStream;
  @override
  void initState() {
    super.initState();
    controller = VideoController(player);

from media-kit.

abdelaziz-mahdy avatar abdelaziz-mahdy commented on September 25, 2024

You have to do both, not one

from media-kit.

lifei avatar lifei commented on September 25, 2024
I/media_kit(26694): com.alexmercerind.media_kit_video.VideoOutputManager.setSurfaceTextureSize: -5476376672181434832 368 640
E/EGL_emulation(26694): tid 26895: eglCreateContext(1751): error 0x3004 (EGL_BAD_ATTRIBUTE)
E/EGL_emulation(26694): tid 26896: eglCreateContext(1751): error 0x3004 (EGL_BAD_ATTRIBUTE)
D/EGL_emulation(26694): app_time_stats: avg=112.55ms min=9.17ms max=501.38ms count=9
I/ImeTracker(26694): com.example.third_demo:306a7ac9: onRequestHide at ORIGIN_CLIENT reason HIDE_SOFT_INPUT_ON_ANIMATION_STATE_CHANGED fromUser false
I/ImeTracker(26694): com.example.third_demo:224f554e: onHidden

this is the logs.

from media-kit.

abdelaziz-mahdy avatar abdelaziz-mahdy commented on September 25, 2024
I/media_kit(26694): com.alexmercerind.media_kit_video.VideoOutputManager.setSurfaceTextureSize: -5476376672181434832 368 640
E/EGL_emulation(26694): tid 26895: eglCreateContext(1751): error 0x3004 (EGL_BAD_ATTRIBUTE)
E/EGL_emulation(26694): tid 26896: eglCreateContext(1751): error 0x3004 (EGL_BAD_ATTRIBUTE)
D/EGL_emulation(26694): app_time_stats: avg=112.55ms min=9.17ms max=501.38ms count=9
I/ImeTracker(26694): com.example.third_demo:306a7ac9: onRequestHide at ORIGIN_CLIENT reason HIDE_SOFT_INPUT_ON_ANIMATION_STATE_CHANGED fromUser false
I/ImeTracker(26694): com.example.third_demo:224f554e: onHidden

this is the logs.

These logs point that the surface is correctly placed, most probably impeller is enabled

from media-kit.

lifei avatar lifei commented on September 25, 2024

app in emulators does not work. app in real device works fine.

from media-kit.

isaacy13 avatar isaacy13 commented on September 25, 2024

FWIW getting this on Windows, using abdelaziz-mahdy 's solution works for me

  • Flutter 3.19.3
  • Dart 3.3.1

#837 (comment)

from media-kit.

mminhlequang avatar mminhlequang commented on September 25, 2024

anyupdate on this?

from media-kit.

abdelaziz-mahdy avatar abdelaziz-mahdy commented on September 25, 2024

It's not ready on official video_player package yet

edit: i meant impller here

from media-kit.

MaHi177 avatar MaHi177 commented on September 25, 2024

PoC

Not clear. Can you explain it bit more?

from media-kit.

abdelaziz-mahdy avatar abdelaziz-mahdy commented on September 25, 2024

PoC

Not clear. Can you explain it bit more?

poc is proof of concept , follow my example it will work correctly

from media-kit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.