Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| computers:ffmpeg [2024/09/14 03:25] – [Joining video files together (Concatenate)] jon | computers:ffmpeg [2025/12/15 16:40] (current) – jon | ||
|---|---|---|---|
| Line 98: | Line 98: | ||
| Example using Powershell: | Example using Powershell: | ||
| < | < | ||
| + | |||
| + | === Caveats to cropping === | ||
| + | |||
| + | When you do cut with -c copy (no re-encode), and the cut point is not exactly on a keyframe, and/or the video uses B-frames (re-ordered frames), ffmpeg can’t rewrite frames to make a clean boundary. It copies packets but the decode/ | ||
| + | |||
| + | Players often still play linearly, but seeking near the splice can fail hard (especially around the crop point). mp4 is particularly sensitive because it stores timing/ | ||
| + | |||
| + | Workaround is to use a copy-cut and regenerate timestamps | ||
| + | |||
| + | < | ||
| + | -map 0 -c copy \ | ||
| + | -fflags +genpts -avoid_negative_ts make_zero \ | ||
| + | croppedvid.mp4</ | ||
| + | |||
| + | Then, "remux normalize" | ||
| + | |||
| + | < | ||
| + | ffmpeg -i croppedvid.mp4 -map 0 -c copy -movflags +faststart fixed1.mp4 | ||
| + | </ | ||
| + | |||
| ==== Joining video files together (Concatenate) ==== | ==== Joining video files together (Concatenate) ==== | ||
| Line 117: | Line 137: | ||
| Then, reference the text file as your input. | Then, reference the text file as your input. | ||
| < | < | ||
| - | ffmpeg -f concat -i concat.txt -c copy output.mp4 | + | ffmpeg -f concat |
| </ | </ | ||
| + | |||
| ==== Splitting a large video into smaller clips ==== | ==== Splitting a large video into smaller clips ==== | ||
| https:// | https:// | ||