-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Black screen in video preview, but only sometimes #1134
Comments
Ok, thanks for the report. This does not reproduce my system, maybe there are some issues with Gentoo build of MLT? |
I also experience this problem. My setup differs so it probably is not Gentoo in particular. OS: Arch (kernel 6.6.2) Is there a way we can help with logs or something of the sort? |
There are a couple of things you could try:
|
Alright, I was hoping that there might be a more detailed debugging log available. I have recorded two logs (stdout and stderr combined) for these two scenarios, maybe you can find something in there that gives you a hint what it might be. Starting from scratch (video preview works): Opening a .FLB file (video preview does not work): I tried the flatpak version, there the preview does not have any issues (although other stuff like saving seems to break or at least throw errors, did not look too deeply into it though). |
@AlexBocken , that is indeed the case with me as well. Starting a new project consistently allows me to see the video preview, but opening a project requires multiple restarts before it will show a preview. |
Ok, thanks for the input:
...and this one:
with further commet here:
I think the issue underlying all these reports might be that mlt.Comsumer("sdl") is created before all the required resources are available. I thought that the move to using Gtk.Application for the main app might have helped here, but that does not seem to be the case. This is something that worked for years, but now seems to be broken. I will try to change the order that things are initialized to get a different outcome for users having this problem. With Christmas and New Year coming it will probably be mid-January before I have something new to present with this problem. |
I am also experiencing a black preview window on Debian using their official package for flowblade 2.12-1. At first, I assumed that it was a Wayland problem since I am using Sway (with GDK_BACKEND=x11 and SDL_VIDEODRIVER=x11) but I just tried a true X11 session with Openbox and that did not solve anything. Here is a log under Sway with I am not seeing anything suspicious in the log except maybe for the missing MLT services: Since |
I forgot to mention that I never managed to get it working even when starting a project from scratch. |
I also experience the same problem. My setup is the following: OS: Debian trixie/sid (kernel 6.5.0.5-amd64) The only way for not have a black screen in video preview is to use a X11 window session. Here you can see the log file for the Gnome classic window session. And here the logfile for thr X11 windows sessions (here all works fine): |
I also have this problem on Arch Linux with Flowblade 2.12, MLT 7.22 and Hyprland, but only with the native Arch package (run as The flatpak works fine. Here's the logs for the native package: And here's the logs for the flatpak: |
I found a workaround ... kind of. Following the previous comment that the issue was related to mlt.Comsumer("sdl") , I looked in the MLT documentation and noticed that there are several other consumer plugins to choose from. https://www.mltframework.org/plugins/PluginsConsumers/ So I edited /usr/share/flowblade/Flowblade/mltplayer.py to replace "sdl" by something else. I am still using GDK_BACKEND=x11 SDL_VIDEODRIVER=x11 flowblade With "sdl2", I get a preview in a separate window but resizing does not work ; the output is displayed 1:1 and so is clipped when the window is too small. with "qglsl" (Qt OpenGL) there is a warning about an expected failure and nothing appears. with "xgl" , I get a valid preview in a separate window but, unlike with "sdl2", the content is properly resized. I haven't figure out if it it possible to embed the preview in the main window. To summarize, edit I am not really surprised that "sdl" is causing problem since it is using SDL1 and according to the Debian documentation "The toolkit is in maintenance mode, and it will not get Wayland support." All SDL1 apps should migrate to SDL2 (even on X11). Correction: The "sdl" consumer may not be SDL1 after all since it is advertised as SDL Fast YUV. |
After a few more minutes playing with the "xgl" Consumer, it appears that it is quite unstable. It crashes on a lot of actions (e.g. resize window or even during playback). "sdl2" seems a lot more robust. Now, I just have to figure out how to fix the rescaling issue. |
I have a usable workaround for the black screen issue by moving the preview to a separate window. |
@ExecutorElassus, @fersdt @AlexBocken I updated the Issue template to ask for DE and X11/Wayland situation to get more detailed info on issues such as this. If possible could you provide info on the question mark parts of the OS/X11 or Wayland/DE info in the table of below.
|
update:
|
My setup is X11/dwm, so should probably be the same as #1143 |
my setup is xorg/fvwm |
I noticed that the flatpak is using libSDL-1.2.so.0.11.4 so the real SDL1 library. My Debian system provides SDL1 as a wrapper around SDL2 in package libsdl1.2debian "SDL 1.2 binary compatibility library wrapping SDL 2.0" so I copied libSDL-1.2.so.0.11.4 from the flatpak to my home dir and then
I started flowblade multiple times without getting the black screen while it is always there when using the SDL1/SDL2 wrapper. |
I may have an even simpler bugfix. I tried some the env vars listed in https://github.com/libsdl-org/sdl12-compat/ but nothing worked when using the wrapper. Then I started browsing through the code and I found this
So setting SDL12COMPAT_NO_QUIT_VIDEO=1 appears to solve the problem.
So what is likely happening is that Flowblade/MLT is destroying & recreating the SDL window multiple times. I noticed that when playing with the sdl2 backend. see #1134 (comment) . That typically happens when the Flowblade window is resized. |
I can confirm that using |
Flowblade does indeed call consumer.stop()/consumer.start() repeatedly and I do seem to remember that the reason was exactly that window resize needed that to update video size. I looked at code in consumer_sdl.c and in there the SDL_Init() is called in consumer_start() if:
and in consumer_stop() SDL_Quit() is called if
so SDL_Init() seems to require more conditions to be called, so it seems probable without doing full analysis of state changes that SDL_Quit() might get called without SDL_Init() being called again. The research was indeed great @schauveau. I believe you got everything right and presented a working solution also, thank you. I'll post the solution on front page with a link to this Issue if the fix is not working for someone. |
can confirm that schauveu's fix solved the issue for me as well. Amazing work. Is there a way to fix that permanently without having to initiate flowblade with those settings every time? |
SDL12COMPAT_NO_QUIT_VIDEO can be set from within the flowblade executable file (a python script) with something like
That line must be inserted after the If you are under Wayland you could also add GDK_BACKEND=x11 and SDL_VIDEODRIVER=x11 to the environment Another possible location is the flowblade desktop file. On Debian, that is /usr/share/applications/io.github.jliljebl.Flowblade.desktop and you want to edit the
Of course, any change made to a file managed by the system is likely to be reverted during the next upgrade so a safer approach is probably to create a shell script for instance as /usr/local/bin/flowblade
|
I'm also getting black screen preview, but only when I activate proxy video. OS: Manjaro Unstable + CachyOS v3 (kernel 6.7.4) edit: |
Please include the following information.
When I first start flowblade, the video preview window is usually black. Restarting flowblade 2-3 times gets me a working video preview. Audio always works. I don't see any error in the console. Any guess what this might be? Any suggestions for how to get some kind of error message?
The text was updated successfully, but these errors were encountered: