1

am trying to cut a part of Video

Here is the code i have tried Let's say i have 6 seconds video and i want to slow down 2:5 seconds video that 3 second video

First approach after searching is, Cut the video, then apply slow filter then concat it with original video. But this is a mid part not entire video. How can i modify below code

ffmpeg -i Soon.mp4 -filter_complex [0:v]trim=2:5,setpts=PTS-STARTPTS[v1];[v1]setpts=0.5PTS[v1];[0:a]atempo=2[a] concat=n=1:v=1:a=1 -map "[v]" -map "[a] -preset superfast -profile:v baseline output.mp4

2

This slows down one part of a video and keeps the rest as is.

ffmpeg -i Soon.mp4
  -filter_complex
     "[0:v]trim=0:2,setpts=PTS-STARTPTS[v1];
      [0:v]trim=2:5,setpts=2*(PTS-STARTPTS)[v2];
      [0:v]trim=5,setpts=PTS-STARTPTS[v3];
      [0:a]atrim=0:2,asetpts=PTS-STARTPTS[a1];
      [0:a]atrim=2:5,asetpts=PTS-STARTPTS,atempo=0.5[a2];
      [0:a]atrim=5,asetpts=PTS-STARTPTS[a3];
      [v1][a1][v2][a2][v3][a3]concat=n=3:v=1:a=1"
  -preset superfast -profile:v baseline output.mp4
  • Hi Thanks for this code :) can u please explain this part [0:a]atrim=2:5,asetpts=2*(PTS-STARTPTS),atempo=0.5[a2]; what is 2 and 0.5? – Muhammad Umar Jun 27 '17 at 20:19
  • If you're slowing down part of a video, you'll want to slow down corresponding audio as well. But not the other parts of the audio. That 2 is not needed. Removed. 0.05 is to slow down the audio by 2. – Gyan Jun 28 '17 at 4:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.