Skip to content
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

Symlink support #44

Closed
RKelln opened this issue May 20, 2021 · 10 comments
Closed

Symlink support #44

RKelln opened this issue May 20, 2021 · 10 comments

Comments

@RKelln
Copy link

RKelln commented May 20, 2021

This project looks perfect for my current project, thanks for making this.
I couldn't get the flatpack to work on Ubuntu 18.04 but I installed using the linux installer script, everything worked great and I was able to start Mosiac, but ran into an issue that I'm hoping is easy to fix.

Tried to import some videos and files and discovered that the file dialog doesn't see symlinks (and all my documents are symlinked to my home directory). I tried dragging and dropping and that also only worked for files not in symlinked directories. Is there an easy way to add support for symlinks?

Thanks!

@d3cod3
Copy link
Owner

d3cod3 commented May 21, 2021

Hi, thanks for your interest in this project!
About the symlink issue, i can't get to it right now, but i can point you where to check if it's an easy fix, the files regarding the file browser are here:
https://github.com/d3cod3/ofxVisualProgramming/tree/master/src/core/FileBrowser

Specifically you'll need to look at this file:
https://github.com/d3cod3/ofxVisualProgramming/blob/master/src/core/FileBrowser/ImGuiFileBrowser.cpp

at this method here: https://github.com/d3cod3/ofxVisualProgramming/blob/7328c8605d1474cd5831e811537a1f138315d91f/src/core/FileBrowser/ImGuiFileBrowser.cpp#L789

the onNavigationButtonClick , where the filepath is stored on click, so basically what need to be implemented is:

1 - detect if we clicked on a file or on a symlink
2 - if we clicked on a file, just do what is it doing now
3 - if we clicked on a symlink, store the filepath pointing to, not the path of the symlink

I think the lines where to apply this fix are here:

https://github.com/d3cod3/ofxVisualProgramming/blob/7328c8605d1474cd5831e811537a1f138315d91f/src/core/FileBrowser/ImGuiFileBrowser.cpp#L814

and here

https://github.com/d3cod3/ofxVisualProgramming/blob/7328c8605d1474cd5831e811537a1f138315d91f/src/core/FileBrowser/ImGuiFileBrowser.cpp#L817

Let me know if you find a solution, in the meantime i will check it too, as soon as possible.

@Daandelange
Copy link
Collaborator

Hey, thanks for testing Mosaic, I hope you find your way in Mosaic. :)

I think there's 2 aspects to this issue:

  • The one pointed out by @d3cod3 . In my case the symlinked directory symlinkTestDir doesn't display in the imguifilebrowser.
  • Then the drag'n'drop feature.
    I created a symlink using ln -s ~/my/superb/and/real/path/to/my/Folder ~/symlinkTestDir.
    Drag'n'dropping an image file from file browser's symlinked folder to Mosaic works on my config. [Mint 20 (similar to Ubuntu 20?)].

@RKelln
Copy link
Author

RKelln commented May 21, 2021

Thanks for the quick replies. I should have time to take a look this weekend and I can test out functionality by just making non-symlinked copies of assets in the meantime.
I'm on Ubuntu 18.04, let me test drag n drop again. You were dropping to the assets manager?
...
OK, weird, tried a different mp4 file and it did appear (yay!) and I hit play (on the video in the asset manager) then got:

*** buffer overflow detected ***: ./Mosaic terminated
Aborted (core dumped)

So I tried another and it worked! Worse bug report ever. Let me see if I can put together some test cases and submit some actionable reports this weekend.

@d3cod3
Copy link
Owner

d3cod3 commented May 21, 2021

You can just drop it anywhere on the patch canvas.

About the errors, not every video codec is supported by Mosaic, for more info you'll need to check openFrameworks, about video codec compatibility and stuff, as the Mosaic video player use the internal OF video player mechanism.

@Daandelange
Copy link
Collaborator

It could be nice to reference crashing video formats. At least Mosaic should not crash when loading a wrong codec.

@d3cod3
Copy link
Owner

d3cod3 commented May 23, 2021

I've checked that possibility ( not crashing with wrong codec ), but it will need to modify the OF ofVideoPlayer core code, so alter the OF source.
Specifically, OF is using gstreamer on linux ( libgstreamer1.0-dev ), avfoundation on osx and directshow on windows
For what i've tested, video exports on on system usually don't work on another, even using the same codecs, defintely the issue needs some more looking into it.

@d3cod3
Copy link
Owner

d3cod3 commented Jun 7, 2021

Ok, halway to a new standard for Mosaic video players, i've just added ofxHapPlayer to ofxVisualProgramming and Mosaic, and modified the video player object in order to work with that. The Hap codec is cross-compatible osx/linux/windows and we are finally free of the frequent issues ofVideoPlayer/OF related.

I've just tested it on osx and it work perfect! Now it's linux turn, i'm on it.

More info about Hap codec:

https://hap.video/using-hap.html

https://github.com/Vidvox/hap-in-avfoundation/releases

So, starting from Mosaic 0.5.0, if everything works in linux and windows too, this will be the standard encoding to work with, for video files. No more codecs incompatibilities, no more strange issues, same video file, will work on every Mosaic compatible OS.

More news soon

@Daandelange
Copy link
Collaborator

Awesome, good job !
HAP can be lossless or compressed, plus multi-platform support makes it perfect :)

@d3cod3
Copy link
Owner

d3cod3 commented Jun 8, 2021

Linux ( just tested ubuntu/debian for now ) compiling and working perfectly with HAP player!!!

so great news, now it's time for windows, finger crossed.

@d3cod3
Copy link
Owner

d3cod3 commented Jul 1, 2021

Bad news for now on windows, i have not been able to compile ofxHapPlayer addon on qtcreator/msys2 on windows 10,
so i'm working on getting a Mosaic solution for visual studio, definitely i think it will be for the best, considering a lot of current issues on windows, it will probably solve some of them.

So i'm closing this for now, as generally speaking the video player / codecs issue is not just solved but considerably enhanced now with the hap addon ( just need to solve it on the windows side... )

@d3cod3 d3cod3 closed this as completed Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants