Giter Club home page Giter Club logo

Comments (14)

Silence-GitHub avatar Silence-GitHub commented on August 18, 2024 2

@schumy MultipleVideoBlendVC consumes too much memory. I have not found a solution for the problem, so can not release it. Sorry.

from bbmetalimage.

Silence-GitHub avatar Silence-GitHub commented on August 18, 2024 1

I write a sample demo at branch multiple_video. MultipleVideoBlendVC is the demo view controller, blending two videos. MultipleVideoSource is used to transmit video frame textures at the same speed. Hope it will help you.

from bbmetalimage.

blurtime avatar blurtime commented on August 18, 2024 1

@damikdk Ok, I was looking for real-time applications. Blending existing files shouldn't be a problem - even as a filter, since @Silence-GitHub has already provided some awesome code for this. But this filter currently still requires an existing file. I suggested in #69 that he could one by one add filters whenever he has time. I already greatly appreciate his code and that he's decided to make BBMetalImage open source.
Don't want to create problems for you. Thank you, though, for the tips!

from bbmetalimage.

damikdk avatar damikdk commented on August 18, 2024

Well, I got something after a couple of hours. Here is my changes from your cool demo project (VideoFilterVC):

let url = Bundle.main.url(forResource: "test_video", withExtension: "mov")!

// First VideoSource
videoSource = BBMetalVideoSource(url: url)

// Second VideoSource (the same video file)
videoSource2 = BBMetalVideoSource(url: url)

videoSource.playWithVideoRate = true
videoSource2.playWithVideoRate = true

// RotateFilter will be apply on videoSource2 just for making the difference between videos
filterRotate = BBMetalRotateFilter(angle: 45, fitSize: true)
filterBlend = BBMetalSourceOverBlendFilter()

videoSource
    .add(consumer: filterBlend)
    .add(consumer: metalView)

videoSource2
    .add(consumer: filterRotate)
    .add(consumer: filterBlend)

filterBlend.add(consumer: videoWriter)

It renders almost perfectly, but after 2-4 seconds of recording I got the wall of logs Asset writer or video input is not ready for writing this frame. It's AVAssetWriter with status == failed. I got the same problem with GPUImage2.

print("Asset writer or video input is not ready for writing this frame")

from bbmetalimage.

damikdk avatar damikdk commented on August 18, 2024

And I got memory leak with crash when I tried to disable playWithVideoRate

from bbmetalimage.

Silence-GitHub avatar Silence-GitHub commented on August 18, 2024

Thanks for issuing me.

To blend two videos or more, we should make sure that the videos transmit video frame textures at the same speed (e.g. video A transmits frame 1, video B transmits frame 1, video A transmits frame 2,  video B transmits frame 2...). BBMetalVideoSource dose not guarantee the same speed now. So the blended texture will be wrong.

I will try to add blending videos feature in the new version.

from bbmetalimage.

damikdk avatar damikdk commented on August 18, 2024

Thanks for quick response. I suppose you're talking months?

My task is getting harder. Couldn't you give me a tips about it? I can try to implement it by myself.

from bbmetalimage.

damikdk avatar damikdk commented on August 18, 2024

Wow, thanks, dude!

Yesterday I already wrote simple AVFoundation blender for our task, but maybe we will use your awesome lib too. Again, thank you for quick responses.

from bbmetalimage.

fanguohuiruan avatar fanguohuiruan commented on August 18, 2024

hi, BBMetalBaseFilter or implements , i call it BBMetalBaseFilter's. i just qustion you that BBMetalBaseFilter's can record a view's animation to a BBMetalVideoWriter. and insert this to video to a limited duration into other much longer video.

from bbmetalimage.

fanguohuiruan avatar fanguohuiruan commented on August 18, 2024

i want to record the animation of a view's all moves. what can i use with the BBMetalImage. Thank you very much!

from bbmetalimage.

Silence-GitHub avatar Silence-GitHub commented on August 18, 2024

@fanguohuiruan I open a new issue How to record a view animation

from bbmetalimage.

blurtime avatar blurtime commented on August 18, 2024

@damikdk Do you still have the code? MultipleVideoBlendVC works great if the video is already recorded. But I am currently looking into applying a video as a filter (e.g. with an alpha value of 0.5). I would greatly appreciate it if you could share your code.

from bbmetalimage.

damikdk avatar damikdk commented on August 18, 2024

@blurtime actually, I have some, but I am not sure about NDA. Our code are blending videos from files (not views) with default AVAssetExportSession. It’s not that hard and you can check similar code in rubygarage/media-watermark. But it works only with images, text and GIFs.

from bbmetalimage.

juanctecdam avatar juanctecdam commented on August 18, 2024

I'm using this now because I had the same need and I end up forking it, since this branch hasn't been updated(multiple_video) for a while.
Is there any plan to actually release this?

from bbmetalimage.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.