8

I am working on a project where I am looking to extract a video clip from an input video. I have found many links (Eg: link) which do this task, but in all this I have to specify video duration.

Unfortunately I don't have that information as I am giving a file-path. What I am looking for is a 10 seconds clip from the video which is saved at specific location without the audio part.

My intention is to show that 10 seconds video as a preview of the actual video in the front end, and I don't want to start sound in that.

1 Answer 1

14

You are most likely after:

ffmpeg -i "A_File.mp4" -ss 00:00:0.0 -t 10 -an "B_File.mp4" 

To do it a bit faster you can also try adding -threads $(nproc) eg:

ffmpeg -threads $(nproc) -i "A_File.mp4" -ss 00:00:0.0 -t 10 -an "B_File.mp4" 

There is already a substantial number of articles and documentation on achieving these results including:

https://ffmpeg.org/ffmpeg.html

http://www.labnol.org/internet/useful-ffmpeg-commands/28490/

2
  • i donj't get any audio Commented Apr 28, 2020 at 0:16
  • 2
    @chovy For audio remove the -an flag Commented Oct 27, 2020 at 22:42

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.