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

[!] No podspec found for fvp in .symlinks/plugins/fvp/ios #5

Closed
quochuynh67 opened this issue Jun 29, 2023 · 38 comments
Closed

[!] No podspec found for fvp in .symlinks/plugins/fvp/ios #5

quochuynh67 opened this issue Jun 29, 2023 · 38 comments

Comments

@quochuynh67
Copy link

Hi I am facing with this problem. Could you help me to resolve it?

My Flutter version:
Flutter 3.10.0 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 84a1e904f4 (7 weeks ago) • 2023-05-09 07:41:44 -0700
Engine • revision d44b5a94c9
Tools • Dart 3.0.0 • DevTools 2.23.1

[!] No podspec found for fvp in .symlinks/plugins/fvp/ios

@wang-bin
Copy link
Owner

wang-bin commented Jun 29, 2023

https://github.com/wang-bin/fvp/blob/v0.0.4/pubspec.yaml#L50

I guess this line breaks the build. I'm using 3.10.5, removing this line result in the same error. You can try to clone this repo, make a symbolic link to darwin

cd fvp
ln -sf darwin ios
ln -sf darwin macos

If this can fix the issue, i will publish a new version with this fix.

https://docs.flutter.dev/packages-and-plugins/developing-packages#shared-ios-and-macos-implementations

sharedDarwinSource should work for flutter >= 3.7.0

@quochuynh67
Copy link
Author

@wang-bin Thank you for your reply.

could you help me to resolve it?

@quochuynh67
Copy link
Author

I am facing with a problem, I want to import many 4K quality video. I only initialize 2 VideoPlayerController at the same time. But the crash happen because the memory usage exceed 2048MB. I know we can reduce resolution/bitrate but we need to pre-processing. It takes long time.

Is your package can improve it? or could you suggest me some technical to handle it?

Thank you so much hope you reply and discuss with me about this problem!!

@wang-bin
Copy link
Owner

@wang-bin Thank you for your reply.

could you help me to resolve it?

follow the steps i mentioned. or upgrade flutter to 3.10.5. github actions can build without error

@wang-bin
Copy link
Owner

I am facing with a problem, I want to import many 4K quality video. I only initialize 2 VideoPlayerController at the same time. But the crash happen because the memory usage exceed 2048MB. I know we can reduce resolution/bitrate but we need to pre-processing. It takes long time.

Is your package can improve it? or could you suggest me some technical to handle it?

Thank you so much hope you reply and discuss with me about this problem!!

macos is ok. don't know about ios

@wang-bin
Copy link
Owner

i published a new version. try again

@quochuynh67
Copy link
Author

quochuynh67 commented Jun 30, 2023 via email

@quochuynh67
Copy link
Author

quochuynh67 commented Jun 30, 2023 via email

@wang-bin
Copy link
Owner

Do you have any social networks where we can chat together? I really like
your knowledge when I read your github repositories

On Fri, Jun 30, 2023 at 5:27 PM Huỳnh Quốc @.***>
wrote:

Wow, thank you so much bro

On Fri, 30 Jun 2023 at 16:33 WangBin @.***> wrote:

i published a new version. try again


Reply to this email directly, view it on GitHub
#5 (comment), or
unsubscribe
https://github.com/notifications/unsubscribe-auth/AJE24QDCYECZFR2F6UPB4VDXN2MP3ANCNFSM6AAAAAAZYKJTSM
.
You are receiving this because you authored the thread.Message ID:
@.***>

email me, then i will send you discord account

@quochuynh67
Copy link
Author

quochuynh67 commented Jun 30, 2023 via email

@wang-bin
Copy link
Owner

your email is hidden

@quochuynh67
Copy link
Author

quochuynh67 commented Jul 3, 2023 via email

@quochuynh67
Copy link
Author

quochuynh67 commented Jul 3, 2023 via email

@wang-bin
Copy link
Owner

wang-bin commented Jul 3, 2023

play 8~10 4k videos at the same time? Maybe it's a system limitation. Can you provide stack trace?

@quochuynh67
Copy link
Author

quochuynh67 commented Jul 3, 2023 via email

@wang-bin
Copy link
Owner

wang-bin commented Jul 3, 2023

VideoPlayerController.initialize() will start to decode the first frame, so start to consume cpu, gpu and memory

@quochuynh67
Copy link
Author

quochuynh67 commented Jul 3, 2023 via email

@wang-bin
Copy link
Owner

wang-bin commented Jul 3, 2023

  • I can delay the decoding, but you can't see the first frame until start to play
  • The default texture size is video frame size(4k), I can add an option to set size by user

Can CapCut play multiple 4k videos at the same time? I guess they only create a thumbnail for each video

@quochuynh67
Copy link
Author

quochuynh67 commented Jul 3, 2023 via email

@quochuynh67
Copy link
Author

quochuynh67 commented Jul 3, 2023 via email

@wang-bin
Copy link
Owner

wang-bin commented Jul 3, 2023

even they can edit it, bro Because user can play to preview they editing (sticker, filter applied)

Message ID: @.***>

Yes, but at most 2 player instances is enough for those video editors, 1 for current video, another for preloading the next video, so they don't have the problem. There is another option for you: show the thumbnail, initialize player when user requests to play, dispose when playback is not needed.

@quochuynh67
Copy link
Author

quochuynh67 commented Jul 3, 2023 via email

@wang-bin
Copy link
Owner

wang-bin commented Jul 3, 2023

yes, my logic is that. only 2 instances at the same time, But the cost for 4K video too much, it takes memory usage

On Mon, Jul 3, 2023 at 2:48 PM WangBin @.> wrote: even they can edit it, bro Because user can play to preview they editing (sticker, filter applied) … <#m_4678387315127828119_> Message ID: @.> Yes, but at most 2 player instances is enough for those video editors, 1 for current video, another for preloading the next video, so they don't have the problem. There is another option for you: show the thumbnail, initialize player when user requests to play, dispose when playback is not needed. — Reply to this email directly, view it on GitHub <#5 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AJE24QCLGLZRPGXDEBMONTLXOJ2MTANCNFSM6AAAAAAZYKJTSM . You are receiving this because you authored the thread.Message ID: @.***>

How much? I run my example on macOS with 2 4k hdr hevc videos, less than 200MB for current process, and about 700M for system decoder service.

@quochuynh67
Copy link
Author

quochuynh67 commented Jul 3, 2023 via email

@wang-bin
Copy link
Owner

wang-bin commented Jul 3, 2023

the master branch supports a fixed texture size, result in lower memory cost but also lower display quality

MdkVideoPlayer.registerWith({'maxWidth': 1280, 'maxHeight': 720});

But you have to know system and hardware has a limit of the max number of 4k videos.

@quochuynh67
Copy link
Author

quochuynh67 commented Jul 4, 2023 via email

@quochuynh67
Copy link
Author

the master branch supports a fixed texture size, result in lower memory cost but also lower display quality

MdkVideoPlayer.registerWith({'maxWidth': 1280, 'maxHeight': 720});

But you have to know system and hardware has a limit of the max number of 4k videos.

I think we reduce texture is not the good way, because Texture rendering use GPU not CPU so it does not take many memory. Do you think about it?

@quochuynh67
Copy link
Author

It is so terrible :), I try to use 100x100 but the memory still pump very high. You can watch the video demo in the drive link below

Map<String, dynamic> test = {'maxWidth': 100, 'maxHeight': 100};
MdkVideoPlayer.registerWith(options: test);

https://drive.google.com/file/d/1lNCbYKg03qPpEzr0mU1RuSxPcaOAPaiR/view?usp=sharing

@wang-bin
Copy link
Owner

wang-bin commented Jul 4, 2023

the master branch supports a fixed texture size, result in lower memory cost but also lower display quality

MdkVideoPlayer.registerWith({'maxWidth': 1280, 'maxHeight': 720});

But you have to know system and hardware has a limit of the max number of 4k videos.

I think we reduce texture is not the good way, because Texture rendering use GPU not CPU so it does not take many memory. Do you think about it?

memory is shared on mobile

@wang-bin
Copy link
Owner

wang-bin commented Jul 4, 2023

I tested macos example, the memory increases lot in xcode, but without xcode, the memory is low, about 150MB if texture is 4k. What about using official avfoundation plugin?

@wang-bin
Copy link
Owner

wang-bin commented Jul 4, 2023

You can enable log for the plugin and show me the full log

Logger.root.level = Level.ALL;
Logger.root.onRecrd.listen((record){ print the log});

@wang-bin
Copy link
Owner

wang-bin commented Jul 4, 2023

when seeking the video, decoding speed is faster, so memory increases a lot. it's better to seek when stop dragging the slider

@quochuynh67
Copy link
Author

quochuynh67 commented Jul 4, 2023 via email

@wang-bin
Copy link
Owner

wang-bin commented Jul 4, 2023

video is compressed, we need a decoder to extract uncompressed yuv or rgb images

@quochuynh67
Copy link
Author

quochuynh67 commented Jul 4, 2023 via email

@wang-bin
Copy link
Owner

wang-bin commented Jul 4, 2023

I think we can close this issue now. Just a last thing I want learn from you that You said VideoPlayerController.initialize is decoding the first frame

The comment in official example: https://github.com/flutter/packages/blob/video_player-v2.7.0/packages/video_player/video_player/example/lib/basic.dart#L33

if initialize() finished, you can see the image, so the first frame must be decoded

how you know that could you share me the knowledge or document, and how you know when seekTo called, it is the fast decoding

seekTo will clear current frames, and start to decode from another position. if the target position is not a key frame, and you want to seekTo an accurate position, have to decode from the nearest key frame before target position and until the target position is decoded. To speed up seekTo, the decoding must be as fast as possible.

@wang-bin
Copy link
Owner

wang-bin commented Jul 4, 2023

can you compare memory load with the official implementation(without fvp)?

@wang-bin
Copy link
Owner

wang-bin commented Jul 4, 2023

I find many plugins in pub.dev. there is no plugin do that

I also searched pub.dev. There are many video player packages, but most of them are wrappers on official video player with custom ui, some are new player classes and you have to rewrite your code to use their apis. none of them provide a plugin for official player to support all other platforms.

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

2 participants