Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Iain Martin 51 posts 73 karma points
    Jan 04, 2021 @ 11:53
    Iain Martin
    0

    Azure FileSystemProvider File Path

    I'm developing a site whereby I'm using the Azure Blob storage for the media files and that is working fine and is uploading files to Azure and displaying them on the front end without issue.

    I have a section for videos that requires me to manipulate the physical file to extract a thumbnail and convert the .MP4 file into an HLS stream (.m3u8 and associated .tls files) and save them in the same directory as the initial file upload .

    This worked fine before I installed the UmbracoFileSystemProviders.Azure.Media package as obviously I could use HttpContext.Current.Server.MapPath(filename) to access the file on the hard drive and then open it and extract a .jpg or do the conversion. I am using a 3rd party ffmpeg convertor from NReco to do these conversions which although primarily a desktop DLL works fine for web usage.

    I'm using the IMediaFileSystem interface to retrieve the full path to the file, but obviously it is returning this as 'https://accountname.blob.core.windows.net/' etc and I therefore can't physically manipulate the file.

    Is there are a way of physically opening/mapping the file from the Azure storage bucket or do I need to retain a copy of the source file on the server hard drive to do these operations?

    Some of the files are >2Gb in size and I'd rather not maintain a copy on the local harddrive as that defeats the purpose of using Azure as my storage system.

    I am aware that Azure does do a streaming conversion service, but I'm working to a very tight budget (aka none) so I'd rather not incur any additional costs over and above the storage costs if I can help it.

    Iain Martin

  • Nik 1391 posts 6128 karma points MVP 3x c-trib
    Jan 04, 2021 @ 13:03
    Nik
    0

    Hi Iain,

    You can inject the MediaFileSystemProvider and then from that you can "open" a stream to the file on blob storage. This will be an IStream, if I recall correctly. So you should be able to use that as you need.

    Thanks

    Nik

  • Iain Martin 51 posts 73 karma points
    Jan 04, 2021 @ 13:20
    Iain Martin
    0

    Cheers Nick, I'll give that a try.

Please Sign in or register to post replies

Write your reply to:

Draft