N
N
Nikita2021-08-14 11:06:51
fmpeg
Nikita, 2021-08-14 11:06:51

Ffmpeg - crop and convert video file?

Hello. I am just starting to study this overseas thing, so I ask for your help. Thank you all in advance!
There is a video file whose duration is ~25 minutes. I need to remove 1 fragment from this file and convert this file again, but without this fragment.
The fragment is located on the segment 00:01:05 and its duration is 00:00:37. What command should I enter to remove this fragment and convert the file WITHOUT it?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
egor_nullptr, 2021-08-14
@WoT_Seller

Can be done in three steps.
First - cut off the beginning

ffmpeg -i input.mkv -ss 00:00:00 -t 00:01:05 p0.mkv

Second - cut off the end
ffmpeg -i input.mkv -ss 00:01:42 p1.mkv
Third - glue
ffmpeg -i p0.mkv -i p1.mkv \
-filter_complex "[0:v] [0:a] [1:v] [1:a] concat=n=2:v=1:a=1 [v] [a]" \
-map "[v]" -map "[a]" out.mkv

Alternative gluing.
Create list.txt file with this content
file p0.mkv
file p1.mkv

and glue with this command
ffmpeg -f concat -safe 0 -i list.txt -c copy out.mkv

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question