Comments (12)
The information can probably be found here
You could try the following within the setUpWriter
method.
_videoWriterInput.mediaTimeScale = FPS;
_videoWriter.movieTimeScale = FPS;
from asscreenrecorder.
I'm getting warning: Unable to write buffer to video.
It means appendPixelBuffer return NO (line 266).
I did another way by setting frameInterval
property of _displayLink
.
from asscreenrecorder.
I did another way by setting
frameInterval
property of_displayLink
.
Cunning plan : )
from asscreenrecorder.
:D
from asscreenrecorder.
I have another question.
How can I implement pause/resume functionality?
I tried to play with _displayLink.paused
property. It works, but not as I expect.
In the exported video I see a frozen screen (the screen from where I paused recording) for some time interval (actually this is the interval between pause and resume) and after the image changes.
In other words, lets say if I started the recording on time1 and stopped on time 2, and paused on time3 and resumed on time4, then the video duration still will be (time2-time1):
Start_________________________________________________________________________Stop
|__frozen screen_******************|
(time1)(time3)(time4)____(time2)
So what I should do, to cut that time interval (from time3 to time4) from the video, or prevent from recording when it paused?
from asscreenrecorder.
Unfortunately the functionality you want is not implemented. A workaround would be to stop recording instead of pausing, then record a new video for the next section. You would then need to use AVFoundation to combine the separate videos into one when you're finished.
The ability to pause recording is probably feasible to add to the current code base, but it's not something I have time to implement personally.
from asscreenrecorder.
I think I found the solution, again :D
I'm collecting the timestamps of pause and resume times in the array, and then I remove that intervals from elapsed
:
CFTimeInterval elapsed = _displayLink.timestamp - self.firstTimeStamp;
if (self.pauseResumeTimeRanges.count) {
for (int i = 0; i < self.pauseResumeTimeRanges.count; i += 2) {
double pausedTime = [self.pauseResumeTimestamps[i] doubleValue];
double resumeTime = [self.pauseResumeTimestamps[i+1] doubleValue];
elapsed -= resumeTime - pausedTime;
}
}
CMTime time = CMTimeMakeWithSeconds(elapsed, 1000);
Cunning plan, huh? :))
from asscreenrecorder.
I wonder if you can achieve the same result by checking _isRecording
in the writeVideoFrame
method? I've not actually tried to see if it would work, but the idea is: you'd set _isRecording
to NO
to pause the recording and restart by setting it back to YES
. Then you'd need to check before writing the video frame:
if (![_videoWriterInput isReadyForMoreMediaData] && !_isRecording) return;
Having not actually tried this idea out, I can't guarantee it'll work. Seems reasonable?
from asscreenrecorder.
That will give same result as setting _displayLink.paused
to NO
. Because the issue is with _displayLink.timestamp
value. It always returns the time value associated with the last frame that was displayed.
from asscreenrecorder.
Fair point. Perhaps another technique would be to pause the displayLink, capture the paused time, then adjust the self.firstTimeStamp
before resuming recording?
Either way, good luck with your mission!
from asscreenrecorder.
Thank you :)
from asscreenrecorder.
@arturdev @alskipp Can you guys please help me with this issue #15 :( , Thanks in advance
from asscreenrecorder.
Related Issues (20)
- How to record particular view only ? HOT 1
- UIAlertview not visible HOT 2
- Urgent Help: Black video on iOS9? HOT 1
- how to add Audio ? HOT 1
- Warning: Unable to write buffer to video HOT 1
- Not working properly HOT 1
- Appstore? HOT 1
- [FPS] How change FPS of the video to 60/1? HOT 4
- In background Mode HOT 1
- Recored only Subview HOT 1
- After once record,Twice will be crash. HOT 1
- How to Capture AVCaptureVideoPreviewLayer? (camera.previewlayer) HOT 4
- Carsh on my iPhone HOT 1
- cpu very high HOT 4
- record half size resolution for retina iPads????
- unable to capture the camera preview layer HOT 8
- Unable to record youtube full screen video
- Unable to build on Swift 5
- Possible to include video from AVPlayer? HOT 5
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 asscreenrecorder.