projectM and other visualizers with libVLC

This forum is about all development around libVLC.
Jona
New Cone
New Cone
Posts: 7
Joined: 11 Jun 2024 01:04

projectM and other visualizers with libVLC

Postby Jona » 11 Jun 2024 01:29

Hi.
I reactived an (8 year) old addon for Open Frameworks: https://forum.openframeworks.cc/t/ofxvl ... e/43553/12
For compiling with Visual Studio I use the libVLC nuget package (3.0.20).
Goom and some of the basic visualizers do work, but not glspectrum, projectm and vsxu (they all work with the VLC Player).

libVLC seems to be compiled with this flags:

Code: Select all

main libvlc debug: configured with /builds/videolan/vlc/extras/package/win32/../../../configure '--enable-update-check' '--enable-lua' '--enable-faad' '--enable-flac' '--enable-theora' '--enable-avcodec' '--enable-merge-ffmpeg' '--enable-dca' '--enable-mpc' '--enable-libass' '--enable-schroedinger' '--enable-realrtsp' '--enable-live555' '--enable-shout' '--enable-goom' '--enable-sse' '--enable-mmx' '--enable-libcddb' '--enable-zvbi' '--disable-telx' '--enable-nls' '--host=x86_64-w64-mingw32' '--with-contrib=../contrib/x86_64-w64-mingw32' '--enable-debug' '--enable-qt' '--enable-skins2' '--enable-dvdread' '--enable-caca'
And I would like to add:

Code: Select all

--enable-glspectrum --enable-projectm --enable-vsxu
I already tried to compile it by myself, but without luck.
I am especially interested in the projectM visualization. Strangely projectM does work with VLC 3.0.20 and Windows.
Last edited by Jona on 11 Jun 2024 15:43, edited 3 times in total.

mfkl
Developer
Developer
Posts: 739
Joined: 13 Jun 2017 10:41

Re: projectM and other visualizers with libVLC

Postby mfkl » 11 Jun 2024 10:57

libvlc binaries from nuget and official vlc releases are the same so this should work without needing a rebuild.
https://mfkl.github.io

Jona
New Cone
New Cone
Posts: 7
Joined: 11 Jun 2024 01:04

Re: projectM and other visualizers with libVLC

Postby Jona » 11 Jun 2024 11:50

@mfkl thanks. Good to know. So I will try again without recompiling. The issue seems be somewhere in my code then.
In this file libVLC is initialized: https://github.com/Jonathhhan/ofxVLCVid ... CMovie.cpp

Code: Select all

void VLCMovie::initializeVLC() { std::unique_lock<std::mutex> lock{ playerLock }; cout << "init libvlc" << endl; char const* vlc_argv[] = { "--audio-visual=projectm" }; int vlc_argc = sizeof(vlc_argv) / sizeof(*vlc_argv); libvlc = libvlc_new(vlc_argc, vlc_argv); cout << "libvlc: " << libvlc << endl; if (!libvlc) { const char* error = libvlc_errmsg(); cout << error << endl; return; } loadMedia(); mp = libvlc_media_player_new_from_media(m); libvlc_media_parse(m); unsigned int x, y; if (libvlc_video_get_size(mp, 0, &x, &y) != -1) { videoWidth = x; videoHeight = y; } else { videoWidth = 1280; videoHeight = 720; } video_length_ms = libvlc_media_get_duration(m); cout << "Video size: (" << videoWidth << ", " << videoHeight << ")" << endl; cout << "Video length: " << video_length_ms << "(ms)" << endl; libvlc_audio_output_set(mp, "aout_directx"); libvlc_video_set_callbacks(mp, lockStatic, unlockStatic, displayStatic, this); libvlc_video_set_format(mp, "RGBA", videoWidth, videoHeight, videoWidth * 4); eventManager = libvlc_media_player_event_manager(mp); libvlc_event_attach(eventManager, libvlc_MediaPlayerEndReached, vlcEventStatic, this); isVLCInitialized = true; }
And here the debug info regarding the projectm visualizer:

Code: Select all

[000001f340458e00] main visualization debug: looking for visualization module matching "projectm": 4 candidates [000001f34082c790] main window debug: looking for vout window module matching "none": 3 candidates [000001f34082c790] main window debug: no vout window modules matched [000001f340458e00] main visualization debug: no visualization modules matched [000001f340818610] main audio output error: cannot add user visualization "projectm" (skipped)
Are there maybe some other flags that projectM depends on?

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: projectM and other visualizers with libVLC

Postby Rémi Denis-Courmont » 11 Jun 2024 17:50

Do not override the video output if you want to use projectM. You can provide a window handle if you want to embed.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Jona
New Cone
New Cone
Posts: 7
Joined: 11 Jun 2024 01:04

Re: projectM and other visualizers with libVLC

Postby Jona » 11 Jun 2024 17:56

Thanks. "--audio-visual=goom" works well together with "--no-video" if I play a video (if you mean that with no override), otherwise there is some flickering between the video and goom. But with "--audio-visual=projectm" together with "--no-video" I get the error message I posted above and a white screen.

Rémi Denis-Courmont
Developer
Developer
Posts: 15265
Joined: 07 Jun 2004 16:01
VLC version: master
Operating System: Linux
Contact:

Re: projectM and other visualizers with libVLC

Postby Rémi Denis-Courmont » 11 Jun 2024 19:19

You are overriding the video output by setting custom callbacks and video format. That breaks projectM, GLspectrum, and generally anything that uses OpenGL.
Rémi Denis-Courmont
https://www.remlab.net/
Private messages soliciting support will be systematically discarded

Jona
New Cone
New Cone
Posts: 7
Joined: 11 Jun 2024 01:04

Re: projectM and other visualizers with libVLC

Postby Jona » 11 Jun 2024 19:24

Thanks a lot. But still not working. But with "--vout=glwin32" and "--vout=opengl" goom seems to look better(?). Also tried to set a custom config path: "--config=vlcrc"

Jona
New Cone
New Cone
Posts: 7
Joined: 11 Jun 2024 01:04

Re: projectM and other visualizers with libVLC

Postby Jona » 12 Jun 2024 12:38

Maybe my issue is, that the vlcrc file has no effect? Also tried with a custom path "--config=vlcrc".

Jona
New Cone
New Cone
Posts: 7
Joined: 11 Jun 2024 01:04

Re: projectM and other visualizers with libVLC

Postby Jona » 13 Jun 2024 23:35

I can actually run projectm in the additional vlc instance that opens with "--extraintf=qt". Somewhere I read, that projectm only works with a vlc GUI, not sure and still searching...
Here the addon for Open Frameworks I am working on: https://github.com/Jonathhhan/ofxVlcPlayer


Return to “Development around libVLC”

Who is online

Users browsing this forum: No registered users and 10 guests