Transclude \ Embed external files (audio, videos, pdfs) present on the computer outside the vault

I had thought of using the same structure but was concerned about performance. I posted a feature request to have a way to exclude folders from indexing other than the filenames or some variation. If we had that we’d also have portable vaults that can be mirrored to other systems and links would work.

The problem with relative links is that file:// URIs don’t support relative links.

Number of files will certainly impact load times. Cloud storage-located files shouldn’t, unless Obsidian needs to force your device to redownload cloud files all the time.

That project is around 40,874 files right now. A quarter of them are pre-processed individual CSV files. A quarter of them are intermediary files used by an old plotting program. Half of them are png images that’s needed to be turn into animated GIF using an old program. They could be automated with R, but I have not needed to do it again right now to bother about it. I should probably do something about it soon.

The important scripts and documents are probably less than 500 files. Which is nice if I can tell Obsidian to not index some of the folders.

This is off topic of this thread, but, have you tried the recent ignored-folders feature?

Implemented in 14.6:

https://forum.obsidian.md/t/obsidian-release-v0-14-6/35640

1 Like

I know it’s off topic, which is why I didn’t ask more question about it.

I did try the “Excluded Files” option. Which excludes around 90% (roughly) of the files. There is no noticeable difference in the loading time. I did time (manually) before and after, around 20 seconds for both.

Does this also include the transclusion of obsidian: URLs?

That’s what I was trying to do, embed a note from another vault, and some searching landed me here. Or shall I open a new FR for that?

1 Like

I think that’s a new request… in my interpretation, this is for transclusion of files in the same vault.

I think it’s for files anywhere on the computer.

You’re right, sorry. Still, I think @gkertai is talking about a new idea.

I’m not sure to what extent the Better File Link plugin fails to meet this request.

Can embed Obsidian compatible files from anywhere on computer.

2 Likes

Yes, you’re right.

Thanks for the tip @Dor !

I tried Better File Link for embedding. Unfortunately it copies all embedded .md files into the target vault, which defeats the purpose of transclusion.

Obsidian link embeds of the ![SomeFile](obsidian://open?vault=SomeVault&file=SomeFile) form do not work even with the plugin installed.

I suppose it depends on the purpose. For me, I mostly use transclusion of other files as a way of collecting files for viewing or export. If I want to prepare a file with many transclusions of files from all over the file system for export, I’d just start a new vault, use the plugin to add the files and delete the vault when I’ve done with it.

No. Only seems to import the file to embed and uses the wikilink format to do that.
Though I’m not sure why you would want to use an obsidian:// format rather than a simpler file lin - not that it makes any difference to embedding. The plugin doesn’t transcend Obsidian functionality, but it does give a convenient approach within Obsidian’s limits.

Though I’m not sure why you would want to use an obsidian:// format rather than a simpler file lin - not that it makes any difference to embedding.

Unlike file: links, obsidian: URLs would work even if the target vault is moved to another location (eg. onto an external volume). They would also work when the vaults are synced across multiple computers at differing file paths (eg. different volume names or user accounts). I am using the latter approach extensively.

All this assumes that the files are actually linked to, as opposed to being copied.

My experimenting with media

This works
<video src="file:///mnt/path/to/my/video.mp4" controls></video>
as workaround to
![](file:///mnt/path/to/my/video.mp4)

This works
<audio src="file:///mnt/path/to/my/audio.mp3" controls></audio>
as workaround to
![](file:///mnt/path/to/my/audio.mp3)

12 Likes

My preference for this would be to add external folders to the Obsidian search path. So I can add an image from my Photos folder just as if it were in the vault, like ![[IMG_4035.JPG]]. This way I don’t have to clog up the vault with duplicated images, etc but I also don’t have the fragility of absolute file paths.

This approach is similar to how Workspaces work in VSCode.

3 Likes

For now I’ve happened upon what I believe is a decent solution: Zoho workdrive. They’re quite a bit like google drive, but they have one killer feature: they can generate an iframe embed for your uploaded files (both individually and entire folders). I’ve been using this as my file storage for obsidian — upload, get the iframe, insert into obsidian.

This has a lot of nice benefits:

  1. Device agnostic without needing to sync the files external to Obsidian.
  2. Supports some formats unsupported by Obsidian, like HEIC and videos (they Just Work when embedded).
  3. The iframe media viewer works great. Images can be zoomed in or viewed full screen. Videos can be full screen and have playback speed changed.
  4. If you want to share the media in your vault, just share the iframe src field.

It’s a bit more work up front but so far I’m finding it to be a really great experience.

4 Likes

Use case or problem

As a user with an extensive PDF library managed on my filesystem with 3rd-party tools (e.g., Zotero, DevonTHINK, etc.) outside of my Obsidian vaults, I would like to be able to embed the PDFs in Obsidian notes from their location on the filesystem.

Proposed solution

Enable the same syntax for PDFs that allows remote embedding of images, namely:

![Remote PDF](file:///Users/timj/Desktop/File.pdf)

Current workaround (optional)

No known workaround.

Related feature requests (optional)

No known feature requests, though it is mentioned in this post.

Thanks!

24 Likes

Is this not more of a bug? As your post rightfully states, embedding an image from outside the vault works fine, while for some reason it does not work with pdfs.

PDFs don’t natively display like images. Although I can understand the reasoning behind calling this a bug, the code complexity of displaying a PDF makes this a completely new feature (from the software angle).