Code Monkey home page Code Monkey logo

eirteam.ffmpeg's Introduction

EIRTeam.FFmpeg

Note: The version of FFmpeg shipped with EIRTeam.FFmpeg allows loading of videos using the patent-encumbered h264 codec, check with your local laws to see if software patents are recognized in your country.

GDExtension Video Decoder library for Godot Engine >4.1, using the FFmpeg library.

Documentation

The official documentation can be found here.

Supporting development

You can also support EIRTeam by donating on Patreon or purchasing Project Heartbeat.

Patreon Link

eirteam.ffmpeg's People

Contributors

eirexe avatar setadokalo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

eirteam.ffmpeg's Issues

stream_position property support is missing ?

Hi @EIREXE , thanks for your work on this GDExtension. Ultimately I could run it on my machine. :)

But I found that the VideoStreamPlayer node cannot set 'stream_position' property in gdscript. The code just overlook this setting and always play the stream from the very beginning. As stream_position is a very very important property of the stream playback, will you please add this feature in your code?

Thanks!

Is .mov supported?

When i try to play a .mov file it crashes. Is mov not supported or could it be a codec issue? I was trying to use codec ProRes4444 with alpha channel.

Audio stuttering?

I have been getting inconsistent stuttering / skipping or audio playback issues.

I'm having a hard time narrowing the cause, at first I thought it was videos loaded from a spinning drive, but its happened on SSD videos as well.

Even worse It sometimes goes away and comes back when scrubbing.

Pulling out my hair a little bit, If I cant find a cause I may have to scrap my project...

compilation errors when using own ffmpeg libraries

for testing I'm trying to use my system ffmpeg. which currently is is the arch user repository package "ffmpeg-full" this is a kitchen sink build with everything in it. it's not what I plan to ship with but it would give me flexibility to try a few things
https://aur.archlinux.org/packages/ffmpeg-full

In file included from /run/media/sirus/aux/code/arachnid/godot/EIRTeam.FFmpeg/ffmpeg_codec.cpp:31:
/run/media/sirus/aux/code/arachnid/godot/EIRTeam.FFmpeg/ffmpeg_codec.h:56:16: error: 'AVHWDeviceType' was not declared in this scope
  56 |         Vector<AVHWDeviceType> hw_device_types;
     |                ^~~~~~~~~~~~~~
/run/media/sirus/aux/code/arachnid/godot/EIRTeam.FFmpeg/ffmpeg_codec.h:56:30: error: template argument 1 is invalid
  56 |         Vector<AVHWDeviceType> hw_device_types;
     |                              ^
/run/media/sirus/aux/code/arachnid/godot/EIRTeam.FFmpeg/ffmpeg_codec.h:59:16: error: 'AVHWDeviceType' was not declared in this scope
  59 |         Vector<AVHWDeviceType> get_supported_hw_device_types();
     |                ^~~~~~~~~~~~~~
/run/media/sirus/aux/code/arachnid/godot/EIRTeam.FFmpeg/ffmpeg_codec.h:59:30: error: template argument 1 is invalid
  59 |         Vector<AVHWDeviceType> get_supported_hw_device_types();
     |                              ^
In file included from /usr/include/libavutil/hwcontext.h:23,
                from /usr/include/libavcodec/codec.h:27,
                from /run/media/sirus/aux/code/arachnid/godot/EIRTeam.FFmpeg/ffmpeg_codec.cpp:32:
/usr/include/libavutil/frame.h:340:16: error: redefinition of 'struct AVFrame'
 340 | typedef struct AVFrame {
     |                ^~~~~~~
In file included from /run/media/sirus/aux/code/arachnid/godot/EIRTeam.FFmpeg/ffmpeg_codec.h:34:
/usr/local/include/libavcodec/avcodec.h:1099:16: note: previous definition of 'struct AVFrame'
1099 | typedef struct AVFrame {
     |                ^~~~~~~
/usr/include/libavutil/frame.h:808:3: error: conflicting declaration 'typedef int AVFrame'
 808 | } AVFrame;
     |   ^~~~~~~
/usr/local/include/libavcodec/avcodec.h:1498:3: note: previous declaration as 'typedef struct AVFrame AVFrame'
1498 | } AVFrame;
     |   ^~~~~~~
In file included from /usr/include/libavcodec/codec.h:33:
/usr/include/libavcodec/codec_id.h:49:6: error: multiple definition of 'enum AVCodecID'
  49 | enum AVCodecID {
     |      ^~~~~~~~~
/usr/local/include/libavcodec/avcodec.h:97:6: note: previous definition here
  97 | enum AVCodecID {
     |      ^~~~~~~~~
/usr/include/libavcodec/codec.h:179:16: error: redefinition of 'struct AVProfile'
 179 | typedef struct AVProfile {
     |                ^~~~~~~~~
/usr/local/include/libavcodec/avcodec.h:3203:16: note: previous definition of 'struct AVProfile'
3203 | typedef struct AVProfile {
     |                ^~~~~~~~~
/usr/include/libavcodec/codec.h:182:3: error: conflicting declaration 'typedef int AVProfile'
 182 | } AVProfile;
     |   ^~~~~~~~~
/usr/local/include/libavcodec/avcodec.h:3206:3: note: previous declaration as 'typedef struct AVProfile AVProfile'
3206 | } AVProfile;
     |   ^~~~~~~~~
/usr/include/libavcodec/codec.h:187:16: error: redefinition of 'struct AVCodec'
 187 | typedef struct AVCodec {
     |                ^~~~~~~
/usr/local/include/libavcodec/avcodec.h:3215:16: note: previous definition of 'struct AVCodec'
3215 | typedef struct AVCodec {
     |                ^~~~~~~
/usr/include/libavcodec/codec.h:238:3: error: conflicting declaration 'typedef int AVCodec'
 238 | } AVCodec;
     |   ^~~~~~~
/usr/local/include/libavcodec/avcodec.h:3305:3: note: previous declaration as 'typedef struct AVCodec AVCodec'
3305 | } AVCodec;
     |   ^~~~~~~
/usr/include/libavcodec/codec.h:257:16: error: ambiguating new declaration of 'const AVCodec* avcodec_find_decoder(AVCodecID)'
 257 | const AVCodec *avcodec_find_decoder(enum AVCodecID id);
     |                ^~~~~~~~~~~~~~~~~~~~
/usr/local/include/libavcodec/avcodec.h:3856:10: note: old declaration 'AVCodec* avcodec_find_decoder(AVCodecID)'
3856 | AVCodec *avcodec_find_decoder(enum AVCodecID id);
     |          ^~~~~~~~~~~~~~~~~~~~
/usr/include/libavcodec/codec.h:265:16: error: ambiguating new declaration of 'const AVCodec* avcodec_find_decoder_by_name(const char*)'
 265 | const AVCodec *avcodec_find_decoder_by_name(const char *name);
     |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/libavcodec/avcodec.h:3864:10: note: old declaration 'AVCodec* avcodec_find_decoder_by_name(const char*)'
3864 | AVCodec *avcodec_find_decoder_by_name(const char *name);
     |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/libavcodec/codec.h:273:16: error: ambiguating new declaration of 'const AVCodec* avcodec_find_encoder(AVCodecID)'
 273 | const AVCodec *avcodec_find_encoder(enum AVCodecID id);
     |                ^~~~~~~~~~~~~~~~~~~~
/usr/local/include/libavcodec/avcodec.h:4283:10: note: old declaration 'AVCodec* avcodec_find_encoder(AVCodecID)'
4283 | AVCodec *avcodec_find_encoder(enum AVCodecID id);
     |          ^~~~~~~~~~~~~~~~~~~~
/usr/include/libavcodec/codec.h:281:16: error: ambiguating new declaration of 'const AVCodec* avcodec_find_encoder_by_name(const char*)'
 281 | const AVCodec *avcodec_find_encoder_by_name(const char *name);
     |                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/libavcodec/avcodec.h:4291:10: note: old declaration 'AVCodec* avcodec_find_encoder_by_name(const char*)'
4291 | AVCodec *avcodec_find_encoder_by_name(const char *name);
     |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/media/sirus/aux/code/arachnid/godot/EIRTeam.FFmpeg/ffmpeg_codec.cpp:34:24: error: no declaration matches 'godot::Vector<AVHWDeviceType> FFmpegCodec::get_supported_hw_device_types()'
  34 | Vector<AVHWDeviceType> FFmpegCodec::get_supported_hw_device_types() {
     |                        ^~~~~~~~~~~
/run/media/sirus/aux/code/arachnid/godot/EIRTeam.FFmpeg/ffmpeg_codec.h:59:32: note: candidate is: 'int FFmpegCodec::get_supported_hw_device_types()'
  59 |         Vector<AVHWDeviceType> get_supported_hw_device_types();
     |                                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/run/media/sirus/aux/code/arachnid/godot/EIRTeam.FFmpeg/ffmpeg_codec.h:53:7: note: 'class FFmpegCodec' defined here
  53 | class FFmpegCodec : public RefCounted {
     |       ^~~~~~~~~~~
Compiling godot-cpp/gen/src/classes/web_rtc_peer_connection_extension.cpp ...
scons: *** [/run/media/sirus/aux/code/arachnid/godot/EIRTeam.FFmpeg/ffmpeg_codec.os] Error 1
scons: building terminated because of errors.
[Time elapsed: 00:04:04.017]

am I correct in assuming that I could just rename my so files to drop the minor versions so they match the ones it autodownloads (the major version already matches), put those in the third party directory then comment out the downloading and installing of ffmpeg in the SConstruct file and then build?

Diagonal Skewed lines Issue

Just wanted to follow up on the issue from the other thread...

There are a few videos that I have that look diagonally skewed... every next line is shifter over to the right.
Here's what it looks like:
image

So in this picture, the 2 on the left are videos that are diagonally skewed... and the 2 on the right are fine.
There is an m4v and mp4 example for each:
image

Here is a link to an m4v that is doing this: https://drive.google.com/file/d/15JGGat5iTH9Gv5Vn9ph3AYgrOaAE292d/view?usp=sharing
if you want to inspect it

Instructions for turning on Tracy?

just curious about how to do this? I think I have a couple of tricks that should speed things up, but I want to be sure and not just be guessing.

Only audio plays

Hi,
I'm unable to get it work correctly in godot 4.2.1, plugins says:

Succesfully initialized video decoder:h264
MAKE SHADER
CRECREATE OUTPUT TEXTURE

But only audio plays, am i missing something?
Thanks

VideoStream not reaching the end

It appears that videos don't play to the end. I noticed the behavior on Godot 4.2.

When I add a 0.14s padding at the end, the videos play to the expected end of the original video. The timing may not be 100% accurate as I added the padding with shotcut, that doesn't allow steps more precise than from 0.01s.
If it helps, the videos are encoded with a 30ips framerate with a variable bitrate of 2Mb/s and 2 B images. The videos are created from a series of .png images.
Of course, videos encoded in Theora work fine without the padding.

Loading AV1 videos causes a crash.

I tried it with this sample.

There are no error messages. It just crashes.

I use Windows 10 and Godot 4.2.1.

With the latest FFmpeg binary build, it works.

EDIT: I guess it makes sense that a stripped down version can't play many codecs. So this isn't really about AV1 support, but more about graceful error handling and better error messages.

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.