Open developerandroid123 opened 7 years ago
Is there anyone to help me?
I think you should handle it after record use FFmpeg.
https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video
Thanks for response : But I want it at realtime . i want to change the speed setting like fps or anything else that can change the speed of recorded video . @wysaid please give me your suggestions on this How to make 2 times faster and 2 times slower video while recording?
Change this line from
int newPTS = round(decodeHandler->getCurrentTimestamp() / 1000.0 * ENCODE_FPS);
To
int newPTS = round(decodeHandler->getCurrentTimestamp() / 1000.0 ENCODE_FPS) 2.0;
Will make it 2 times slower. And change 2.0
to 0.5
will make it 2 times faster.
But it's an after-recording operation.
You can also add such multiply operation on pts
when recording.
If i do same as you told above Then by changing int newPTS = round(decodeHandler->getCurrentTimestamp() / 1000.0 ENCODE_FPS) 2.0; Resultant video Will become 2 times slower??
I have changes as you told me in my code Then there is no change in resultant video
please suggest me any setting Which i can make before start recording Then that change will be reflected in output video @wysaid
Change here: https://github.com/wysaid/android-gpuimage-plus/blob/master/library/src/main/jni/interface/cgeFrameRecorder.cpp#L281 And rebuild the JNI module.
if i do change here then how can i change at realtime in camera setting This is not userFriendly for users
So why can't you make the multiply factor as a variable and can be set by some function? Please learn more about programming skills.
let me try
I have achieved what i want Now When i am speeding up video then 10 seconds videos played for 5 seconds and for other 5 seconds last frame is displaying
Print the pts
in console, and see if there're strange pts
Your problem is that your audio is not at the same speed with the video, please mute the audio.
Hey @wysaid , Can you suggest how to go about slowing down and speeding up the audio along with the video ?
@rajdeep1008 You may need remuxing & resample. I'm not very good at that. You may learn that from ffmpeg document...
@wysaid Can you point out which classes or files should be the ones i should be tinkering around ?
@rajdeep1008
I think real time speed changing is not necessary, you can just record the origin video, and do it later.
For example, save the video cut as 1.mp4
and mark as 0.5x
, and go on recording the video as 2.mp4
at 2.0x
. When finishing the recording, combine them together with specified argument using ffmpeg command
How to make 2 times faster and 2 times slower video while recording? Please help