this post was submitted on 22 Feb 2025
17 points (100.0% liked)

Linux

50396 readers
917 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

debian 12.9 with ffmpeg.

The mkv file is 68 minutes long, I want to get rid of minutes 05:50 to 11:00 and 58:00 to 68:00. I want the resulting parts (00:00 to 05:00 and 11:00 to 58:00) bind together as a single mkv file.

the ffmpeg command I've always used for similar but easier purposes:

ffmpeg -i "E01 - Part One [x265].mkv" -ss 00:00:00 -to 00:07:28 -c copy output.mkv

can I do this with ffmpeg or do I have to bind the 2 resulting files with mkvtoolnix?

ETA: would it be a better idea to use ffmpeg installed from flatpak instead of debian's default sources? I don't know if ffmpeg is updated regularly

top 6 comments
sorted by: hot top controversial new old
[–] N0x0n@lemmy.ml 1 points 2 hours ago

After some fiddling arround my self I had some Audio sync/frame gone missing issues with ffmpeg, I would recommend to use mkvtoolnix to cut and merge your mkv files together.

[–] Xanza@lemm.ee 10 points 13 hours ago

You should be able to pass multiple -ss and -to flags. Should look something like this;

ffmpeg -i "E01 - Part One [x265].mkv" -ss 00:05:50 -to 00:11:00 -c copy 1.mkv -ss 00:58:00 -to 00:68:00 -c copy 2.mkv
ffmpeg -i 1.mkv -i 2.mkv -filter_complex "[0:0][0:1][1:0][1:1]concat=n=2:v=1:a=1[outv][outa]" -map "[outv]" -map "[outa]" output.mkv

I've confirmed that this works fine.

[–] synestine@sh.itjust.works 3 points 13 hours ago

Look into ffmpeg's "concat" feature. It can do what you want. https://trac.ffmpeg.org/wiki/Concatenate