aiaimimi0920 / mimi

GNU Lesser General Public License v3.0
6 stars 1 forks source link

Modify elly_videoplayer #1

Closed aiaimimi0920 closed 3 months ago

aiaimimi0920 commented 7 months ago

The current video playback library used is: https://github.com/Elly2018/elly_videoplayer

Currently, there are these issues:

  1. When modifying the current playback time multiple times, it will crash
  2. Sometimes it is not possible to initialize correctly
  3. From HTTP URL, the video will lag
  4. get_playback_position sometimes cannot obtain the correct time
  5. I hope to have a playback start callback and a playback end callback

In summary, some compatibility has been implemented in the script layer, but it cannot be guaranteed whether a crash will be triggered. I hope to make some modifications at the library level

aiaimimi0920 commented 7 months ago

I hope someone can help implement this change, I am not familiar with ffmpeg Thank you

aiaimimi0920 commented 7 months ago

finish a gdextension import ffmpeg not use elly_videoplayer

IvanWoehr commented 5 months ago

DO you have source for your addon? Looking for a better ffmpeg player as well, but for another purpose (live rtsp streaming)

aiaimimi0920 commented 5 months ago

@IvanWoehr I uploaded the code, which was modified based on the https://github.com/EIRTeam/EIRTeam.FFmpeg project

this is c++ code:https://github.com/aiaimimi0920/godot-ffmpeg

this is gdscript code(Build an audio or video player in Godot):https://github.com/aiaimimi0920/mimi/tree/main/gui/conversation/conversation_message_template/audio_template https://github.com/aiaimimi0920/mimi/tree/main/gui/conversation/conversation_message_template/video_template

This is a demonstration video: https://godotforums.org/d/37965-mimi-ai-pet/23

HTTP streaming has been implemented.

If you need to use this plugin in your own project, you may need to re implement the gdscript related code, as the current gdscript code is developed based on my project

IvanWoehr commented 5 months ago

Much appreciated!

On Sun, Feb 25, 2024 at 11:33 AM aiaimimi0920 @.***> wrote:

@IvanWoehr https://github.com/IvanWoehr I uploaded the code, which was modified based on the elly_videoplayer project

this is c++ code:https://github.com/aiaimimi0920/godot-ffmpeg

this is gdscript code(Package an audio or video player in Godot): https://github.com/aiaimimi0920/mimi/tree/main/gui/conversation/conversation_message_template/audio_template

https://github.com/aiaimimi0920/mimi/tree/main/gui/conversation/conversation_message_template/video_template

This is a demonstration video: https://godotforums.org/d/37965-mimi-ai-pet/23

HTTP streaming has been implemented.

If you need to use this plugin in your own project, you may need to re implement the gdscript related code, as the current gdscript code is developed based on my project

— Reply to this email directly, view it on GitHub https://github.com/aiaimimi0920/mimi/issues/1#issuecomment-1963023234, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAVL5WPY2XEYQIYF3IQXIHTYVN7WVAVCNFSM6AAAAABAPHIQM6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNRTGAZDGMRTGQ . You are receiving this because you were mentioned.Message ID: @.***>

IvanWoehr commented 5 months ago

There's a few build problems that I had to work around. The AudioFrame cannot be constructed with () but instead needs {} in ffmpeg_audio_stream. The project is also missing avdevice since its grabbing from the eir FFMPEG library in git. But downloading the lgpl version I can get the lib and dll.

I can compile the extension but I'm getting a Unable to load GDExtension interface function object_has_script_method() error when trying to add it to the project that I'll need to look into.

IvanWoehr commented 5 months ago

Found that the wrong godot had downloaded (master instead of 4.2). Now Im down to trying to play your example stream of "https://media.w3.org/2010/05/sintel/trailer.mp4" errors with:

"E 0:00:00:0814 VideoDecoder::prepare_decoding: Error opening file or stream: Protocol not found <C++ Error> Condition "!input_opened" is true. <C++ Source> C:\Dev\Godot\Source\godot-ffmpeg\video_decoder.cpp:147 @ VideoDecoder::prepare_decoding()

It seems like it doesn't like the specifier and it not actually playing a stream. hmm. I wonder if you had a different version of the ffmpeg source per the missing avdevice etc.

IvanWoehr commented 5 months ago

That was exactly it. I got a LGPL lib/dll package, relinked the plugin, copied new dlls over, and it started playing. For my usage case I'm still somewhat stuck as RTSP is not playing successfully, but at least it's another datapoint!

IvanWoehr commented 5 months ago

I was able to make modifications to the timing and codec creation flags to get RTSP streaming working. Many thanks for putting this together!!!

aiaimimi0920 commented 5 months ago

But downloading the lgpl version I can get the lib and dll.

Yes, I also manually downloaded the LGPL version. it was not merged into the build process

aiaimimi0920 commented 5 months ago

Found that the wrong godot had downloaded (master instead of 4.2).

There may be some changes between the master version and version 4.2, and I will make some code changes later.

aiaimimi0920 commented 5 months ago

I was able to make modifications to the timing and codec creation flags to get RTSP streaming working. Many thanks for putting this together!!!

I'm glad to hear that you have achieved your goals