FFMpeg : Creating a video clip of approx. 10 seconds when video duration is unknown without audio-

11,997

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/

Share:
11,997

Related videos on Youtube

We are Borg
Author by

We are Borg

Working in Pune,India. Open to meet new people, attend conferences, good talks. For followup on any answer or any doubt about posts on SO, email at kernelfreak[at]gmail.com :-)

Updated on September 18, 2022

Comments

  • We are Borg
    We are Borg almost 2 years

    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.

  • chovy
    chovy about 4 years
    i donj't get any audio
  • I0_ol
    I0_ol over 3 years
    @chovy For audio remove the -an flag