Sub topic 14
Trim the recording and hand it off to editing
This chapter covers the last step of the recording workflow. You take the file OBS produced, cut off the dead air at the start and end, and deliver a file your editor or publishing platform accepts. It assumes you have recorded a lesson, understand the difference between MKV and MP4 containers (covered in the recording format chapter), and can run a command in a terminal.
What you are trying to achieve
A raw recording usually has three problems. There is a few seconds of silence while you reach for the mouse and click Start Recording. There is a tail where you move the cursor to stop. Occasionally there is a mistake in the middle.
Trimming the head and tail is a quick, lossless job. Fixing mistakes in the middle belongs in a video editor. The goal is to avoid re-encoding where you can, because every re-encode costs time and can reduce quality.
Decide: trim now or leave it to the editor
You have two options for the head and tail. Pick by what happens to the file next.
| Situation | Best approach | Why |
|---|---|---|
| The file goes to an editor (Resolve, Premiere, Kdenlive) | Remux only, trim in the editor | The editor trims non-destructively, and you keep all the footage |
| The file is published as is | Trim with ffmpeg | No editor step exists, so you need a clean start and end |
| You need to share a long file quickly | Trim with ffmpeg and stream copy | Smaller file, no render time |
| You need frame-exact cuts | Re-encode the trimmed section | Stream copy cuts only at keyframes |
Step 1: remux first
If you record to MKV for crash safety, convert to MP4 before anything else. In OBS you do this with File > Remux Recordings. The command-line equivalent copies the streams into a new container without re-encoding:
ffmpeg -i "2026-11-28 15-45-10.mkv" -c copy "lesson-01.mp4"The -c copy option means "copy every stream as is". The command finishes in seconds because no video is decoded or encoded. The original MKV stays untouched. Keep it until you have checked the MP4 plays correctly from start to end.
Step 2: trim with stream copy
This command cuts a section out of the file without re-encoding:
ffmpeg -ss 00:00:05 -to 00:10:00 -i lesson-01.mp4 -c copy lesson-01-trimmed.mp4Here is what each part does.
-ss 00:00:05is the start time. The output begins about five seconds into the recording.-to 00:10:00is the end time. The output stops at ten minutes.-i lesson-01.mp4is the input file.-c copycopies the streams without re-encoding.
The output is a new file. The input is not modified.
How keyframes limit the cut
Video is stored as a series of keyframes (complete pictures) with frames in between that describe only the changes. With stream copy, ffmpeg cannot start a clip in the middle of one of these groups, because the in-between frames need the keyframe before them. The cut point therefore snaps to a nearby keyframe.
The practical effect is that your clip may start slightly earlier or later than you asked for. With OBS defaults, keyframes are typically a few seconds apart or less, depending on the keyframe interval you set in the output settings. A shorter interval gives you finer cuts at the cost of a slightly larger file.
If a cut lands a moment too early and shows a bit of the dead air you wanted gone, you have three choices:
- Accept it, if it is under a second or two.
- Move the start time a little later and run the command again.
- Re-encode the trimmed clip, which gives exact cuts (see below).
Placing -ss before or after -i
In the command above, -ss and -to come before -i. ffmpeg then seeks in the input, which is fast. If you place them after -i, ffmpeg reads and discards everything up to that point, which is slower on long files. With stream copy, the before-input placement is the usual choice. In recent ffmpeg versions -to before -i is measured against the input timeline, so the two times above mean the clip runs from 5 seconds to 10 minutes.
Step 3: re-encode only when you need exact cuts
If the cut must be frame-exact, drop -c copy and let ffmpeg encode the clip:
ffmpeg -ss 00:00:05 -to 00:10:00 -i lesson-01.mp4 -c:v libx264 -crf 18 -preset medium -c:a aac -b:a 192k lesson-01-exact.mp4This decodes the video and encodes it again, so it takes real time and applies a second round of compression. A CRF (constant rate factor) of 18 is visually close to the source for most screen content. Lower numbers give higher quality and larger files. Audio is encoded to AAC at 192 kbps.
Screen recordings contain sharp text, so avoid high CRF values such as 28 or above. Text edges become blurry quickly.
Step 4: check the result
Before you delete anything, check three things.
- Open the trimmed file and scrub to the start, the middle, and the last few seconds.
- Confirm that audio and video are in sync near the end of the clip, not only at the start.
- Look at the file properties for the expected resolution and frame rate.
You can read the properties with ffprobe, which ships with ffmpeg:
ffprobe -v error -show_entries stream=codec_name,width,height,r_frame_rate -of default=noprint_wrappers=1 lesson-01-trimmed.mp4The output lists the codec, size, and frame rate of each stream. Compare it with the canvas and output settings you chose earlier. A mismatch tells you something changed in the pipeline.
Name and organize the files
Handoff goes more smoothly when file names are predictable. One workable convention:
lesson-01.mkvis the original recording. Keep it as the master.lesson-01.mp4is the remuxed copy.lesson-01-trimmed.mp4is the version for delivery.
If you set the OBS filename format at the start of the project (for example with a lesson prefix before the timestamp), the files already sort in order. Group each lesson's files in one folder, and keep the same folder structure across the whole course.
Hand off to an editor
When the file goes to an editor, whether that is you in another program or a colleague, include what they need to make decisions.
- The file itself. Prefer the remuxed MP4 with the original frame rate. Do not convert 60 fps footage to 30 fps unless you have to.
- Notes on problems. List timestamps of mistakes, such as "02:14 coughed, re-say next sentence". This saves the editor from scrubbing the whole file.
- Audio expectations. Say whether the microphone and desktop audio are on separate tracks. If you set up multiple audio tracks in OBS, the editor can adjust the voice and system sounds independently.
- Source assets. Include slides, images, or code files shown in the lesson, in case the editor wants to replace a blurry moment with a clean graphic.
Common errors
- The trimmed clip begins with a frozen frame or a brief black picture. The cut snapped to a keyframe that does not line up with the audio start. Shift the start time by a second or re-encode.
- Audio drifts after the cut. This is more common when you cut from a variable frame rate recording. Re-encode the clip, or record at a constant frame rate in the OBS output settings.
- The output is longer or shorter than expected. Check that you placed
-ssand-tobefore-i, and that the time format isHH:MM:SS. - The editor refuses the file. Some editors handle MKV poorly, or reject certain audio codecs. Remux to MP4, and if audio is the problem, re-encode only the audio with
-c:v copy -c:a aac. - Overwriting a master. Always write to a new output name. ffmpeg asks before overwriting an existing file, but a mistaken answer loses your footage.
Summary of the workflow
- Record to a crash-safe format.
- Remux to MP4 without re-encoding.
- Trim the head and tail with stream copy, or leave trimming to the editor.
- Re-encode only when you need exact cuts.
- Check the start, middle, and end.
- Hand off the file with notes, and keep the original.
Exercise
You recorded a 40-minute lesson to MKV. The lesson goes to an editor who will cut out mistakes. You also want a quick preview copy with the first 10 seconds removed. Which commands do you run, and why do you not re-encode?
Show answer
Remux for the editor with ffmpeg -i lesson-01.mkv -c copy lesson-01.mp4, and send that full file with notes, because the editor trims non-destructively. For the preview, run ffmpeg -ss 00:00:10 -i lesson-01.mp4 -c copy lesson-01-preview.mp4. Stream copy is enough because a preview does not need frame-exact cuts, and it avoids render time and a second round of compression. The cut may snap to a nearby keyframe, which is acceptable here.
Exercise
After trimming with -c copy, the clip starts one second earlier than you asked, showing dead air. Name two ways to fix it.
Show answer
Move the start time a little later and run the command again, or re-encode the clip (drop -c copy and use for example -c:v libx264 -crf 18 -c:a aac). Re-encoding gives frame-exact cuts because ffmpeg decodes and encodes every frame, so it no longer depends on keyframes.