I want to save videos in slow motion through my android app.I tried to convert videos into slow motion by changing frame rate.
I used the following commands,first command is dumping 30 frames per second from videos to a temp directory, and then second command is using these images to create a video with reduced or faster frame rate and then i am deleting all the images from temp directory.
ffmpeg -i input_file.mp4 -r 30/1 img%03d.png
ffmpeg -framerate 15/1 -i img%03d.png -r 30 -pix_fmt yuv420p out4.mp4
But this is a very slow operation. It is taking like forever even for small videos.
I even tried to change PTS(presentation time stamp) of videos, but it is not working properly on android phones using this command:
ffmpeg -i input.mkv -filter:v "setpts=2.0*PTS" output.mkv
as suggested here: https://trac.ffmpeg.org/wiki/How%20to%20speed%20up%20/%20slow%20down%20a%20video
Can anybody suggest me how can i make it fast. Is it necessary to save frames to a temp directory, can i pass the output of ffmpeg process to another ffmpeg process executing concurrently through some method.
Is there any other ffmpeg command to save the videos in slow motion?