Closed naychrist closed 3 months ago
Describe the bug
Running the example here the video (or other local videos) does not play and only black is shown, but no errors: https://github.com/wang-bin/mdk-examples/blob/master/flutter/simple/lib/multi_textures.dart
When checking for changes in media status it reports:
flutter: media: MediaStatus(noMedia) > MediaStatus(+loading) flutter: media: MediaStatus(+loading) > MediaStatus(+invalid)
Note that it is working fine with the high level video player API and that the URL for the video is valid: https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4
I have tried with the latest package and master, with the same results. developing on macos 14.5 but looking to deploy to windows 11.
Expected behavior
The video should load and begin playing and rendering.
Log
added logging code then registerWith() at start of widget initState for log even though I believe register not required:
Launching lib/main.dart on macOS in debug mode... --- xcodebuild: WARNING: Using the first of multiple matching destinations: { platform:macOS, arch:arm64, id:00006001-000259121A9A801E, name:My Mac } { platform:macOS, arch:x86_64, id:00006001-000259121A9A801E, name:My Mac } ✓ Built build/macos/Build/Products/Debug/flutter_desktop_template.app objc[73273]: Class AVFFrameReceiver is implemented in both /opt/homebrew/Cellar/ffmpeg/7.0.1/lib/libavdevice.61.1.100.dylib (0x1009e03a8) and /Applications/_flutter/jm/tac/tac_foyer/build/macos/Build/Products/Debug/flutter_desktop_template.app/Contents/Frameworks/mdk.framework/Versions/A/libffmpeg.7.dylib (0x1021ecd60). One of the two will be used. Which one is undefined. objc[73273]: Class AVFAudioReceiver is implemented in both /opt/homebrew/Cellar/ffmpeg/7.0.1/lib/libavdevice.61.1.100.dylib (0x1009e03f8) and /Applications/_flutter/jm/tac/tac_foyer/build/macos/Build/Products/Debug/flutter_desktop_template.app/Contents/Frameworks/mdk.framework/Versions/A/libffmpeg.7.dylib (0x1021ecdb0). One of the two will be used. Which one is undefined. [IMPORTANT:flutter/shell/platform/darwin/graphics/FlutterDarwinContextMetalSkia.mm(66)] Using the Skia rendering backend (Metal). 2024-08-01 13:46:42.036 flutter_desktop_template[73273:1301230] WARNING: Secure coding is automatically enabled for restorable state! However, not on all supported macOS versions of this application. Opt-in to secure coding explicitly by implementing NSApplicationDelegate.applicationSupportsSecureRestorableState:. 0.29.0 (git 361ba3b) - Multimedia Development Kit. Copyright (c) 2016-2024 WangBin(QtAV author) <wbsecg1 at gmail.com> Build for: macOS110000/14.5.0 16KB ARMv8 AArch64; libc++170006; Apple Clang15.0.0 (clang-1500.3.9.4); 14:01:00 Jul 28 2024 Connecting to VM Service at ws://127.0.0.1:53938/LCF4emcciPM=/ws flutter: WARNING: No settings registered before loading! flutter: LOADING DATA: flutter: {"assets/video/FireDrops.mov":["assets/video/FireDrops.mov"],"assets/video/blink_loop_hap.mov":["assets/video/blink_loop_hap.mov"],"packages/cupertino_icons/assets/CupertinoIcons.ttf":["packages/cupertino_icons/assets/CupertinoIcons.ttf"],"packages/window_manager/images/ic_chrome_close.png":["packages/window_manager/images/ic_chrome_close.png"],"packages/window_manager/images/ic_chrome_maximize.png":["packages/window_manager/images/ic_chrome_maximize.png"],"packages/window_manager/images/ic_chrome_minimize.png":["packages/window_manager/images/ic_chrome_minimize.png"],"packages/window_manager/images/ic_chrome_unmaximize.png":["packages/window_manager/images/ic_chrome_unmaximize.png"]} flutter: widget has init [tcp @ 0x143858d90] Connection to tcp://flutter.github.io:443 failed: Operation not permitted flutter: mdk.INFO: 13:46:43.345: 0.29.0 (git 361ba3b) - Multimedia Development Kit. Copyright (c) 2016-2024 WangBin(QtAV author) <wbsecg1 at gmail.com> Build for: macOS110000/14.5.0 16KB ARMv8 AArch64; libc++170006; Apple Clang15.0.0 (clang-1500.3.9.4); 14:01:00 Jul 28 2024 flutter: mdk.FINE: 13:46:43.350: global option: d3d11.sync.cpu = 1 flutter: mdk.FINE: 13:46:43.350: global option: UserAddress = 0x117987e38 flutter: mdk.FINE: 13:46:43.350: global option: subtitle.fonts.file = /Applications/_flutter/jm/tac/tac_foyer/build/macos/Build/Products/Debug/flutter_desktop_template.app/Contents/MacOS/../Frameworks/App.framework/Resources/flutter_assets/assets/subfont.ttf flutter: mdk.FINE: 13:46:43.350: default 0x143ad2240 new FrameReader... flutter: mdk.FINE: 13:46:43.350: Registered audio backends: AudioQueue OpenAL null flutter: mdk.FINE: 13:46:43.350: default 0x143ad36a0 new FrameReader... flutter: mdk.FINE: 13:46:43.350: Registered audio backends: AudioQueue OpenAL null flutter: mdk.FINE: 13:46:43.351: 0x143ad17b0 player.Player() flutter: mdk.FINE: 13:46:43.351: 0x143ad17b0 player.onEvent(1, 0x16fff16b0) flutter: mdk.FINE: 13:46:43.351: 0x143ad17b0 player.onStateChanged(1) flutter: mdk.FINE: 13:46:43.351: 0x143ad17b0 player.onMediaStatus(1) flutter: mdk.FINE: 13:46:43.351: 0x143ad17b0 player.setMedia(https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4) flutter: mdk.FINE: 13:46:43.351: default FrameReader0x143ad2240 state: 0=>0=>0, 0 flutter: mdk.INFO: 13:46:43.351: default0x143ad2240 stop, current state: 0 flutter: mdk.FINE: 13:46:43.351: AudioQueueStart ERROR: 0 flutter: mdk.FINE: 13:46:43.351: default FrameReader0x143ad2240 state: 0=>0=>0, 0 flutter: mdk.INFO: 13:46:43.351: default0x143ad2240 stop, current state: 0 flutter: mdk.FINE: 13:46:43.351: 0x143ad17b0 player.setLoop(-1) flutter: mdk.INFO: 13:46:43.351: setLoop(-1), now 0/0 flutter: mdk.FINE: 13:46:43.351: 0x143ad17b0 player.set(1) flutter: mdk.FINE: 13:46:43.351: 0x14518c000 virtual void mdk::MediaControlPush::setState(PlaybackState)@1068 requested state 0=>1, current state 0. status: 0 2 flutter: mdk.FINE: 13:46:43.351: AudioQueueStart ERROR: 0 flutter: mdk.FINE: 13:46:43.351: default 0x143ad2240 FrameReader.start(0, ...) flutter: mdk.FINE: 13:46:43.351: default 0x143ad2240 FrameReader::update MediaStatus 0=>0X2 flutter: media: MediaStatus(noMedia) > MediaStatus(+loading) flutter: mdk.FINE: 13:46:43.353: default FrameReader0x143ad2240 state: 0=>0=>1, 0 flutter: mdk.FINE: 13:46:43.353: default FrameReader0x143ad2240 state: 0=>1=>1, 0 flutter: mdk.FINE: 13:46:43.353: start frame reader thread: 0x1713a7000 flutter: mdk.FINE: 13:46:43.353: Selected avformat runtime version: 61.5.101 (build: 61.5.101), license: LGPL version 2.1 or later flutter: mdk.FINE: 13:46:43.353: Selected avformat runtime configuration: --extra-version=avbuild --disable-doc --disable-debug --disable-static --enable-shared --enable-runtime-cpudetect --disable-iamf --disable-vulkan --enable-libxml2 --disable-libxcb --disable-xlib --disable-postproc --enable-cross-compile --arch=arm64 --target-os=darwin --install_name_dir='@rpath' --cc=clang --enable-lto --enable-pic --extra-cflags='-I=/usr/include/libxml2 -arch arm64 -mmacosx-version-min=11.0' --extra-ldflags='-arch arm64 -mmacosx-version-min=11.0 -Wl,-dead_strip -Wl,-rpath,@loader_path -Wl,-rpath,@executable_path/../Frameworks -Wl,-rpath,@loader_path/Libraries -Wl,-rpath,@loader_path/../lib' --enable-small --disable-outdevs --disable-filters --disable-muxers --disable-encoders --disable-decoders --disable-demuxers --disable-protocols --enable-decoder='*sub*,movtext,*web*,aac*,ac3*,eac3*,alac*,ape,ass,ccaption,cfhd,cook,dca,dnxhd,exr,truehd,*yuv*,flv,flac,gif,h26[3-4]*,hevc*,hap,mp[1-3]*,prores,*[mj]peg*,mlp,mpl2,nellymoser,opus,pcm*,qtrle,*png*,tiff,rawvideo,rv*,sami,srt,ssa,v210*,vc1*,vorbis,vp[6-9]*,wm*,wrapped_avframe,av1*,ffv*' --enable-demuxer='*sub*,*ac3,*ac,*[mj]peg*,*web*,au,ape,ass,avi,concat,dnxhd,dts*,*dash*,*flv,gif,hls,h264,hevc,kux,matroska,mov,mp3,mxf,ogg,pcm*,rawvideo,rt*p,spdif,srt,vc1,v210*,wav,*pipe,image2,mlv,nsv,nut' --enable-encoder='*_at,aac,gif,h26[3-4]*,av1*,hevc*,mjpeg*,*png,opus,pcm*,prores*,rawvideo,spdif,speedhq,*jpeg,*png,vp[8-9]*,wrapped_avframe,ff*,*nvenc,*qsv,*v4l2m2m,*vaapi,vorbis,*yuv*' --enable-muxer='*jpeg,fifo,flv,gif,hls,h264,hevc,image2,mov,mp4,mpegts,matroska,null,pcm*,rawvideo,spdif,*pipe,*segment,webm,wav,dash,nu*,og*' --enable-filter='*null*,afade,*fifo,*format,*resample,aeval,atempo,pan,crop,eq*,framerate,hw*,scale,volume,allrgb,allyuv,*bars,color,test*,*key,draw*,*_qsv,*_vaapi,*v4l2*' --enable-protocol='cache,concat*,crypto*,data,fd,*file,ftp,h*,i*,pipe,rt*,s*,t*,u*' flutter: mdk.FINE: 13:46:43.353: global option: ffmpeg.version = 7 flutter: mdk.FINE: 13:46:43.353: avformat_version0x101e8f854 flutter: mdk.FINE: 13:46:43.353: Trying MediaIO FFmpeg flutter: mdk.FINE: 13:46:43.353: 0x143858100 open url: flutter: mdk.FINE: 13:46:43.353: FFmpeg/Libav runtime git-2024-07-09-9fb8d13-avbuild flutter: mdk.FINE: 13:46:43.353: Selected avutil runtime version: 59.28.100 (build: 59.28.100), license: LGPL version 2.1 or later flutter: mdk.FINE: 13:46:43.353: global option: ffmpeg.configuration = --extra-version=avbuild --disable-doc --disable-debug --disable-static --enable-shared --enable-runtime-cpudetect --disable-iamf --disable-vulkan --enable-libxml2 --disable-libxcb --disable-xlib --disable-postproc --enable-cross-compile --arch=arm64 --target-os=darwin --install_name_dir='@rpath' --cc=clang --enable-lto --enable-pic --extra-cflags='-I=/usr/include/libxml2 -arch arm64 -mmacosx-version-min=11.0' --extra-ldflags='-arch arm64 -mmacosx-version-min=11.0 -Wl,-dead_strip -Wl,-rpath,@loader_path -Wl,-rpath,@executable_path/../Frameworks -Wl,-rpath,@loader_path/Libraries -Wl,-rpath,@loader_path/../lib' --enable-small --disable-outdevs --disable-filters --disable-muxers --disable-encoders --disable-decoders --disable-demuxers --disable-protocols --enable-decoder='*sub*,movtext,*web*,aac*,ac3*,eac3*,alac*,ape,ass,ccaption,cfhd,cook,dca,dnxhd,exr,truehd,*yuv*,flv,flac,gif,h26[3-4]*,hevc*,hap,mp[1-3]*,prores,*[mj]peg*,mlp,mpl2,nellymoser,opus,pcm*,qtrle,*png*,tiff,rawvideo,rv*,sami,srt,ssa,v210*,vc1*,vorbis,vp[6-9]*,wm*,wrapped_avframe,av1*,ffv*' --enable-demuxer='*sub*,*ac3,*ac,*[mj]peg*,*web*,au,ape,ass,avi,concat,dnxhd,dts*,*dash*,*flv,gif,hls,h264,hevc,kux,matroska,mov,mp3,mxf,ogg,pcm*,rawvideo,rt*p,spdif,srt,vc1,v210*,wav,*pipe,image2,mlv,nsv,nut' --enable-encoder='*_at,aac,gif,h26[3-4]*,av1*,hevc*,mjpeg*,*png,opus,pcm*,prores*,rawvideo,spdif,speedhq,*jpeg,*png,vp[8-9]*,wrapped_avframe,ff*,*nvenc,*qsv,*v4l2m2m,*vaapi,vorbis,*yuv*' --enable-muxer='*jpeg,fifo,flv,gif,hls,h264,hevc,image2,mov,mp4,mpegts,matroska,null,pcm*,rawvideo,spdif,*pipe,*segment,webm,wav,dash,nu*,og*' --enable-filter='*null*,afade,*fifo,*format,*resample,aeval,atempo,pan,crop,eq*,framerate,hw*,scale,volume,allrgb,allyuv,*bars,color,test*,*key,draw*,*_qsv,*_vaapi,*v4l2*' --enable-protocol='cache,concat*,crypto*,data,fd,*file,ftp,h*,i*,pipe,rt*,s*,t*,u*' flutter: mdk.FINE: 13:46:43.353: av_strerror0x101f37c2c flutter: mdk.FINE: 13:46:43.354: Error avrt::avio_open2(&avio_, ffmpeg::from_file_uri(in.c_str()), flags, &cb, &dict) @166 /Users/runner/work/mdk-sdk/mdk-sdk/mdk/ffmpeg/plugin/AVFormatIO.cpp: (0xffffffff) Operation not permitted flutter: mdk.WARNING: 13:46:43.354: 0x143858100 url open error flutter: mdk.WARNING: 13:46:43.354: Failed to create io for url. io: 0x143858100, open: 0 flutter: mdk.FINE: 13:46:43.354: Selected avcodec runtime version: 61.10.100 (build: 61.10.100), license: LGPL version 2.1 or later flutter: mdk.FINE: 13:46:43.354: avcodec_descriptor_next0x101ca6aac flutter: mdk.FINE: 13:46:43.354: default 0x143ad2240 FrameReader::update MediaStatus 0X2=>0X2 flutter: mdk.FINE: 13:46:43.354: before avformat_open_input. io: 0x0()/pb: 0x0, url: https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4 flutter: mdk.FINE: 13:46:43.354: FFmpeg/Libav runtime git-2024-07-09-9fb8d13-avbuild flutter: mdk.FINE: 13:46:43.354: [FFmpeg:tcp] Connection to tcp://flutter.github.io:443 failed: Operation not permitted flutter: mdk.FINE: 13:46:43.354: Error avrt::avformat_open_input(&fmtctx_, ffmpeg::from_file_uri(in.c_str()), fmt, &dict) @383 /Users/runner/work/mdk-sdk/mdk-sdk/mdk/ffmpeg/plugin/FFmpegPacketIO.cpp: (0xffffffff) Operation not permitted flutter: mdk.FINE: 13:46:43.354: 0x1713a7000default 0x143ad2240 update @1149: reset status_mask. status: 80000000 flutter: mdk.FINE: 13:46:43.354: default 0x143ad2240 FrameReader::update MediaStatus 0X2=>0X80000000 flutter: media: MediaStatus(+loading) > MediaStatus(+invalid) flutter: mdk.WARNING: 13:46:43.354: reader open error flutter: mdk.FINE: 13:46:43.354: 0x1713a7000default 0x143ad2240 update @1149: reset status_mask. status: 80000000 flutter: mdk.FINE: 13:46:43.354: default 0x143ad2240 FrameReader::update MediaStatus 0X80000000=>0X80000000 flutter: mdk.FINE: 13:46:43.354: 0x143ad2240 unload, current status 0x80000000, invalid: 0x80000000, loading: 0, loaded: 0, buffering: 0, seeking: 0, prepared: 0, EOF: 0 flutter: mdk.FINE: 13:46:43.354: default FrameReader0x143ad2240 state: 0=>1=>0, 1 flutter: mdk.SEVERE: 13:46:43.355: state not changed!
apologies this was only due to network entitlements not set in the macos app. working well now. feel free to delete issue thread.
Describe the bug
Running the example here the video (or other local videos) does not play and only black is shown, but no errors: https://github.com/wang-bin/mdk-examples/blob/master/flutter/simple/lib/multi_textures.dart
When checking for changes in media status it reports:
Note that it is working fine with the high level video player API and that the URL for the video is valid: https://flutter.github.io/assets-for-api-docs/assets/videos/bee.mp4
I have tried with the latest package and master, with the same results. developing on macos 14.5 but looking to deploy to windows 11.
Expected behavior
The video should load and begin playing and rendering.
Log
added logging code then registerWith() at start of widget initState for log even though I believe register not required: