Unable to access videos stored as large media

My site name is digital-dance-hall.netlify.app

I have large media videos committed to LFS in the /static folder of my Gatsby project. They show up fine on my Netlify site admin page:

But when I go to that static URL, I can’t access the file (example URL).

I’m trying to link to them in a Gatsby site using a simple <video> tag.

What does the API endpoint listed in the above image do? I couldn’t find any docs for it.

hey there,

thanks for posting about this - unfortunately the person who knows most about NLM is out this week, which is why we have been slow to get back to you, but we won’t forget - promise!~

Hi, @adidahiya, the API endpoint is the Git LFS endpoint. It is the URL that Git is using to store Git LFS files.

I also don’t see the URL working despite showing listed above. This can happen if the binary file has not been uploaded to Large Media. To double check that this has been done, would you please run the following command in the repo directory?

git lfs push --all origin master

After running that command, would you then test a new deploy of this site? If that doesn’t resolve the issue, would you please run the same command with debugging output like so:

GIT_TRACE=true GIT_CURL_VERBOSE=true git lfs push --all origin master

Again, only if the push fails to resolve the issue, would you then send the output of that debugging version to me as a private/direct message here on the community site?

hi @adidahiya Was there ever a solution to this? I am encountering the exact same issue: a large media file (an mp4) that I am simply trying to embed in a video tag, but it is not working, despite being listed in the large media tab.

Any answers?

Hi, @pdbradley, is the mp4 not working its own URL or is the video being base64 encoded into the HTML itself?

If it is an actual URL, would you please post that URL here (or send it as a private message if you prefer)?

Now, I think is unlikely video is small enough to encode into the HTML. People do this with images often and it isn’t outside the realm of possibility it is being done with this video (if it is small enough).

If this is the case (the goal is to base64 encode the video), that won’t work because the raw video isn’t accessible in the build image. The build image cannot transform the video to text because the video itself will only be available once the build is complete and the deploy is finished. This is covered in the limitations section of the documentation, quoting:

Files tracked with Large Media are uploaded directly to the Netlify Large Media storage service on push, completely bypassing the site build. This saves build time, but also means that the files are not available to tools that process asset files during the build, such as Hugo’s image processing or the gatsby-image plugin. Depending on your needs, you may be able to replace this functionality with Netlify’s image transformation service.

To summarize, if a URL isn’t working, it should be and we are happy to troubleshoot that. If a transformation of the video isn’t working, this is a known limitation.

@luke I eventually got this to work. When I ran git lfs push --all origin master, git was asking for my password for my netlify git endpoint. So I tried upgrading netlify-cli and the lm plugin as per your comment here:

yarn global upgrade netlify-cli
netlify plugins:install netlify-lm-plugin
netlify lm:install
netlify logout
netlify login

Then it was still asking for my password. So I had to edit .git/config to add these lines:

[credential "https://<MY_SITE_ID>.netlify.com"]
  helper = netlify
[credential "https://<MY_SITE_ID>.netlify.app"]
  helper = netlify

Then after a final git lfs push --all origin master, my large files showed up and are served through the /static folder.

Hi, @adidahiya, that is interesting about changing the domain name from .com to .app in .git/config.

That is a new fix to me. Thank you for posting your solution here. I certainly appreciate it and I’m sure other people will find this helpful as well. :smiley: