befovy / fijkplayer

ijkplayer for flutter. ijkplayer 的 flutter 封装。 Flutter video/audio player. Flutter media player plugin for android/iOS based on ijkplayer. fijkplayer 是基于 ijkplayer 封装的 flutter 媒体播放器,开箱即用,无需编译 ijkplayer
https://fijkplayer.befovy.com
MIT License
1.65k stars 354 forks source link

How to get the Video file after it is fully downloaded? #331

Open aytunch opened 4 years ago

aytunch commented 4 years ago

I want to be able to cache Video files so that user does not download them over and over again. When FijkPlayer downloads a Network DataUrl fully, is there a Stream/Callback which allows us to convert the data stream in to a video File?

Thanks.

befovy commented 4 years ago

Maybe someone will give an answer here. https://github.com/bilibili/ijkplayer/issues/5125

aytunch commented 4 years ago

@befovy I hope someone can give an answer from IJK side. Do you have any idea on how to tackle this issue? Do we get a video file from the PlatformChannels? Or do we only get some Images/textures?

befovy commented 4 years ago

fijkplayer only get textures from Native IJKPlayer

aytunch commented 4 years ago

fijkplayer only get textures from Native IJKPlayer

@befovy Can you show me the exact place we get those textures? Is it a texture Stream? Because I will ask if we can use them to construct a video file to the author of FFMPEG package. I need the exact place. Thank you bro.

befovy commented 4 years ago

fijkplayer only get textures from Native IJKPlayer

@befovy Can you show me the exact place we get those textures? Is it a texture Stream? Because I will ask if we can use them to construct a video file to the author of FFMPEG package. I need the exact place. Thank you bro.

It's here https://github.com/befovy/fijkplayer/blob/master/ios/Classes/FijkPlayer.m#L244

aytunch commented 4 years ago

@befovy Thank you, I will open up issues in ffmpeg soon with this info. Meanwhile, can you tell me if these FijkOptions can help with this issue?

format-opts : auto_save_map = 1 format-opts : cache_file_path = /var/mobile/..... format-opts : cache_map_path = /var/mobile/..... format-opts : parse_cache_map = 1

aytunch commented 4 years ago

I came across with your comments about the above Options. You are everywhere :) https://github.com/bilibili/ijkplayer/issues/4759#issuecomment-506942535 So can you please tell me if these caches are the caches of the streamed video files? Or is it something else?

aytunch commented 4 years ago

Hi @befovy, me again :) I asked for help down at IjkPlayer repo and they said this is possible by just using IjkOptions

cache_file_path
cache_map_path
parse_cache_map
auto_save_map
player.setDataSource("ijkio:cache:ffio:network_video_url");

Here is the answer from the popular issue's author I have not tried this yet, but if it works at ijk, would it work the same with fijk?

befovy commented 4 years ago

Hi @befovy, me again :) I asked for help down at IjkPlayer repo and they said this is possible by just using IjkOptions

cache_file_path
cache_map_path
parse_cache_map
auto_save_map
player.setDataSource("ijkio:cache:ffio:network_video_url");

Here is the answer from the popular issue's author I have not tried this yet, but if it works at ijk, would it work the same with fijk?

If it works at ijk, it must work the same with fijkplayer

b3nni97 commented 3 years ago

Is there a solution to this? Can someone explain how to cache the video so that it does not always have to be reloaded?