Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
freem
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Openai/6957d2e8-b738-8008-987a-09a5d9f29bc8
(section)
Add languages
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Assistant: They’re not required to cut — they’re just the “safe defaults” that make the output widely playable and keep the cut ac… === They’re not required to cut — they’re just the “safe defaults” that make the output widely playable and keep the cut accurate. Here’s what each one does, and what happens if you remove it: ===== Chooses the video encoder (H.264). ===== * If you don’t specify -c:v, ffmpeg will pick a default encoder for the output container (often still H.264, but not guaranteed). * You could also use -c:v copy to avoid re-encoding, but then your cut won’t be millisecond-accurate (it’ll snap to keyframes / packet boundaries). ===== Quality target for x264 (“constant quality” mode). Lower = higher quality/bigger file; higher = lower quality/smaller file. ===== * Not required; if omitted, x264 uses its default CRF (commonly 23), which is a bit lower quality. * Typical range: 18–23. ===== Encoding speed vs compression efficiency. ===== * Not required; x264 defaults to medium anyway. * Slower presets = smaller file for same quality (but take longer). ===== Re-encodes audio to AAC at 160 kbps. ===== * Not required; ffmpeg might pick AAC anyway, but again not guaranteed. * If your source audio is already AAC and you don’t need frame-accurate audio boundaries, you might do -c:a copy. But for “exact cuts”, re-encoding audio avoids weird edge cases (missing samples, bad timestamps, concat issues later). ===== Moves the MP4 “moov atom” to the beginning so the file can start playing before fully downloaded (web-friendly). ===== * Not required for local playback. * It doesn’t change quality, only file layout. ==== You said: separate clips + millisecond precision if needed. ==== To cut with ms precision reliably, you generally need to decode and re-encode (at least video), because -c copy can only cut cleanly on keyframes and packet boundaries. So the shortest “ms-accurate” version is basically: <syntaxhighlight lang="bash">ffmpeg -i input.mp4 -ss 00:01:02.000 -to 00:02:13.000 -c:v libx264 -c:a aac clip_01.mp4 </syntaxhighlight> Everything else (-crf, -preset, -b:a, +faststart) is tuning / compatibility / convenience. ==== This is still ms-accurate for video (because it re-encodes video), and keeps audio untouched: ==== <syntaxhighlight lang="bash">ffmpeg -i input.mp4 -ss 00:01:02.000 -to 00:02:13.000 -c:v libx264 -crf 20 -preset medium -c:a copy clip_01.mp4 </syntaxhighlight> Caveat: if you later concatenate clips, audio-copy can sometimes make concat pickier depending on timestamps/codec parameters. ==== <syntaxhighlight lang="bash">ffmpeg -ss 00:01:02.000 -to 00:02:13.000 -i input.mp4 -c copy clip_01.mp4 ==== </syntaxhighlight> Fast, no quality loss — but cuts may be off by up to a few seconds if keyframes are sparse. If you tell me whether your priority is (1) perfect accuracy or (2) no re-encode / perfect quality, I’ll give you the best exact command for that.
Summary:
Please note that all contributions to freem are considered to be released under the Creative Commons Attribution-ShareAlike 4.0 (see
Freem:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)