Play videos for windows devices

Is there a way to do this in Defold?
Any extension and stuff. I’ve looked around and the videoplayer extension only works on mobile.
I’ve been liking how small and light defold is compared to renpy or unity. The performance is amazing and I like having an IDE.
Playing a video is kind of needed for my small management and VN game.

I found this: defold/extension-videoplayer: Videoplayer for the Defold engine (github.com)
you can try

Ah yes, no Windows supported. Sr

The above mentioned extension supports Windows. Inf act, it supports all platforms:

1 Like

I just looked at the readme and seen “The currently unsupported platforms are: Windows”. Glad that it supports all platforms :slight_smile:

Oh so the warning is outdated?

Known issues

The currently unsupported platforms are: Windows

Let me try it then.

Evidence in the source code indicate that Windows is working, but please give it a try and let us know!

It did work!
A bit of a hassle to implement but it does work. I will most likely use it for cut scenes and intros only anyway so it works for me.

1 Like

Thanks. I’ve updated the readme to reflect this.

oh that’s cool, ı have a question, do ı need to build libs for each platform?

No that should not be necessary. The build server should take care of it for you. Give it a try!

Thanks, I tried and got an extensive warning and error log. It is as follows:

/videoplayer/ext.manifest
	clang: warning: treating 'c' input as 'c++' when in C++ mode, this behavior is deprecated [-Wdeprecated]
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[2](context.c.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[3](init.c.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[4](input.c.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[5](monitor.c.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[6](platform.c.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[7](vulkan.c.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[8](window.c.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[9](egl_context.c.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[10](osmesa_context.c.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[11](null_init.c.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[12](null_monitor.c.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[13](null_window.c.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[14](null_joystick.c.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[15](cocoa_time.c.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[16](posix_module.c.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[17](posix_thread.c.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[18](cocoa_init.m.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[19](cocoa_joystick.m.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[20](cocoa_monitor.m.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[21](cocoa_window.m.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	ld: warning: object file (/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/lib/arm64-macos/libglfw3.a[22](nsgl_context.m.o)) was built for newer 'macOS' version (14.0) than being linked (11.0)
	Undefined symbols for architecture arm64:
  "mkvparser::EBMLHeader::Parse(mkvparser::IMkvReader*, long long&)", referenced from:
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::EBMLHeader::EBMLHeader()", referenced from:
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::EBMLHeader::~EBMLHeader()", referenced from:
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::IMkvReader::~IMkvReader()", referenced from:
      mkvparser::MkvBufferReader::~MkvBufferReader() in libVideoPlayer_3.a[4](webmdec.cc_2.o)
      mkvparser::MkvBufferReader::~MkvBufferReader() in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Segment::CreateInstance(mkvparser::IMkvReader*, long long, mkvparser::Segment*&)", referenced from:
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Segment::Load()", referenced from:
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Segment::GetNext(mkvparser::Cluster const*)", referenced from:
      _webm_read_frame in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Segment::~Segment()", referenced from:
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
      (anonymous namespace)::rewind_and_reset(WebmInputContext*, VpxInputContext*) in libVideoPlayer_3.a[4](webmdec.cc_2.o)
      _webm_free in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::VideoTrack::GetWidth() const", referenced from:
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::VideoTrack::GetHeight() const", referenced from:
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Block::GetFrameCount() const", referenced from:
      _webm_read_frame in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Block::GetTrackNumber() const", referenced from:
      _webm_read_frame in libVideoPlayer_3.a[4](webmdec.cc_2.o)
      _webm_read_frame in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Block::Frame::Read(mkvparser::IMkvReader*, unsigned char*) const", referenced from:
      _webm_read_frame in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Block::IsKey() const", referenced from:
      _webm_read_frame in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Block::GetTime(mkvparser::Cluster const*) const", referenced from:
      _webm_read_frame in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Block::GetFrame(int) const", referenced from:
      _webm_read_frame in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Track::GetCodecId() const", referenced from:
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Track::GetType() const", referenced from:
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Track::GetNumber() const", referenced from:
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Tracks::GetTracksCount() const", referenced from:
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Tracks::GetTrackByIndex(unsigned long) const", referenced from:
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Cluster::EOS() const", referenced from:
      _webm_read_frame in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Cluster::GetNext(mkvparser::BlockEntry const*, mkvparser::BlockEntry const*&) const", referenced from:
      _webm_read_frame in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Cluster::GetFirst(mkvparser::BlockEntry const*&) const", referenced from:
      _webm_read_frame in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Segment::GetFirst() const", referenced from:
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
      _webm_guess_framerate in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "mkvparser::Segment::GetTracks() const", referenced from:
      _file_is_webm in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "typeinfo for mkvparser::IMkvReader", referenced from:
      typeinfo for mkvparser::MkvBufferReader in libVideoPlayer_3.a[4](webmdec.cc_2.o)
  "_vpx_codec_vp8_dx", referenced from:
      vpx_decoders in libVideoPlayer_3.a[2](tools_common.c_0.o)
  "_vpx_codec_vp9_dx", referenced from:
      vpx_decoders in libVideoPlayer_3.a[2](tools_common.c_0.o)
	ld: symbol(s) not found for architecture arm64
	clang: error: linker command failed with exit code 1 (use -v to see invocation)
	com.defold.extender.ExtenderException: java.io.IOException: clang++ -c -isystem /usr/local/extender-production/platformsdk/MacOSX14.5.sdk/usr/include/c++/v1  -DDLIB_LOG_DOMAIN="VIDEOPLAYER" -DDDF_EXPOSE_DESCRIPTORS -DDM_PLATFORM_MACOS -DDM_PLATFORM_OSX -DGL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED  -O2 -g -stdlib=libc++ -mmacosx-version-min=10.13 -isysroot /usr/local/extender-production/platformsdk/MacOSX14.5.sdk -nostdinc++ -fno-exceptions -fvisibility=hidden -Werror=format -arch arm64 -target arm64-apple-darwin19 -m64  -Iupload/videoplayer/include/ -Ibuild/videoplayer/ -Iupload/   -I/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//include -I/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//sdk/include -I/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/include  upload/videoplayer/src/webm/tools_common.c -obuild/tools_common.c_0.o
clang++ -c -isystem /usr/local/extender-production/platformsdk/MacOSX14.5.sdk/usr/include/c++/v1  -DDLIB_LOG_DOMAIN="VIDEOPLAYER" -DDDF_EXPOSE_DESCRIPTORS -DDM_PLATFORM_MACOS -DDM_PLATFORM_OSX -DGL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED  -O2 -g -stdlib=libc++ -mmacosx-version-min=10.13 -isysroot /usr/local/extender-production/platformsdk/MacOSX14.5.sdk -nostdinc++ -fno-exceptions -fvisibility=hidden -Werror=format -arch arm64 -target arm64-apple-darwin19 -m64  -Iupload/videoplayer/include/ -Ibuild/videoplayer/ -Iupload/   -I/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//include -I/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//sdk/include -I/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/include  upload/videoplayer/src/videoplayer.cpp -obuild/videoplayer.cpp_1.o
clang++ -c -isystem /usr/local/extender-production/platformsdk/MacOSX14.5.sdk/usr/include/c++/v1  -DDLIB_LOG_DOMAIN="VIDEOPLAYER" -DDDF_EXPOSE_DESCRIPTORS -DDM_PLATFORM_MACOS -DDM_PLATFORM_OSX -DGL_DO_NOT_WARN_IF_MULTI_GL_VERSION_HEADERS_INCLUDED  -O2 -g -stdlib=libc++ -mmacosx-version-min=10.13 -isysroot /usr/local/extender-production/platformsdk/MacOSX14.5.sdk -nostdinc++ -fno-exceptions -fvisibility=hidden -Werror=format -arch arm64 -target arm64-apple-darwin19 -m64  -Iupload/videoplayer/include/ -Ibuild/videoplayer/ -Iupload/   -I/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//include -I/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//sdk/include -I/usr/local/extender-production/sdk/d6882f432beca85d460ec42497888157c356d058/defoldsdk//ext/include  upload/videoplayer/src/webm/webmdec.cc -obuild/webmdec.cc_2.o

May I also put this as an issue?

Pre-build arm64 (MacOS) lib is missing. You need to build it first: https://github.com/defold/extension-videoplayer/blob/master/videoplayer/utils/README.md

1 Like

Yes, please report it as an issue!

I decided to create a new extension for MPEG1 video decoding:

MPEG1 is an old format with expired patents and simple but inefficient encoding. This means that the files are a bit larger than modern formats, but the code required to decode video is simple and small. The extension above uses pl_mpeg, a single header C library. It does also support MP2 audio decoding but this is not integrated with Defold. Please give it a try and see if it works well enough for your usecase.

2 Likes