Question / Help Is it possible to load media files with a path relative to a fixed directory?

Ferran Pérez

New Member
Hello,

I would like to be able to load a media file (e.g.: an image or video) by using a path relative to a certain folder instead of using an absolute path. For example, I would want to create a folder in say the obs studio profiles (or any folder that is normally installed at the same path for any user that has installed obs-studio in Windows) and add media to that folder (either directly or creating a new subfolder called, for example, 'Media'). I want to achieve this so I can reuse/share a set of created profiles and scene collections to other users by simply creating a zip file (including all media files used by the scenes) and telling them where to extract it so all media is correctly load it without needing to redefine the absolute paths.

Currently in OBS (last version 20.0.1), you can only browse your files and not manually introduce the path. However, I've tried browsing and typing a relative path to the current folder (e.g.: .\Images\example.png) to no avail. I've also tried with path inside the profiles and scenes folder in %appdata%\obs-studio but without success either (although the absolute path is correctly resolved, as expected). See figures for more details.

File location on browser:

View attachment upload_2017-9-14_11-20-37.png

On OBS:
View attachment upload_2017-9-14_11-21-22.png

I understand that this not working may be because of appdata being a hidden folder and its access being permitted only with obs-studio authorization (e.g.: to read profiles or scenes from the default folder). I've also tried defining the same folder with all the media inside some other path relative to some environment variable (e.g.: %APPDATA%, %PROGRAMDATA%,....) (http://www.askvg.com/list-of-environment-variables-in-windows-xp-vista-and-7/) to no avail.

Do any of you know if there is any workaround to achieve my goal with the current version of OBS studio? I though about defining a new environment variable of some kind but that would complicate the configuration for other people that may want to easily reuse profiles, scene collections and the media content in them as they would also need to create a new environment variable corresponding to the desired path.

If this option is still not available, I could always use a fixed pre-defined path and save all files and created profiles and scene collections there. I would propose this change to OBS-studio developers if many people want it.

Thank you very much in advance!


Ferran.
 

templewulf

New Member
I'm interested in this as well. If we can use relative paths, it will also make Portable Mode OBS that much more valuable. That will make it easy to drop Portable OBS and sources into a DropBox or Google Drive folder and share it with all your collaborators.

As is, I can do that and just have people correct it to their Google Drive folders on their respective machines, but that's not very plug and play, you know?
 

Suslik V

Active Member
The 'Media Source' able to use relative path like (from current folder):
Code:
.\..\..\..\..\Temp\19_1_noborder_lowhigh2.png
just uncheck the Local File checkbox to type it in Input field. In the example above, the path begins from the .exe file that is running.
For PNG images better to uncheck Hide source when playback ends too.
 

templewulf

New Member
The 'Media Source' able to use relative path like (from current folder):
Code:
.\..\..\..\..\Temp\19_1_noborder_lowhigh2.png
just uncheck the Local File checkbox to type it in Input field. In the example above, the path begins from the .exe file that is running.
For PNG images better to uncheck Hide source when playback ends too.
It's unfortunate that I can't just reuse the image sources, but I did make it work with the media sources. Thanks for the information!
 

templewulf

New Member
Also, it appears that the Media Source type makes a dramatic difference to performance. Using my laptop, I can get a solid 60fps from my Elgato 60HD S, but after converting to Media Sources, it gave me ~33fps.

While this might work for video sources or other file types you won't use many of, it eats up way more resources than necessary for images.

Edit: I did find that somehow my settings for running OBS on my GPU instead of Integrated CPU GPU got reverted. Now that I've fixed it I'm getting 60 fps again, but I suspect it'll still be a problem on lower-end systems.
 
Last edited:

RustedBucket

New Member
It's unfortunate that I can't just reuse the image sources, but I did make it work with the media sources. Thanks for the information!

You can do this for images sources as well, however you need to exit out of OBS and manually change the JSON file for the scene collection
 
Top