If just need to crop Audio/Video from a longer track, what can I use? I tried OpenShot, but I find the export video slow, perhaps its compling all the "layers" into a new movie? Perhaps I just need a simple "crop" tool for audio/video will surfice?
-
1What sort of video formats are you dealing with? Are you looking for a GUI or a CLI solution? – fossfreedom Aug 06 '11 at 11:21
-
1Formats will be probably mp4, flv, mp3. GUI or CLI will be fine. – Jiew Meng Aug 06 '11 at 13:06
-
2see http://superuser.com/questions/138331/using-ffmpeg-to-cut-up-video – Dennis Golomazov Sep 05 '13 at 13:57
22 Answers
- Avidemux (From PPA) - http://avidemux.sourceforge.net/
- OpenShot (From PPA) - https://launchpad.net/openshot/ http://www.openshot.org/ppa/
- Pitivi (From PPA) - http://www.pitivi.org/?go=download
I was going to mention commands like ffmpeg or avconv (The new one) which can OBVIOUSLY split files into groups. For example:
FFMPEG
ffmpeg -ss 00:00:00 -t 00:30:00 -i input.avi -vcodec copy -acodec copy output1.avi
ffmpeg -ss 00:30:00 -t 00:30:00 -i input.avi -vcodec copy -acodec copy output2.avi
ffmpeg -ss 01:00:00 -t 00:30:00 -i input.avi -vcodec copy -acodec copy output3.avi
Or
ffmpeg -ss 0 -t 100 -i source.m4v -vcodec copy -acodec copy part1.m4v
ffmpeg -ss 100 -t 100 -i source.m4v -vcodec copy -acodec copy part2.m4v
ffmpeg -ss 200 -t 100 -i source.m4v -vcodec copy -acodec copy part3.m4v
ffmpeg -ss 300 -t 100 -i source.m4v -vcodec copy -acodec copy part4.m4v
AVCONV
avconv -i input.avi -vcodec copy -acodec copy -ss 00:00:00 -t 00:30:00 output1.avi
avconv -i input.avi -vcodec copy -acodec copy -ss 00:30:00 -t 00:30:00 output2.avi
avconv -i input.avi -vcodec copy -acodec copy -ss 01:00:00 -t 00:30:00 output3.avi
Or
avconv -ss 0 -i source.m4v -t 100 -vcodec copy -acodec copy part1.m4v
avconv -ss 100 -i source.m4v -t 100 -vcodec copy -acodec copy part2.m4v
avconv -ss 200 -i source.m4v -t 100 -vcodec copy -acodec copy part3.m4v
avconv -ss 300 -i source.m4v -t 100 -vcodec copy -acodec copy part4.m4v
Or do some script like here: http://icephoenix.us/notes-for-myself/auto-splitting-video-file-in-equal-chunks-with-ffmpeg-and-python/

- 103
- 4

- 211,503
-
7Beware: According to the man page [ http://linux.die.net/man/1/ffmpeg ] this results in unnatural, overlapping cuts. For instance, the second command starts at 00:30:00 but goes on for an hour; i.e., up to 01:30:00, so the third command, which starts at 01:00:00, will yield an overlapping cut. It may be the goal, but it wouldn't be very natural. – ezequiel-garzon Sep 24 '12 at 22:12
-
1I can vouch for what ezequiel mentions. When doing the tests with ffmpeg or avconv the overlapping effect appears if using the times as mentioned above. I will update to a more accurate effect although I should mention that the first second will also overlap. I will fix both and add avconv to the group. Thanks ezequiel. – Luis Alvarado Sep 25 '12 at 03:00
-
Thanks! But these ppa versions are out-of-date. Are the versions in Precise 12.04 good? Or can someone suggest better ones? – nealmcb Oct 14 '13 at 14:47
-
Thanks for notifying me. When I get back home I'll post an updated link. – Luis Alvarado Oct 14 '13 at 15:03
-
Thanks! avconv is blazingly fast and clear and convenient for splitting out clips if you know what start/stop times you want. No need to figure out which OpenShot video format your source file corresponds to, which I still don't know for sure.... – nealmcb Oct 16 '13 at 23:16
-
Be careful with copy on video codec; you might get an intro without video until the next keyframe. – user165448 Mar 11 '15 at 20:26
-
I would say not possible to @user165448 until that actually happened to me. I had to do a lot of research into the why it happens. It is rare BUT possible. So listen to him. – Luis Alvarado Mar 11 '15 at 20:50
-
Great! avconv is so so fast. I tried in Ubuntu 15.10. I ran the avconv command but it seemed that ffmpeg ran and not avconv! What's the fact? Also please suggest me a CLI tool for combining laterally (side by side) parts of audio / video! Thanks in advance. Also hereby addressing @ Philippe Gachoud – Ravi Dec 15 '15 at 11:43
-
3At least when using avconv you don't need to invoke the video and audio codec separately. You should just go with $ avcon -i input-file -codec copy [any option like -ss -t -fs ... just check on ubuntu.manpages.com for avconv] output-file – Antonio Jan 03 '16 at 00:20
-
-
-
@ezequiel-garzon you can force keyframes to fix this. See How to extract time-accurate video segments with ffmpeg. – jchook Sep 09 '19 at 22:03
-
-t
didn't work for me I used-to
instead:ffmpeg -ss 00:02:19 -i input.avi -vcodec copy -acodec copy -to 00:00:44 output.avi
where the-to
argument is the duration of the extract – Taoufik Mohdit Sep 29 '19 at 22:28 -
-codec copy
worked on mkv using ffmpeg. Example can be shown here: https://superuser.com/a/743085/71560 – AlikElzin-kilaka Sep 07 '20 at 09:19 -
This answer is useful as well https://askubuntu.com/a/59388/578917 – Salma Gomaa Jan 25 '21 at 20:34
-
The trouble with these video editors is that they will change the resolution of your video by default. – Flimm Feb 01 '22 at 13:37
With new version from ubuntu avconv
avconv -i srcFileName -c:a copy -c:v copy -ss 00:03:40 -t 00:01:12 targetFileName
- First argument time is from time
- Second argument is duration (not end time) duration may be either in seconds or in "hh:mm:ss[.xxx]" form.
To specify end time instead, use the option -to [end time].
Please refer to ffmpeg documentation for more informations

- 5,900
- 3
- 43
- 50
-
Thanks, an expert. Damn me not to read third-rated answer in the thread before doing anything. Without this examples Ī̲’d fail to turn off video recoding (“-vn” failed to produce this effect, for some reason) and would also have other problems. By the way, does “-c:s copy” make the same thing for subtitles? – Incnis Mrsi Aug 22 '15 at 11:24
-
Also, since my experience, when cutting out only the last part (i.e. when beginning of the new video coincides with beginning of the original video) “-ss 0” is potentially problematical and should be omitted. Ī̲ had a program (namely, Bombono DVD) crashed trying to read a file made with “-ss 0” substituted in place of the original file. – Incnis Mrsi Aug 22 '15 at 12:01
-
Thanks Philippe! This helped me a lot. can I ask what the args
-c:a copy -c:v copy
mean? – Alex Jan 03 '16 at 09:43 -
3
-
-
2@Alex copy to copy the audio codec and video codec to the target stream. See more @ https://ffmpeg.org/ffmpeg.html#Main-options and refer to the ffmpeg documentation for more informations – Philippe Gachoud Jan 04 '16 at 10:51
-
I'm not sure this answer still works. It seems like there is no
avconv
in Ubuntu 20.04.3 LTS. I suspectffmpeg
is the replacement, but that also doesn't work: if the cut times are not aligned with a key frame, there may be some weird things happening at the start/stop of the video. – MRule Oct 28 '21 at 17:04 -
@MRule see https://stackoverflow.com/questions/9477115/what-are-the-differences-and-similarities-between-ffmpeg-libav-and-avconv – Philippe Gachoud Oct 29 '21 at 08:15
kdenlive is (in my experience) the easiest software which will allow you to perform that task in a few steps and without problems. Even so, the OpenShot Video Editor project is also useful but it yet needs lots of hard work to get closer to the kdenlive.
Here are a screenshot of the kdenlive and openshot respectively:
Good luck!

- 19,552
-
Kdenlive is my favourite. All other linux editors crashed when using MOV files from my Kodak Zi8 camera. Easy to use and very powerful. – Ramon Suarez Jun 16 '12 at 06:52
-
2Not sure what's going on with my edit. Looks fine in editing mode but here its messed up. – Insperatus Sep 05 '12 at 20:59
-
Sorry, I can't understand. Do you mind giving further details? If you think necessary please open a question about your issues. Thank you! – Geppettvs D'Constanzo Sep 05 '12 at 21:17
-
Sorry about the OT intrusion and thanks for your cordiality, I'll take it where appropriate. Good day! – Insperatus Sep 06 '12 at 23:32
-
3The easiest software Kdenlive asks a hell of irrelevant questions before even starting a project. But when about to do something, it spawns
avconv
and whenever it fails, Kdenlive won't offer help tp rectify situation and even doesn't report with which exactly parameters it ranavconv
. Definitely a non-choice for one willing simply to trim a video file. – Incnis Mrsi Aug 22 '15 at 11:07 -
2Personally, kdenlive seemed good, but the interface is very unintuitive and unnecessarily complex. Also, there seems to be some bug. After loading a clip, sometimes the clip plays. Sometimes it doesn't. Not recommended. – Nav Jul 23 '17 at 19:47
-
-
kdenlive
started from asking utterly pointless questions and later crashed before opening the first video files. CLI editing of video files is better than that. – reducing activity Dec 19 '18 at 13:22 -
kdenlive
might seem overqualified for some of these tasks, I agree, same as photoshop might seem overqualified to crop a picture. Still, if you're comfortable with kdenlive, it works for simple stuff also. And if you try to mix and match 20 clips into one large one with transitions, well, good luck usingavconf
– ffflabs Mar 24 '19 at 14:49 -
Answer with snapshot to show the feature should be the accepted one in my view. Thanks for great detail sharing @GeppettvsD'Constanzo – Nam G VU Oct 16 '20 at 10:27
LosslessCut is focused entirely on clipping/cutting, is simple to use and does not re-encode, meaning exporting is fast.
To ensure audio remains synced with image, use the keyframe cut option.

- 729
-
-
3Oftentimes the initial few frames of the next merged clip would be glitchy in the final exported video – Harsha Jun 01 '21 at 16:08
-
1@Harsha, I'm not sure if it's relevant to that issue, but are you using the keyframe cut option? – David Oliver Jun 02 '21 at 13:56
-
Simple and extremely fast (3h video -> 2h in a ubuntu virtual machine in under 10 seconds!). – Pierre Jun 17 '22 at 17:57
-
this is the fastest one because it will not render the video, but it is no accurate – Saleh Abdulaziz Nov 21 '22 at 22:36
I like kdenlive for finishing up as well or clipping out small chunks...but if he wants to split a LARGE lecture into smaller pieces he could try:
ffmpeg -i input.mpg -ss 00:00:10 -t 00:00:30 out1.mpg -ss 00:00:35 -t 00:00:30 out2.mpg
discussion of the command is here: http://ubuntuforums.org/showthread.php?t=480343

- 58,122

- 29,530
OpenShot Video Editor looks promising. Have you checked it?. Checkout the features: http://www.openshot.org/features/
The official installation method is via AppImage available at https://www.openshot.org/download/
To install it just open a terminal and run the following commands:
sudo add-apt-repository ppa:jonoomph/openshot-edge
sudo apt-get update
sudo apt-get install openshot openshot-doc
Just give a try.

- 1,095

- 30,321
-
-
-
If the OP only wants to quickly crop video, then AVIDemux is far easier to use than OpenShot. I've just tried them both - OpenShot was surprisingly cumbers at just letting me define the in and out points for one video track. – Dan Dascalescu Jan 27 '16 at 22:40
-
OpenShot is definitely more user friendly than any of the other highly upvoted answers here. – Nav Jul 23 '17 at 20:10
-
OpenShot is mentioned in the question as program that failed but for me it was acceptable (export is slow but at least it had working preview of position where I cut and was not crashing - unlike other solutions that I tried). – reducing activity Dec 20 '18 at 05:39
I'm using ffmpeg CLI interface for that. It's very easy and fast:
to cut video:
ffmpeg -i InputFile -vcodec copy -acodec copy -ss 00:00:00 -t 00:01:32 OutPutFile
to cut audio:
ffmpeg -i InputFile -vn -acodec copy -ss 00:00:00 -t 00:01:32 OutPutFile
In both of these -ss
is the start point, while -t
is the duration of the piece.
You can calculate duration e.g. using LibreOffice Calc or python's dateutil
package, or you can use the -to
option which accepts the end time directly.
-
This answer is so helpful as well https://askubuntu.com/a/59388/578917 – Salma Gomaa Jan 25 '21 at 20:37
My preference for easy video clipping has always been avidemux.
Just set the video and audio encoding to Copy and choose the container format you want, within reason.
Installation:
sudo apt-get install avidemux

- 1,095

- 17,473
Try Avidemux (Ubuntu 14.04 and earlier).
sudo apt-get install avidemux
or LiVES
sudo apt install lives

- 114,770

- 643
-
Avidemux freezed several times for my under Ubuntu 13.10, even with a x4 CPU. – Lucio Mar 01 '14 at 19:01
There is also WinFF that is avconv graphic interface. It works great. I installed it from Ubuntu Software Center.

- 839
For cutting, merging, scaling etc one can use … Blender (yes, this 3D editor, but it has also video editing part). You need workout some 20-min tutorial to survive the interface, but then it appears to be unexpectedly pleasant to use.

- 536
Use this
I've written it to cut out ads from recorded TV videos. Using the included remuxer you do not even to have to recode it. There is nothing fancy about it. Just fast.

- 6,402
I use Kdenlive, but I wouldn't be surprised if you could even slice video this way in PiTiVi:
- Create a new project with your full lecture.
- Set your start and end points for the first "manageable chunk" in the clip monitor.
- Drag from the video in the clip monitor down to your timeline. It will be just the chunk you chose.
- Set new start and end points in the clip monitor and repeat as needed.

- 331
-
1I've looked around, and I can't find any way to divide a long clip into multiple shorter clips that I can easily manage. There is no "clip monitor"; PiTiVi is very simple (and I mean that in a good way!) Obviously, I could just cut up the video and reorganize the unnamed chunks in the timeline, but I'd like to know if there's a better way. – Evan Kroske Nov 11 '10 at 06:05
To just crop without trans-coding
(copying instead), I suggest a yad script to be run from a desktop file launcher.
I have found the script here.
I have modified it a bit to include video formats and to avoid transcoding.
It looks like this:
#!/bin/bash
INPUT=$(yad --width=600 --height=400 --file-selection --file-filter='.mp3 .mp4 .avi .m4a .ogg .flac .aac .opus')
eval $(yad --width=400 --form --field=start --field=end --field=output:SFL "00:00:00" "00:00:00" "${INPUT/%.}-out.${INPUT##.}" | awk -F'|' '{printf "START=%s\nEND=%s\nOUTPUT="%s"\n", $1, $2, $3}')
[[ -z $START || -z $END || -z $OUTPUT ]] && exit 1
DIFF=$(($(date +%s --date="$END")-$(date +%s --date="$START")))
OFFSET=""$(($DIFF / 3600)):$(($DIFF / 60 % 60)):$(($DIFF % 60))
ffmpeg -ss "$START" -t "$OFFSET" -i "$INPUT" -c copy -map 0 "$OUTPUT"
So, install yad
, save the script as cut_audio-video.sh
and make it executable.
Than create the file ~/.local/share/applications/cut-audio-video.desktop
similar to:
[Desktop Entry]
Name=Cut audio & video
Exec=/PATH/TO/cut_audio-video.sh
Icon=/SOME/AUDIO/ICON/Audio-icon.png
Terminal=false
Type=Application
Categories=GNOME;GTK;Settings;HardwareSettings;X-GNOME-Settings-Panel;System;
Change Exec
and Icon
lines.
Then it can be run with an app launcher like Synapse:
Select the file, then enter the time for start and end of the cut/crop

- 3,444
- 2
- 34
- 85
In PiTiVi 0.13.5 (Ubuntu 10.10) I was able to simply select a clip and go to Timeline > Split (or just press "S").

- 4,565
For quickly cutting I have used MythTV. I recorded some show, let it automatically search for the commercial breaks and fine-tuned the found markers. After this I started the Myth archiving function and burned all to DVD, without the commercials.
I have to admit, it worked gread from about 2006 or such. Somewhere in 2008 or 2009 some update ruined it all, my markers where somehow shifted.
Right now, I'm in the progress of re-installing this myth stuff, just to see if I can get the trimmer/editor and archiver working.

- 11
- 1
Yesterday I just found that I can do it online, With a youtube account:) If you are in a hurry, and do not have enough time to try which ubuntu software works for you, then do it online.
Go to youtube account, upload your video, then select Video Manager, there is a Enhancement option, at the bottom right corner there lies Trim option
Watch this 1 minute tutorial if you still can not find it

- 11
If you want a GUI application you can use dmMediaConverter, a ffmpeg frontend, which has a split function, without reencoding, fast. Just add the split points and press Run. Also, it can do a lot of other stuff.
http://dmsimpleapps.blogspot.ro/2014/04/dmmediaconverter.html

- 670
vidcutter is a very useful tool for cutting, trimming and merging videos in ubuntu:
Install vidcutter:
sudo add-apt-repository ppa:ozmartian/apps
sudo apt update
sudo apt install vidcutter
works in ubuntu 17.10
I wrote a helper for ffmpeg that mimics substr()
syntax.
Usage
ffslice infile [start [duration [outfile [ffmpeg-args]]]]
Examples
# Get the last 5 minutes of an MP3
ffslice input.mp3 -5:00
# Get the first 30 seconds of a webm
ffslice input.webm 0 30
# Get 5 minutes of video starting at 2 minutes in
ffslice input.mp4 2:00 5:00
Code
#!/bin/bash
# substr() for MPEG-encoded files
infile="$1"; shift
start="$1"; shift
end="$1"; shift
outfile="$1"; shift
args=()
# Convert time to seconds
# https://unix.stackexchange.com/questions/412868/bash-reverse-an-array
timetosec() {
rev="$(<<< "$1" tr ':' '\n' | sed 's/^0\+\([0-9]+\)/$1/' | tac | tr '\n' ' ')"
IFS=' ' read -a times <<< "$rev"
let secs="${times[0]:-0} + (${times[1]:-0} * 60) + (${times[2]:-0} * 3600)"
printf '%i' "$secs"
}
# Input file requred
if [ -z "$infile" ]; then
echo "Usage: $(basename -- "$0") infile [start [end [outfile [ffmpeg-args]]]]" >&2
echo "Example: $(basename -- "$0") input.mp3 -5:00" >&2
exit 1
fi
# Start (negative starts from the end)
if [ "${start:0:1}" = "-" ]; then args+=('-sseof' "$start")
elif [ -n "$start" ]; then args+=('-ss' "$start")
fi
# Input
args+=('-i' "$infile")
# End (use + or - to specify relative to the starting point)
if [ "${end:0:1}" = "+" ]; then args+=('-to' "$end")
elif [ "${end:0:1}" = "-" ]; then args+=('-sseof' "$end")
elif [ -n "$end" ]; then
let dur="$(timetosec "$end") - $(timetosec "$start")"
args+=('-to' "$dur")
fi
# Default output filename
filename=$(basename -- "$infile")
extension="${filename##*.}"
filename="${filename%.*}"
defaultOutfile="${filename}-${start}-${end}.${extension}"
if [ -z "$outfile" ]; then
outfile="$defaultOutfile"
elif [ -d "$outfile" ]; then
outfile="${outfile}/${defaultOutfile}"
fi
# Cannot have colon in the filename with ffmpeg
# https://unix.stackexchange.com/questions/412519/ffmpeg-protocol-not-found-for-normal-file-name
outfile="$(printf '%s' "$outfile" | sed 's/:/./g')"
# Slice audio
ffmpeg "${args[@]}" -c copy "$@" "$outfile" 1>&2
# Output the final location
printf '%s' "$(readlink -f "$outfile")"
Caveat
Note that ffmpeg will only split on keyframes. This usually works well enough for most cases, but if you need precise video segments, see How to extract time-accurate video segments with ffmpeg?. You can force all the needed keyframes before segmenting.

- 216
I always use Kdenlive. Just import the video, drag it onto the timeline, click on the spot where you want to split it, right-click it, and choose cut. Then remove the part you don't need.

- 5,720

- 8,910
-
1Thanks for the helpful suggestion, but for what I need they are too complex. Note that I didn't say too difficult to use, just unnecessarily bloated for my purposes. I ended up using openshot – jfoucher Aug 22 '11 at 23:06
-
1
I've struggled with this same issue, having a large video file that I want to cut and save as separate scenes. After trying to do this in the usual suspects all listed by others here I ended up using Kino.
You will have to import the file as Kino needs it in dv format (whatever that is) and you can then specify start and end point for each clip on the Edit tab, then export each clip individually on the Export tab. Works great and is fast, the slowest part is the initial import of the video file. You can even add effects like titles to each clip.
I found that it is hard to find the exact spot to cut the scene in Kino and when I play the vid in the built in player there is no sound (there is when exported) and it plays too fast so I play the video in avidemux, find the time or frame number where I want to cut it, then use this info in Kino.
I do find it crashes a fair bit (I use Ubuntu 15.04 Kino v1.3.4) but it will recover where you were upon restart.
Update on the Kino webpage:
Kino is a dead project
( 05.08.2013 14:15 )
Kino has not been actively maintained since 2009. We encourage you to try other Linux video editors such as Shotcut, Kdenlive, Flowblade, OpenShot, PiTiVi, LiVES, and LightWorks.