GPUImage2 - How to Get Processed Video URL To Save in Device?2019 Community Moderator ElectionGetting current device language in iOS?cocos2d OpenGL error 0x0502 in -[EAGLView swapBuffers]AVFoundation video capture won't saveGPUImage crash when switching to background while processing a video fileGPUimageVideoCamera for androidHow to rotate a video 90º in MPMovieplayercontrollerGPUImageMovie pause while applying filterGPU Image Filter disables audio in iOSGPUImage 2 filters in collectionviewHow to seek with GPUImageMovie with AVMutableComposition

Practical reasons to have both a large police force and bounty hunting network?

Giving a talk in my old university, how prominently should I tell students my salary?

Can inspiration allow the Rogue to make a Sneak Attack?

How do you make a gun that shoots melee weapons and/or swords?

The past tense for the quoting particle って

Are Wave equations equivalent to Maxwell equations in free space?

Why aren't there more gauls like Obelix?

Is "cogitate" an appropriate word for this?

What does it mean when I add a new variable to my linear model and the R^2 stays the same?

Convert an array of objects to array of the objects' values

Should we avoid writing fiction about historical events without extensive research?

Was it really inappropriate to write a pull request for the company I interviewed with?

Deal the cards to the players

Are the gray wires in my switch boxes neutrals?

Quitting employee has privileged access to critical information

Named nets not connected in Eagle board design

Are small insurances worth it

Why is there an extra space when I type "ls" on the Desktop?

Should I use HTTPS on a domain that will only be used for redirection?

Are angels creatures (Mark 16:15) and can they repent (Rev 2:5 and Rom 8:21)

Can a Mexican citizen living in US under DACA drive to Canada?

“I had a flat in the centre of town, but I didn’t like living there, so …”

What can I do if someone tampers with my SSH public key?

Computing the volume of a simplex-like object with constraints



GPUImage2 - How to Get Processed Video URL To Save in Device?



2019 Community Moderator ElectionGetting current device language in iOS?cocos2d OpenGL error 0x0502 in -[EAGLView swapBuffers]AVFoundation video capture won't saveGPUImage crash when switching to background while processing a video fileGPUimageVideoCamera for androidHow to rotate a video 90º in MPMovieplayercontrollerGPUImageMovie pause while applying filterGPU Image Filter disables audio in iOSGPUImage 2 filters in collectionviewHow to seek with GPUImageMovie with AVMutableComposition










2















Anyone please help me to get the processed video URL from GPUImage2 Library after applying video filter?



do 
let bundleURL = Bundle.main.resourceURL!
let movieURL = URL(string:"sample_iPod.m4v", relativeTo:bundleURL)!
movie = try MovieInput(url:movieURL, playAtActualSpeed:true)
filter = SaturationAdjustment()
movie --> filter --> renderView
movie.start()
catch
fatalError("Could not initialize rendering pipeline: (error)")



Thanks in Advance,
James










share|improve this question






















  • The reason is to gain URL is to save it in our device. Please help

    – Jaames
    Mar 15 '18 at 11:45















2















Anyone please help me to get the processed video URL from GPUImage2 Library after applying video filter?



do 
let bundleURL = Bundle.main.resourceURL!
let movieURL = URL(string:"sample_iPod.m4v", relativeTo:bundleURL)!
movie = try MovieInput(url:movieURL, playAtActualSpeed:true)
filter = SaturationAdjustment()
movie --> filter --> renderView
movie.start()
catch
fatalError("Could not initialize rendering pipeline: (error)")



Thanks in Advance,
James










share|improve this question






















  • The reason is to gain URL is to save it in our device. Please help

    – Jaames
    Mar 15 '18 at 11:45













2












2








2








Anyone please help me to get the processed video URL from GPUImage2 Library after applying video filter?



do 
let bundleURL = Bundle.main.resourceURL!
let movieURL = URL(string:"sample_iPod.m4v", relativeTo:bundleURL)!
movie = try MovieInput(url:movieURL, playAtActualSpeed:true)
filter = SaturationAdjustment()
movie --> filter --> renderView
movie.start()
catch
fatalError("Could not initialize rendering pipeline: (error)")



Thanks in Advance,
James










share|improve this question














Anyone please help me to get the processed video URL from GPUImage2 Library after applying video filter?



do 
let bundleURL = Bundle.main.resourceURL!
let movieURL = URL(string:"sample_iPod.m4v", relativeTo:bundleURL)!
movie = try MovieInput(url:movieURL, playAtActualSpeed:true)
filter = SaturationAdjustment()
movie --> filter --> renderView
movie.start()
catch
fatalError("Could not initialize rendering pipeline: (error)")



Thanks in Advance,
James







ios swift gpuimage






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 15 '18 at 11:44









JaamesJaames

111




111












  • The reason is to gain URL is to save it in our device. Please help

    – Jaames
    Mar 15 '18 at 11:45

















  • The reason is to gain URL is to save it in our device. Please help

    – Jaames
    Mar 15 '18 at 11:45
















The reason is to gain URL is to save it in our device. Please help

– Jaames
Mar 15 '18 at 11:45





The reason is to gain URL is to save it in our device. Please help

– Jaames
Mar 15 '18 at 11:45












1 Answer
1






active

oldest

votes


















0














 func applyfilters()
do
// movie input
movieInput = try MovieInput(url: inputVideoUrl, playAtActualSpeed: true, loop: false)

// movie output
movieOutput = try MovieOutput(URL: outputVideoUrl, size: videoSize, liveVideo: false)

// pipeline
movieInput.addTarget(currentFilter)
currentFilter.addTarget(renderView)
currentFilter.addTarget(movieOutput!)

movieOutput!.startRecording()
movieInput.start()

catch
print(error.localizedDescription)



//Below function should be called after the filter is applied on full video. If you call this function before video ends it will not generate the rest part of the video.

func stopVideoRecording(completion: (() -> Void)?)
movieOutput?.finishRecording
completion?()



//To save video
func saveVideo()
PHPhotoLibrary.shared().performChanges(
PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: outputVideoUrl)
) saved, error in
if saved
let alertController = UIAlertController(title: "Your video was successfully saved", message: nil, preferredStyle: .alert)
let defaultAction = UIAlertAction(title: "OK", style: .default, handler: nil)
alertController.addAction(defaultAction)
self.present(alertController, animated: true, completion: nil)





Usage Example



 applyFilters()

DispatchQueue.main.asyncAfter(deadline:.now()+AVAsset(url:inputVideoUrl).duration.seconds, execute:
stopVideoRecording
self.saveVideo()

)





share|improve this answer






















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49298598%2fgpuimage2-how-to-get-processed-video-url-to-save-in-device%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    0














     func applyfilters()
    do
    // movie input
    movieInput = try MovieInput(url: inputVideoUrl, playAtActualSpeed: true, loop: false)

    // movie output
    movieOutput = try MovieOutput(URL: outputVideoUrl, size: videoSize, liveVideo: false)

    // pipeline
    movieInput.addTarget(currentFilter)
    currentFilter.addTarget(renderView)
    currentFilter.addTarget(movieOutput!)

    movieOutput!.startRecording()
    movieInput.start()

    catch
    print(error.localizedDescription)



    //Below function should be called after the filter is applied on full video. If you call this function before video ends it will not generate the rest part of the video.

    func stopVideoRecording(completion: (() -> Void)?)
    movieOutput?.finishRecording
    completion?()



    //To save video
    func saveVideo()
    PHPhotoLibrary.shared().performChanges(
    PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: outputVideoUrl)
    ) saved, error in
    if saved
    let alertController = UIAlertController(title: "Your video was successfully saved", message: nil, preferredStyle: .alert)
    let defaultAction = UIAlertAction(title: "OK", style: .default, handler: nil)
    alertController.addAction(defaultAction)
    self.present(alertController, animated: true, completion: nil)





    Usage Example



     applyFilters()

    DispatchQueue.main.asyncAfter(deadline:.now()+AVAsset(url:inputVideoUrl).duration.seconds, execute:
    stopVideoRecording
    self.saveVideo()

    )





    share|improve this answer



























      0














       func applyfilters()
      do
      // movie input
      movieInput = try MovieInput(url: inputVideoUrl, playAtActualSpeed: true, loop: false)

      // movie output
      movieOutput = try MovieOutput(URL: outputVideoUrl, size: videoSize, liveVideo: false)

      // pipeline
      movieInput.addTarget(currentFilter)
      currentFilter.addTarget(renderView)
      currentFilter.addTarget(movieOutput!)

      movieOutput!.startRecording()
      movieInput.start()

      catch
      print(error.localizedDescription)



      //Below function should be called after the filter is applied on full video. If you call this function before video ends it will not generate the rest part of the video.

      func stopVideoRecording(completion: (() -> Void)?)
      movieOutput?.finishRecording
      completion?()



      //To save video
      func saveVideo()
      PHPhotoLibrary.shared().performChanges(
      PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: outputVideoUrl)
      ) saved, error in
      if saved
      let alertController = UIAlertController(title: "Your video was successfully saved", message: nil, preferredStyle: .alert)
      let defaultAction = UIAlertAction(title: "OK", style: .default, handler: nil)
      alertController.addAction(defaultAction)
      self.present(alertController, animated: true, completion: nil)





      Usage Example



       applyFilters()

      DispatchQueue.main.asyncAfter(deadline:.now()+AVAsset(url:inputVideoUrl).duration.seconds, execute:
      stopVideoRecording
      self.saveVideo()

      )





      share|improve this answer

























        0












        0








        0







         func applyfilters()
        do
        // movie input
        movieInput = try MovieInput(url: inputVideoUrl, playAtActualSpeed: true, loop: false)

        // movie output
        movieOutput = try MovieOutput(URL: outputVideoUrl, size: videoSize, liveVideo: false)

        // pipeline
        movieInput.addTarget(currentFilter)
        currentFilter.addTarget(renderView)
        currentFilter.addTarget(movieOutput!)

        movieOutput!.startRecording()
        movieInput.start()

        catch
        print(error.localizedDescription)



        //Below function should be called after the filter is applied on full video. If you call this function before video ends it will not generate the rest part of the video.

        func stopVideoRecording(completion: (() -> Void)?)
        movieOutput?.finishRecording
        completion?()



        //To save video
        func saveVideo()
        PHPhotoLibrary.shared().performChanges(
        PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: outputVideoUrl)
        ) saved, error in
        if saved
        let alertController = UIAlertController(title: "Your video was successfully saved", message: nil, preferredStyle: .alert)
        let defaultAction = UIAlertAction(title: "OK", style: .default, handler: nil)
        alertController.addAction(defaultAction)
        self.present(alertController, animated: true, completion: nil)





        Usage Example



         applyFilters()

        DispatchQueue.main.asyncAfter(deadline:.now()+AVAsset(url:inputVideoUrl).duration.seconds, execute:
        stopVideoRecording
        self.saveVideo()

        )





        share|improve this answer













         func applyfilters()
        do
        // movie input
        movieInput = try MovieInput(url: inputVideoUrl, playAtActualSpeed: true, loop: false)

        // movie output
        movieOutput = try MovieOutput(URL: outputVideoUrl, size: videoSize, liveVideo: false)

        // pipeline
        movieInput.addTarget(currentFilter)
        currentFilter.addTarget(renderView)
        currentFilter.addTarget(movieOutput!)

        movieOutput!.startRecording()
        movieInput.start()

        catch
        print(error.localizedDescription)



        //Below function should be called after the filter is applied on full video. If you call this function before video ends it will not generate the rest part of the video.

        func stopVideoRecording(completion: (() -> Void)?)
        movieOutput?.finishRecording
        completion?()



        //To save video
        func saveVideo()
        PHPhotoLibrary.shared().performChanges(
        PHAssetChangeRequest.creationRequestForAssetFromVideo(atFileURL: outputVideoUrl)
        ) saved, error in
        if saved
        let alertController = UIAlertController(title: "Your video was successfully saved", message: nil, preferredStyle: .alert)
        let defaultAction = UIAlertAction(title: "OK", style: .default, handler: nil)
        alertController.addAction(defaultAction)
        self.present(alertController, animated: true, completion: nil)





        Usage Example



         applyFilters()

        DispatchQueue.main.asyncAfter(deadline:.now()+AVAsset(url:inputVideoUrl).duration.seconds, execute:
        stopVideoRecording
        self.saveVideo()

        )






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered yesterday









        Him bhattHim bhatt

        12




        12





























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f49298598%2fgpuimage2-how-to-get-processed-video-url-to-save-in-device%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            1928 у кіно

            Захаров Федір Захарович

            Ель Греко