Comments (14)
@schumy MultipleVideoBlendVC
consumes too much memory. I have not found a solution for the problem, so can not release it. Sorry.
from bbmetalimage.
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.
@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.
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.
from bbmetalimage.
And I got memory leak with crash when I tried to disable playWithVideoRate
from bbmetalimage.
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.
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.
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.
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.
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.
@fanguohuiruan I open a new issue How to record a view animation
from bbmetalimage.
@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.
@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.
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)
- Question: How to replace a colour with a different or transparent colour?
- Terminated due to memory issue
- How effect pixellate with Position ?
- Video overlay on chroma key camera filter
- Support video seeking
- Support dynamic overlay view HOT 5
- How to restore image after using the filter HOT 1
- Double Camera bug HOT 2
- The image is mirrored when the front camera is mixed. Is there any way to make it not mirrored? HOT 1
- Transform filter HOT 4
- BBMetalTransformFilter is NOT working as expected HOT 3
- Render UI View with transparency? HOT 2
- 10 seconds of recording UI crashes iphone 7plus but works on 12
- a way to seek in BBMetalUISource
- 相机支持旋转吗? HOT 1
- how can I add a watermark or sticker to video? HOT 2
- Video is zoomed automatically when use videoWriter? HOT 1
- Recording with front camera video not mirrored. HOT 1
- Telephoto and Ultra wide angle camera suddenly stop working view is freezes HOT 1
- When switchCameraPosition is called on a bb metal camera instance, some people experience camera screen rotate by 90 degree. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bbmetalimage.