RenderHeads / UnityPlugin-AVProMovieCapture

AVPro Movie Capture is a Unity Plugin for advanced video capture to AVI/MP4/MOV files
https://renderheads.com/products/avpro-movie-capture/
43 stars 8 forks source link

[Question] How to share video file? #395

Open makakaorg opened 1 month ago

makakaorg commented 1 month ago

AVPro Movie Capture Version

5.2.4-Mobile Edition build 1387

Which platform is your question for?

iOS

Your question

I use UnityNativeShare asset to share Photos. I can feed it with Video File.

In my App, Video Captures are saved into iOS Photos since your plugin allows it. The resulting path in handler.Path like: "avpmc-photolibrary:///AR_Masker_2024-05-24_12-57-52_1244x2688.mp4" can not be used to Share video file due to iOS limitations as I understand: "Share Error: file does not exist at path or permission denied: avpmc-photolibrary:///AR Masker/AR_Masker_2024-05-24_14-06-18_1244x2688.mp4"

Is there a way to get the captured video file from memory, cache, whatever to share it later and at the same time staying with the option of Saving into Photos by AVProMovieCapture?

makakaorg commented 1 month ago

I also tested with "Full Access" granted permission to Photos and had no success.

Chris-RH commented 1 month ago

Did you follow the instructions in the documentation?

makakaorg commented 1 month ago

Did you follow the instructions in the documentation?

Yes, of course.

artoonie commented 1 month ago

Are you using PhotoLibraryAccessLevel set to ReadWrite instead of AddOnly? https://renderheads.com/content/docs/AVProMovieCapture/api/RenderHeads.Media.AVProMovieCapture.CaptureBase.PhotoLibraryAccessLevel.html?q=PhotoLibraryAccessLevel

makakaorg commented 1 month ago

Are you using PhotoLibraryAccessLevel set to ReadWrite instead of AddOnly? https://renderheads.com/content/docs/AVProMovieCapture/api/RenderHeads.Media.AVProMovieCapture.CaptureBase.PhotoLibraryAccessLevel.html?q=PhotoLibraryAccessLevel

I tested all variants without success

Chris-RH commented 4 weeks ago

Which Unity version are you using? Which version of iOS are you using? Can you reproduce it in a new project, running only one of the AVPro Movie Capture demo scenes?

makakaorg commented 4 weeks ago

Which Unity version are you using? Which version of iOS are you using? Can you reproduce it in a new project, running only one of the AVPro Movie Capture demo scenes?

Unity 2022.3.30, iOS 17.5.1, Yes

MorrisRH commented 3 weeks ago

avpmc-photolibrary:// is an internal scheme so we know to copy the captured video into the photo library and as such does not actually reference anything on the device.

We'll look into adding functionality to get the final url of the captured video in the photo library.

MorrisRH commented 3 weeks ago

This has been added and will make it into the next release.

You can get the final file URL by adding a completed file writing action as shown here:

    capture.CompletedFileWritingAction += delegate(FileWritingHandler fwh) {
        string finalFilePath = fwh.FinalPath;
        if (!string.IsNullOrEmpty(finalFilePath) {
            // do something...
        }
    };
Chris-RH commented 5 hours ago

AVPro Movie Capture version 5.2.5 has been released. Please let us know if it has not fixed your issue.