ffmpeg-skill 3.7.0 → 3.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -269,7 +269,7 @@ These are the rules the skill file gives the agent and the code enforces.
269
269
  |---|---|
270
270
  | `export.py` | Presets `youtube`, `youtube4k`, `reels`, `tiktok`, `shorts`, `linkedin`, `facebook`, `x`, `youtube-hdr` (HEVC Main10, source HDR tags kept), `youtube-av1`, `prores`, `dnxhr-lb`/`sq`/`hq`/`hqx`/`444`, the alpha masters `prores4444`/`prores4444xq`/`qtrle`/`vp9-alpha`/`hap-alpha` (alpha read back), `key-fill` (a switcher's fill + key pair), `h265`, `gif`, `copy`, all tagged BT.709 unless they carry HDR or are an editing master (`prores`, `dnxhr-*`: the source's tags kept, codec, profile and pixel format read back) (a BT.601-matrix or RGB source is converted to BT.709, not relabelled); `--normalize` meets the platform's loudness in the same call (`render.py` turns it on by default for platform presets) ; `--max-mb MB` fits the file under a size limit by a two-pass encode and measures it ; `--preset copy --repair` remuxes a damaged file (timestamps regenerated, corrupt packets dropped) and counts the errors before and after |
271
271
  | `proxy.py` | Small, low-bitrate proxy for downstream AI analysis/preview/editing decisions — resize by `--width`/`--scale`, proxy-grade `--quality` (default 30), `--fps`, `--no-audio`; not a delivery preset |
272
- | `check.py` | PASS / WARN / FAIL against YouTube, Shorts, Reels, TikTok, X, LinkedIn, Facebook, broadcast and podcast specs, from the same delivery table the export presets and templates read (podcast also reports chapter markers and channel count), with the fix for each failure and a `format` / `judgement` kind per row; `--content` adds black-frame, frozen-frame, silence, short audio-dropout, single-frame-flash and flat-first-frame rows ; `--compare REF` measures SSIM/PSNR against a reference, and with `--expect-changed SPAN\|none` fails when the picture changed outside the spans the caller declared; `--levels bt709\|ebu-r103` counts the luma and chroma samples outside the broadcast legal range, per clip and per window, with min/max Y/U/V; `--expect-identity` checks that the file is the one a run reported writing (`output_identity`) |
272
+ | `check.py` | PASS / WARN / FAIL against YouTube, Shorts, Reels, TikTok, X, LinkedIn, Facebook, broadcast and podcast specs, from the same delivery table the export presets and templates read (podcast also reports chapter markers and channel count), with the fix for each failure and a `format` / `judgement` kind per row; a length or file size over the table's upload limit is a WARN marked `basis: guidance` (platforms change these, the uploader checks the current one), while `--max-duration` / `--max-mb` state the caller's own limit and FAIL when a `--platform` is named (with none, an over-length is WARN like every judgement row); `--content` adds black-frame, frozen-frame, silence, short audio-dropout, single-frame-flash and flat-first-frame rows ; `--compare REF` measures SSIM/PSNR against a reference, and with `--expect-changed SPAN\|none` fails when the picture changed outside the spans the caller declared; `--levels bt709\|ebu-r103` counts the luma and chroma samples outside the broadcast legal range, per clip and per window, with min/max Y/U/V; `--expect-identity` checks that the file is the one a run reported writing (`output_identity`) |
273
273
  | `report.py` | Single-file HTML delivery report: before/after sheets, media facts, loudness, compliance, the commands run; `--pack` renders a social pack table |
274
274
 
275
275
  **Orchestration**
package/SKILL.md CHANGED
@@ -34,6 +34,7 @@ Every step in full: `references/workflow.md`.
34
34
  A delivery request is one `render.py --template`; three or more steps: a `render.py` project.
35
35
  5. **Check** with `check.py OUTPUT --platform X --expect-identity S:M` (the writer's `output_identity`):
36
36
  fix format rows; fix duration, aspect, fps or loudness only when the request implies it. Mention WARNs.
37
+ A `basis: guidance` WARN (length, size) is the table's upload limit: the uploader checks the current one.
37
38
  6. **Verify** from the writer's `--json` probe or `probe.py`: exit 0 and the requested numbers, or it failed.
38
39
  7. **Keep originals:** never overwrite a source; `--overwrite` only for this job's files or ones the user
39
40
  asked to replace.
package/docs/contract.md CHANGED
@@ -21,7 +21,7 @@ The contract is derived from the code that runs, not maintained beside it:
21
21
  | Field | Meaning | Changes when |
22
22
  |---|---|---|
23
23
  | `contract_version` | shape of this document (`2.0`) | a key is renamed, removed or changes meaning |
24
- | `skill.version` | the npm / package.json version (`3.7.0`) | any release |
24
+ | `skill.version` | the npm / package.json version (`3.8.0`) | any release |
25
25
 
26
26
  A release that adds a tool or a flag keeps `contract_version`; a breaking change to the
27
27
  ToolSpec shape bumps it. Consumers pin on `contract_version` and read `skill.version`
@@ -149,7 +149,7 @@ JSON would have been rewritten for that. The flat keys, typed per tool in `outpu
149
149
  "deprecated": [],
150
150
  "removed": [{"what": "...", "since": "1.10.0", "replacement": "...", "removed_in": "2.0.0", "where": "cli | json | mcp | behaviour"},
151
151
  {"what": "running on FFmpeg 5.x (the requirements.ffmpeg floor)", "since": "2.14.0", "replacement": "FFmpeg 6.1 or later; ...", "removed_in": "3.0.0", "where": "behaviour"}],
152
- "skill": {"id": "ffmpeg-skill", "version": "3.7.0", "execution_mode": "local", "kind": "execution",
152
+ "skill": {"id": "ffmpeg-skill", "version": "3.8.0", "execution_mode": "local", "kind": "execution",
153
153
  "entrypoints": {"cli": "...", "mcp": "...", "contract": "...", "doctor": "..."},
154
154
  "not_provided": ["AI reasoning", "decisions", "production plans", "project IR", "approvals", "network access", "transcription engine"]},
155
155
  "requirements": {"python": ">=3.10 (standard library only)", "ffmpeg": ">=6.1", "ffprobe": ">=6.1"},
@@ -225,7 +225,14 @@ The workflow in `SKILL.md` is "probe first, verify last". The contract states it
225
225
  `requires_visual_verification` is `true` exactly for the tools that change the picture
226
226
  (fit, caption, overlay, graphics, color, join, multicam, render). Audio-only tools and
227
227
  audio-only inputs never need `look`; the report line is `Look: not needed`. `check`
228
- rows carry `kind: format` (fix it) or `kind: judgement` (decide with the user).
228
+ rows carry `kind: format` (fix it) or `kind: judgement` (decide with the user), and `basis`:
229
+ `requirement` (the row can FAIL) or `guidance`. The `duration` and `file size` rows are `basis: guidance`
230
+ when their limit is the platform table's upload limit (`scripts/_platforms.py`, dated
231
+ `UPLOAD_LIMITS_AS_OF`): over it, or not measurable against it, is WARN with a `reason` naming the
232
+ table's date, never FAIL, and does not make `check` exit non-zero. Platforms change upload limits
233
+ and whoever uploads checks the current one. A limit the caller states (`--max-duration`, `--max-mb`)
234
+ is the caller's requirement: `basis: requirement`, FAIL when over or not measured (with no `--platform`
235
+ named, `duration` is WARN as every judgement row is).
229
236
  The `audio` row FAILs (WARN when no loudness target applies) when the track is present but silent (peak at or below -50 dBFS, from
230
237
  the loudness pass or, when loudness is skipped, one volumedetect pass). `check --content`
231
238
  (opt-in; render.py `"check": {"content": true}`) adds `black`, `frozen` and `silence` rows
@@ -772,7 +779,7 @@ silence a tool reported as fine while another measurement disagreed):
772
779
 
773
780
  | key | tool | what it holds |
774
781
  |---|---|---|
775
- | `verification[]` step `duration` | `export.py` (a preset with a platform maximum, without `--allow-long`) | the written file's length against the maximum, measured as `check.py` measures it (the container's duration, `tolerance` 0). A length that cannot be read fails the step with `reason: not_measured` |
782
+ | `verification[]` step `duration` | `export.py` (a preset with a platform maximum, without `--allow-long`) | the written file's length against the maximum, measured as `check.py` measures it (the container's duration, `tolerance` 0). A length that cannot be read fails the step with `reason: not_measured`. The step verifies the trim `export.py` itself made; `check.py` reports the same table limit as guidance (WARN) |
776
783
  | `verification[]` step `duration` (`property: audio_duration`) | `loudness.py` | the output's sound against the input's, to one AAC frame (at least 0.03 s): a levels pass changes no timing. A length that cannot be read fails the step with `reason: not_measured` |
777
784
  | `inputs_duration`, `transition_shortening`; step `duration`'s `inputs_total` | `join.py` | the clips' own total and how much the transitions took out of it. `expected_duration` is derived from the transition the join applied, so it cannot show that on its own |
778
785
  | `frame_rate`, `clip_frames`, `transition_frames` | `join.py` (video join; added after 3.6.2) | the join's rate as an exact fraction (`"30000/1001"`), the whole frames of it each clip holds (its sound is cut to the samples those frames last), and the frames each transition overlaps (`--duration` rounded to whole frames, at least 1; `0` for `--transition none`). Lengths and xfade offsets are counted in these frames, never in rounded seconds (#455, #468); `inputs_duration` and `expected_duration` are derived from them. A pending `--dry-run` input counts 0 frames |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ffmpeg-skill",
3
- "version": "3.7.0",
3
+ "version": "3.8.0",
4
4
  "mcpName": "io.github.kajisho5/ffmpeg-skill",
5
5
  "description": "Agent Skill that gives coding agents (Claude Code, Cursor, Codex) a local video editor: 42 FFmpeg tools with a machine-readable contract, contract-derived MCP server, FFmpeg capability detection, probe-first / verify-last workflow. Cut, join, silence removal, fit, captions and karaoke, overlays, motion graphics, HDR to SDR, LUTs, audio clean-up and typed dynamics, sync with drift correction, multicam, loudness, delivery checks, project rendering, batch. No API keys, no cloud, no dependencies.",
6
6
  "keywords": [
@@ -58,8 +58,11 @@ Every row names the constant or flag it comes from, and a test holds the table t
58
58
  <!-- thresholds:end -->
59
59
 
60
60
  Delivery targets per platform (`scripts/_platforms.py`). A file passes loudness within the
61
- platform's tolerance of its target, and true peak at or below its ceiling plus 0.1 dB. `export.py`
62
- holds the written length to the maximum with no tolerance, as `check.py` does.
61
+ platform's tolerance of its target, and true peak at or below its ceiling plus 0.1 dB. The
62
+ maximum length (and the file size `check.py` reads from the same table) is an upload limit: the
63
+ table's as of `_platforms.UPLOAD_LIMITS_AS_OF`, guidance rather than a requirement, because
64
+ platforms change it and whoever uploads checks the current one. `check.py` WARNs over it;
65
+ `export.py` trims to it unless `--allow-long` and holds the written length to it with no tolerance.
63
66
 
64
67
  <!-- platforms:start -->
65
68
  | platform | loudness | tolerance | true peak | max duration |
@@ -1240,6 +1243,15 @@ step before reporting a deliverable; fix FAILs, mention WARNs. Without
1240
1243
  `--platform` the youtube spec is assumed and the judgement rows (duration,
1241
1244
  aspect, fps, resolution, loudness, true peak) come back as WARN with a `notes`
1242
1245
  line, not FAIL: name the platform when the file is a delivery for it.
1246
+ Every row carries `basis`: `requirement` or `guidance`. The `duration` and `file size` rows are
1247
+ `guidance` when the limit is the platform table's: a file over it (or whose length or size could
1248
+ not be measured) is WARN, not FAIL, with a `reason` that names the table's date
1249
+ (`_platforms.UPLOAD_LIMITS_AS_OF`), and it does not make the exit code non-zero by itself. Upload
1250
+ limits change often and belong to whoever uploads, who checks the platform's current one; the
1251
+ encoding rows (codec, aspect, resolution, fps, pixel format, colour, loudness, true peak) are
1252
+ unchanged. `--max-duration S` and `--max-mb N` state the caller's own limit, on any platform
1253
+ including `custom`: those rows are `requirement` and FAIL when over or not measured (with no
1254
+ `--platform` at all, `duration` is WARN like the other judgement rows).
1243
1255
  `--platform podcast` adds two informational rows: `channels` (PASS for mono or
1244
1256
  stereo, WARN above — podcast players downmix 5.1 unpredictably) and `chapters`
1245
1257
  (PASS when the container carries at least one marker, WARN `none` otherwise —
@@ -2189,7 +2201,8 @@ overhead) in place of its CRF, and the encode runs in two passes. The written si
2189
2201
  overshot. Refused for a preset that does not encode with x264 (and under `--hw`), with `--crf`,
2190
2202
  for a source with no duration, and when the budget leaves under 100 kb/s for the picture.
2191
2203
  Scales into the preset frame (pad by default), tags BT.709 (a BT.601-matrix or RGB source is converted to it, as by every re-encode), sets `+faststart`,
2192
- trims to platform maximums (Reels 90 s, X 140 s) unless `--allow-long`, and says
2204
+ trims to the table's platform maximums (Reels 90 s, X 140 s; the table's as of its date, and
2205
+ platforms change them) unless `--allow-long`, and says
2193
2206
  so: `trimmed: {from, to}` and a `notes` line. It
2194
2207
  does not touch levels: for youtube / youtube4k / reels / x the written file is
2195
2208
  measured and the result's `loudness` (and a `notes` line) says when it is
@@ -10,7 +10,7 @@ lines per step; every rule below still applies.
10
10
  2. **Prefer lossless.** If the request can be met without re-encoding (plain cuts on keyframes, remuxing, audio-only changes), do not re-encode. `cut.py` and `loudness.py` stream-copy video by default; `--accurate` on `cut.py` only for frame-exact cuts.
11
11
  3. **Plan with `--dry-run --json`, then execute.** Trust `--json`, not a dry run's summary line, for any number in the plan (a dimension there can be a placeholder). Use before long encodes, to report facts.
12
12
  4. **Chain in a sensible order.** A delivery request with no other editing is one template run (`render.py --template NAME INPUT`), not a hand-built chain. Otherwise: colour (HDR→SDR / LUT) → cut → join → silence → fit → caption/overlay → sync → audio → loudness → export. Frame changes before captions, so text is sized for the final frame. Re-encode as few times as possible: intermediates at CRF 18, `export.py` last. **Three or more steps: `render.py` with a project.json.**
13
- 5. **Check the deliverable.** Before reporting, run `check.py OUTPUT --platform X --expect-identity S:M` (the writer's `output_identity`; templates already check); never check after a failed write. Format rows (codec, pixel format, size, true peak, colour tags, VFR) are safe to fix. Judgement rows change content: duration (cut loses material), aspect (crop loses edges), fps (drops motion), loudness (ambience must not be boosted) — fix only when the request implies the answer, else state the choice and its cost. Mention WARNs.
13
+ 5. **Check the deliverable.** Before reporting, run `check.py OUTPUT --platform X --expect-identity S:M` (the writer's `output_identity`; templates already check); never check after a failed write. Format rows (codec, pixel format, size, true peak, colour tags, VFR) are safe to fix. Judgement rows change content: duration (cut loses material), aspect (crop loses edges), fps (drops motion), loudness (ambience must not be boosted) — fix only when the request implies the answer, else state the choice and its cost. Mention WARNs. A `duration` or `file size` WARN with `basis: guidance` is the table's upload limit, not a requirement: platforms change these, the uploader checks the current one.
14
14
  6. **Verify the output.** Confirm duration, resolution, fps and audio match the request, from the writing tool's `--json`/`--json-brief` probe or `probe.py`, and report those numbers ("final.mp4: 59.98 s, 1080x1920, 30 fps, AAC stereo"). A step is done only when the script exited 0 and the output probes as expected: a non-zero exit, a missing or empty file, or a probe that contradicts the request is a failure reported with the script's error message.
15
15
  7. **Keep the user's originals.** Never overwrite the source; write new files next to input or where asked. An existing output path is refused (`kind: input`); add `--overwrite` only for a file this job made or the user asked to replace.
16
16
  8. **Look at the picture.** Whenever the picture changed (captions, overlays, graphics, crop/pad, resize, colour, transitions, a `join.py` scaling a clip to the first clip's frame, `color.py --to-sdr`) run `look.py OUTPUT --tiles 3x2` (or `--at T` for one frame) and view the PNG (4x3 for whole-clip layout). Not finished until `Look:` names that PNG — a probe cannot see a caption on a face. Audio-only: `Look: not needed`. What to look for splits like `check.py`'s rows in step 5:
@@ -638,7 +638,7 @@ def output_schema(name: str, meta: Dict[str, Any], hw: bool = False) -> Dict[str
638
638
  "levels": {"type": "object", "description": "--levels only: {standard, reference, bit_depth, legal {y, c}: inclusive legal code ranges at the file's depth, window_seconds, frames, out_of_range_pct {y, u, v, chroma}: share of samples outside them (chroma: Cb and Cr samples together), brng_pct (signalstats BRNG: pixels with any component outside the fixed BT.601/709 nominal range), worst_frame {time, y_pct, chroma_pct}, min {y, u, v}, max {y, u, v}, windows: the same per --levels-window seconds ({start, end, ...})}"},
639
639
  "change_scope": {"type": "object", "description": "--expect-changed only, when the two files could be compared: {declared [{start, end, rect}], observed [{start, end, frames, rect [x, y, w, h], peak}]: every span with a tile above the floor, undeclared: the same for the tiles no declaration covers, declared_unchanged: declared spans in which nothing changed, floor, tile [columns, rows], frames, quiet_peak: the largest tile at or under the floor}. Times are this file's presentation times in seconds, rectangles are displayed pixels"},
640
640
  "notes": {"type": "array", "items": {"type": "string"}, "description": "present when no --platform was named (youtube was assumed and judgement rows are WARN), when --compare paired a different number of frames than the reference has, or when --expect-changed compared two files that are not encoded alike"},
641
- "checks": {"type": "array", "items": {"type": "object", "properties": {"check": {"type": "string", "description": "row name; --content adds black, frozen and silence; --compare adds similarity; --expect-changed adds change_scope; --levels adds legal levels; --expect-identity adds identity; audio FAILs when the track is present but silent (peak <= -50 dBFS). A value that could not be read is \"could not measure\", never a PASS: duration FAILs (WARN without a length limit) when the file states no length, and black, frozen and silence are then WARN rows; loudness is WARN for audio shorter than one 400 ms block; --tp without --lufs (custom) measures the true peak row"}, "status": {"enum": ["PASS", "WARN", "FAIL"]}, "value": {}, "expected": {}, "fix": {"type": "string"}, "kind": {"enum": ["format", "judgement"]}}}}}
641
+ "checks": {"type": "array", "items": {"type": "object", "properties": {"check": {"type": "string", "description": "row name; --content adds black, frozen and silence; --compare adds similarity; --expect-changed adds change_scope; --levels adds legal levels; --expect-identity adds identity; audio FAILs when the track is present but silent (peak <= -50 dBFS). A value that could not be read is \"could not measure\", never a PASS: duration FAILs under a --max-duration the caller stated (WARN under the platform table's limit or without one) when the file states no length, and black, frozen and silence are then WARN rows; loudness is WARN for audio shorter than one 400 ms block; --tp without --lufs (custom) measures the true peak row"}, "status": {"enum": ["PASS", "WARN", "FAIL"]}, "value": {}, "expected": {}, "fix": {"type": "string"}, "kind": {"enum": ["format", "judgement"]}, "basis": {"enum": ["requirement", "guidance"], "description": "where the expected value comes from. guidance: the duration and file size rows when their limit is the platform table's upload limit (scripts/_platforms.py, dated UPLOAD_LIMITS_AS_OF); such a row is PASS or WARN, never FAIL, is not counted in failed, and its reason says the uploader checks the platform's current limit. requirement: every other row, and the same two rows under --max-duration / --max-mb (the caller's own limit), which FAIL"}}}}}
642
642
  elif name == "caption":
643
643
  extra = {"transcription": {"type": "object", "description": "with --transcribe: {engine, model, language, routing (why auto chose it), detected_language when auto detected it}; when auto ran the English-only Parakeet model on English assumed, notes says so"},
644
644
  "caption": {"type": "object", "description": "cue layout: shifted / wrapped / rebalanced / split / extended / dropped counts, plus wrap ('phrase' or 'measured'), phrase_breaks (1.16), broken_inside_word -- atoms hard-sliced at the column edge because they did not fit alone even at the size floor (1.18.4) -- and overlong -- now residual: a single character alone wider than the column. Burn mode: cues_burned -- non-blank cues that overlap [0, duration] and are drawn -- and cues_outside -- non-blank cues wholly outside it (2.2.6); a burn with no visible cue is refused, kind input. --ass: ass_malformed -- Dialogue lines that could not be read and are not counted -- and with --offset ass_shifted / ass_unshifted -- lines moved, and lines whose timestamps could not be read, copied as they were (each count above 0 is also a diagnostics.warnings entry)"},
@@ -1820,7 +1820,9 @@ MCP_PROMPTS: List[Dict[str, Any]] = [
1820
1820
  "`check.py <output> --platform {platform}` before calling it done -- format rows (codec, pixel "
1821
1821
  "format, size, true peak, colour tags, VFR) are safe to fix; judgement rows (duration, aspect, "
1822
1822
  "fps, loudness) change content, so fix them only when the request implies the answer, otherwise "
1823
- "state the choice and its cost. Mention WARNs; do not chase them."),
1823
+ "state the choice and its cost. Mention WARNs; do not chase them. A duration or file size WARN with "
1824
+ "basis guidance is the table's upload limit, which platforms change: report it, the uploader "
1825
+ "checks the current one."),
1824
1826
  },
1825
1827
  {
1826
1828
  "name": "podcast", "description": "Turn an audio recording into a loudness-normalised podcast episode with chapters.",
@@ -2053,7 +2055,7 @@ def build(detect: bool = True) -> Dict[str, Any]:
2053
2055
  "verify_last": "run the tools named in each ToolSpec.verification after it wrote an artifact",
2054
2056
  "visual": "when requires_visual_verification is true, run ffmpeg-skill/look on the output and inspect the PNG",
2055
2057
  "audio_only": "audio-only inputs and audio-only tools never need ffmpeg-skill/look",
2056
- "check_rows": "ffmpeg-skill/check rows carry kind=format (fix) or kind=judgement (decide with the user)",
2058
+ "check_rows": "ffmpeg-skill/check rows carry kind=format (fix) or kind=judgement (decide with the user), and basis=requirement (can FAIL) or basis=guidance (the platform table's upload length/size limit: WARN at most, the uploader checks the current limit)",
2057
2059
  },
2058
2060
  "json_output": {
2059
2061
  "success": {"status": "completed", "exit_code": 0, "stdout": "one JSON document (output_schema)"},
@@ -12,7 +12,9 @@ the description bar. This module is the single table the delivery tools read:
12
12
  "fps": the frame rate a delivery is conformed to (None = leave alone),
13
13
  "spec": check.py's compliance row values (max_duration, aspects,
14
14
  min_height, fps_max, codecs, max_bytes, lufs, lufs_tol, tp,
15
- sdr_only) -- the keys check.py's SPECS has always had,
15
+ sdr_only) -- the keys check.py's SPECS has always had;
16
+ max_duration and max_bytes are upload limits, guidance as of
17
+ UPLOAD_LIMITS_AS_OF rather than a requirement (#485),
16
18
  "safe": the fraction of the frame each edge's UI covers
17
19
  (top/bottom/left/right, 0..1) -- nothing readable goes there,
18
20
  "caption": the caption defaults a template uses (size as a fraction of the
@@ -62,6 +64,20 @@ _CAP_WIDE = {"size": 0.0694, "position": "bottom", "box": False, "outline": 2, "
62
64
  # by up to that much, so a tighter rule fails a file on measurement noise.
63
65
  TP_TOLERANCE_DB = 0.1
64
66
 
67
+ # Upload limits are guidance (#485). A platform's maximum length and file size change often and
68
+ # differ by account; whoever uploads reads the current ones. The `max_duration` and `max_bytes`
69
+ # below are this table's as of the date here, the day the table as a whole was last decided --
70
+ # not a date each number was read from the platform. check.py reports a file over one of them as
71
+ # WARN with `basis: guidance`, never FAIL; the encoding values (codecs, aspects, fps, loudness,
72
+ # true peak) are the format a delivery is held to and stay requirements.
73
+ UPLOAD_LIMITS_AS_OF = "2026-10-30"
74
+
75
+
76
+ def upload_limit_note(platform: str) -> str:
77
+ """Why a row measured against this table's length or size limit is guidance, in one clause."""
78
+ return (f"the limit is this tool's table for {platform} as of {UPLOAD_LIMITS_AS_OF}; platforms change "
79
+ "upload limits, so whoever uploads checks the current one")
80
+
65
81
  PLATFORMS: Dict[str, Dict[str, Any]] = {
66
82
  "tiktok": {
67
83
  "title": "TikTok",
package/scripts/check.py CHANGED
@@ -3,7 +3,11 @@
3
3
 
4
4
  Checks duration, frame size / aspect, fps, codec, pixel format, colour tags,
5
5
  file size, integrated loudness and true peak against the chosen platform
6
- and prints a PASS/WARN/FAIL table. Exit code 1 when anything FAILs. Each
6
+ and prints a PASS/WARN/FAIL table. Exit code 1 when anything FAILs. A length
7
+ or file size over the platform table's limit is WARN (`basis: guidance`): upload
8
+ limits change and the uploader checks the current one; --max-duration / --max-mb
9
+ state the caller's own limit, which FAILs when a --platform is named (with none,
10
+ an over-length is WARN, as every judgement row is). Each
7
11
  row's `fix` is the command that resolves it; a few of the less obvious FAILs
8
12
  (video codec, pixel format, HDR colour, loudness) also carry a plain-language
9
13
  `reason` -- "QuickTime and iOS commonly reject video that isn't 8-bit 4:2:0",
@@ -43,7 +47,7 @@ import sys
43
47
  from fractions import Fraction
44
48
  from typing import Any, Dict, List, Optional, Tuple
45
49
 
46
- from _platforms import PLATFORMS, PLATFORM_CHOICES, TP_TOLERANCE_DB, spec_of, resolve as resolve_platform
50
+ from _platforms import PLATFORMS, PLATFORM_CHOICES, TP_TOLERANCE_DB, spec_of, upload_limit_note, resolve as resolve_platform
47
51
  from _common.probe import (CHANGE_FLOOR, CHANGE_GRID, change_mask_tiles, change_tiles, LEGAL_RANGE_CHOICES, measure_signal_range, COMPARE_SSIM_WARN, CONTENT_FLAT_STD, SILENT_PEAK_DBFS, compare_pictures, detect_content,
48
52
  detect_flashes, first_frame_stats, presentation_times, measured_level_dbfs)
49
53
  from _common.emit import file_identity
@@ -361,11 +365,11 @@ def main() -> int:
361
365
  ap = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
362
366
  ap.add_argument("input")
363
367
  ap.add_argument("--platform", choices=PLATFORM_CHOICES, default=None, help="delivery spec to check against (default: youtube, with judgement rows reported as WARN because no platform was named)")
364
- ap.add_argument("--max-duration", type=float, help="override max duration in seconds")
368
+ ap.add_argument("--max-duration", type=float, help="the caller's own maximum length in seconds: over it FAILs when a --platform is named, WARNs with none (the platform table's limit is guidance, WARN)")
365
369
  ap.add_argument("--aspect", help="override allowed aspect (e.g. 9:16 or 16:9,1:1)")
366
370
  ap.add_argument("--lufs", type=float, help="override loudness target")
367
371
  ap.add_argument("--tp", type=float, help="override true-peak ceiling")
368
- ap.add_argument("--max-mb", type=float, help="override max file size in MB")
372
+ ap.add_argument("--max-mb", type=float, help="the caller's own maximum file size in MB: over it FAILs (the platform table's limit is guidance, WARN)")
369
373
  ap.add_argument("--no-loudness", action="store_true", help="skip the loudness measurement (faster)")
370
374
  ap.add_argument("--content", action="store_true",
371
375
  help="also check the content (one decode pass, plus an audio-only and a video-only one): black, frozen, silence, dropouts, flashes and first frame rows")
@@ -448,6 +452,11 @@ def main() -> int:
448
452
 
449
453
  # first frame / flashes: a fade from black or a strobe can be the edit, so neither is a mechanical fix
450
454
  JUDGEMENT = {"duration", "aspect", "loudness", "true peak", "fps", "resolution", "first frame", "flashes"}
455
+ # #485: the rows whose limit is the platform table's upload limit rather than one the caller
456
+ # stated (--max-duration, --max-mb). Those are guidance: WARN at worst, never counted as failed.
457
+ guidance = {name for name, stated, limit in (("duration", args.max_duration, spec["max_duration"]),
458
+ ("file size", args.max_mb, spec["max_bytes"]))
459
+ if stated is None and limit}
451
460
 
452
461
  def row(name: str, status: str, value: Any, expect: Any, fix: str = "", reason: str = "") -> None:
453
462
  # "format" rows are safe to fix mechanically; "judgement" rows change the content
@@ -456,12 +465,19 @@ def main() -> int:
456
465
  # person would ask "so what?" about) is why it matters in plain terms, not the spec clause.
457
466
  if status == "FAIL" and not named and name in JUDGEMENT:
458
467
  status = "WARN"
468
+ # "basis" is where the expected value comes from: "requirement" (the delivery format, or a
469
+ # limit the caller stated) can FAIL; "guidance" (the table's upload limit) cannot.
470
+ basis = "guidance" if name in guidance else "requirement"
471
+ if basis == "guidance" and status != "PASS":
472
+ status = "WARN"
473
+ reason = (reason + "; " if reason else "") + upload_limit_note(args.platform)
459
474
  rows.append({"check": name, "status": status, "value": value, "expected": expect, "fix": fix,
460
475
  "reason": reason if status != "PASS" else "",
461
- "kind": "judgement" if name in JUDGEMENT else "format"})
476
+ "kind": "judgement" if name in JUDGEMENT else "format", "basis": basis})
462
477
 
463
478
  # A113: a length ffprobe did not report is not a length of 0 s that fits under every limit.
464
- # The row says it was not measured (FAIL under a length limit, WARN without one), and the
479
+ # The row says it was not measured (FAIL under a length limit the caller stated, WARN under the
480
+ # platform table's or without one), and the
465
481
  # --content rows that are shares of the running time say so too instead of disappearing.
466
482
  dur_read = meta.get("duration")
467
483
  dur = dur_read or 0.0
@@ -770,6 +786,8 @@ def main() -> int:
770
786
  line = f" {r['status']:4s} {r['check']:{width}s} {r['value']} (expected {r['expected']})"
771
787
  if r["status"] != "PASS" and r["kind"] == "judgement":
772
788
  line += " [judgement]"
789
+ if r["status"] != "PASS" and r["basis"] == "guidance":
790
+ line += " [guidance]"
773
791
  if r["status"] != "PASS" and r["reason"]:
774
792
  line += f" ({r['reason']})"
775
793
  if r["status"] != "PASS" and r["fix"]:
package/scripts/export.py CHANGED
@@ -55,7 +55,7 @@ from _common.runner import ffmpeg_encoders, guard_sidecar, remember_written, rep
55
55
  from _common.emit import file_identity
56
56
  from check import SPECS as PLATFORMS, measure_loudness
57
57
  from _common.probe import SILENT_PEAK_DBFS, shorter_than_a_loudness_block
58
- from _platforms import ALIASES as _ALIASES, PLATFORMS as PLATFORM_TABLE, TP_TOLERANCE_DB, resolve as resolve_platform
58
+ from _platforms import ALIASES as _ALIASES, PLATFORMS as PLATFORM_TABLE, TP_TOLERANCE_DB, UPLOAD_LIMITS_AS_OF, resolve as resolve_platform
59
59
  # Frame and duration limit come from the one platform table (scripts/_platforms.py) rather than
60
60
  # from a literal restated here: before 1.14 they were typed twice and the facebook preset had
61
61
  # already drifted (no duration cap against the table's 14400 s).
@@ -679,7 +679,8 @@ def main() -> int:
679
679
  # kept subtitle track is cut at the same point (a cue after it is not written)
680
680
  trimmed = {"from": round(float(meta["duration"]), 3), "to": round(float(p["max"]), 3)}
681
681
  note(f"trimmed from {trimmed['from']:.3f}s to the {args.preset} maximum of {p['max']:.0f}s "
682
- "(use --allow-long to keep full length)")
682
+ f"(this tool's table as of {UPLOAD_LIMITS_AS_OF}, and platforms change it: "
683
+ "use --allow-long to keep full length)")
683
684
  cmd += ["-t", f"{p['max']:.3f}"]
684
685
  damage_before = media_damage(args.input) if args.repair and not STATE.dry_run else None
685
686
  with tempfile.TemporaryDirectory(prefix="ffskill_2pass_") as passdir:
package/scripts/render.py CHANGED
@@ -393,6 +393,9 @@ def render_pack(names: List[str], args) -> int:
393
393
  "size_bytes": size, "duration": probe_doc.get("duration"),
394
394
  # a destination whose check did not run is "not checked", not "pass" (the class of A113)
395
395
  "check": ("pass" if chk.get("ok") else ("%d FAIL" % chk["failed"]) if chk.get("failed") else ("not checked" if ok else "failed")),
396
+ # #485: a destination over the table's upload limit passes its check with a
397
+ # WARN; the pack keeps which, so the row is not a bare "pass"
398
+ "guidance": guidance_warns(chk),
396
399
  "ok": bool(ok)})
397
400
  outputs.append(out)
398
401
  if not ok:
@@ -406,7 +409,8 @@ def render_pack(names: List[str], args) -> int:
406
409
  for r in rows:
407
410
  dur = f"{r['duration']:.2f} s" if r.get("duration") else "-"
408
411
  mb = f"{r['size_bytes'] / 1024 / 1024:.1f} MB" if r.get("size_bytes") else "-"
409
- lines.append(f"| {r['platform']} | {r['file']} | {mb} | {dur} | {r['check']} |")
412
+ verdict = r["check"] + (f" (upload-limit guidance: {'; '.join(r['guidance'])})" if r.get("guidance") else "")
413
+ lines.append(f"| {r['platform']} | {r['file']} | {mb} | {dur} | {verdict} |")
410
414
  lines += ["", f"{len(rows)} destinations from one edit ({os.path.basename(args.input)}).",
411
415
  "Rendered by ffmpeg-skill; `report.py --pack` turns this table into an HTML report."]
412
416
  if not STATE.dry_run:
@@ -1090,7 +1094,9 @@ def execute_plan(plan: Dict[str, Any], path: str) -> int:
1090
1094
  failed_rows = [r["check"] for r in (check_result or {}).get("checks", []) if r.get("status") == "FAIL"]
1091
1095
  info(f"plan done: {output}, but the {check_result.get('platform') or 'content'} check failed" + (f": {', '.join(failed_rows)}" if failed_rows else ""))
1092
1096
  else:
1093
- info(f"plan done: {output}")
1097
+ advised = guidance_warns(check_result)
1098
+ info(f"plan done: {output}" + (" — upload-limit guidance, the uploader checks the current limit: "
1099
+ + "; ".join(advised) if advised else ""))
1094
1100
  # the tool's own steps (export's loudness, ...) come in through absorb_stage() above, tagged
1095
1101
  # with `stage`, so `verified` is theirs and the check's together
1096
1102
  emit(output, plan=path, plan_sha256=digest, unbound_inputs=unbound, tool=tool, stages=[tool] + (["check"] if check_result else []), check=check_result, tool_result=doc,
@@ -1188,6 +1194,14 @@ def _has_sound(current: str, proj: Dict[str, Any], rel: Any) -> bool:
1188
1194
  return False
1189
1195
 
1190
1196
 
1197
+ def guidance_warns(check_doc: Optional[Dict[str, Any]]) -> List[str]:
1198
+ """The rows of a check result that are over the platform table's upload limit (#485): WARN,
1199
+ `basis: guidance`. The check passes with them, so each place that says a check passed names
1200
+ them, with the limit, for whoever uploads to compare with the platform's current one."""
1201
+ return [f"{r['check']}={r['value']} (expected {r['expected']})" for r in (check_doc or {}).get("checks", [])
1202
+ if r.get("basis") == "guidance" and r.get("status") == "WARN"]
1203
+
1204
+
1191
1205
  def planned_clip_length(clip: Dict[str, Any], src: str, index: int) -> float:
1192
1206
  """A dry run's length of clip `index` before its speed stage: the source's measured length,
1193
1207
  or its in..out range of it (the cut a real run measures does not exist yet). Only when neither
@@ -1820,7 +1834,10 @@ def main() -> int:
1820
1834
  info(f"check: could not run check.py — {err.get('message') if isinstance(err, dict) else err}")
1821
1835
  exit_code = 1
1822
1836
  else:
1823
- info(f"check: OK for {check_label}")
1837
+ # #485: over the table's upload limit is a WARN the check passes with; say it here too
1838
+ advised = guidance_warns(check_result)
1839
+ info(f"check: OK for {check_label}" + (" — upload-limit guidance, the uploader checks the current limit: "
1840
+ + "; ".join(advised) if advised else ""))
1824
1841
  stages_done.append("check")
1825
1842
  elif "check" in proj:
1826
1843
  record_skip('the check stage names neither "platform" nor "content": true, so nothing was checked',