Repository navigation
feat(clip): marked frames in Cut a clip, with a note, the time under each picture and a PDF or PNG export - #1775
lightscape-jm wants to merge 5 commits into
Conversation
… export Closes KnifeLemon#1205 (step 3). A video's marked frames are listed in Cut a clip beside Mark this frame, with how many, ticks on both timelines, each frame's picture, time, number and note, and a remove button that moves the copy to the Recycle Bin / Trash. In Annotate, a bar under the tools shows a frame's time and number and takes an optional note; a frame can be saved with only a note. Export N frames... writes one PDF, a page per frame, or a folder of PNGs, next to the video, with the time, number and note under each picture. A marked copy carries its frame's facts as one PNG text (Filee:Frame, ASCII JSON): the video's name, length and size, the frame's time and number, and the note. The list finds copies by that text, where Annotate's output rules put a frame and in the folders copies were saved to (marked-frames.json). Marking a frame again replaces its earlier copy. The frame number counts from 0 as FFmpeg's n, from packet times without decoding (edit-list MP4 and MOV cuts included), or by decoding where packets have no display time. The PDF draws the text as glyph outlines under the unchanged picture, frames wider than 1920 px as JPEG; its saves write Gregorian dates whatever the regional calendar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
FrameExportJobTests sets the process's default regional format (Saudi, Thai, Iranian) so the job queue's threads see it; calendar and GPS-time tests running beside it read their dates in the Umm al-Qura or Persian calendar (upstream CI on KnifeLemon#1775). The class now runs in a collection with parallelization off, as ExifToolMemoryTests does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The three failing Also, the two test points the description left open:
|
KnifeLemon
left a comment
There was a problem hiding this comment.
Thanks, @lightscape-jm, and for the follow-up on the CI failures. Running FrameExportJobTests in a collection of its own is the right fix, and CI is now green on every platform, macOS included.
I've read through the Core, Engines and App changes. Two things so far:
- The calendar fix reaches further than the description says.
SaveDatedis now used inMerge, in picture → PDF and inPdfFinishing.Finish. So every merged PDF, every picture → PDF and every PDF that gets page numbers, a watermark or a password is saved with Gregorian dates, not only the export's. That's a good change; please say so in the description. The remainingSavecalls still use the thread's calendar:PdfPageTools,PdfSheets,PdfBlankPages,PdfPrintableAnnotations, and inPdfSharpConverterthe split/extract, metadata removal and compression paths. Could you open the separate issue you mention and list them there? - The note stays in the copy when metadata is removed. You list this under "On purpose". The copy also carries the video's file name and size. I'd like to think that one over before merging, and I'll come back to it here.
|
@lightscape-jm, here's the answer to point 2 (sorry it took this long):
With that and point 1 (the description, plus the separate issue for the remaining |
…its video KnifeLemon's decision on KnifeLemon#1775 (2 Dec): the note stays in a marked copy, the video's name and size go when Annotate removes metadata. Such a copy now carries the frame's time, number and note, and in place of the video's name, length and size a one-way key made from them (the first 16 bytes of their SHA-256), which is what Cut a clip's list needs to match the copy to its video. Copies that keep metadata are written as before, and earlier copies still match by name. The PDF export takes the video's name for the page footer from the export (ImageOptions.FrameVideo), not from the copy, so it shows on pages made from either kind. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
@KnifeLemon, both points are done in 85dc099: 1. The calendar fix and the remaining saves. The description now says the shared 2. The note and the video's name and size. When Annotate is set to remove metadata, a marked copy now keeps its Tests: a copy written with metadata removal on holds the note and none of the video's name, length or size (its raw The description has the line "a marked copy carries its note as PNG text" under On purpose. For the CHANGELOG I've left |
Resolves ImageEncoder.cs (comment), PdfSharpConverter.cs (IsLossyPhoto next to JpegAboveQuality) and the gallery left-out list (media.dvd), and adds the CHANGELOG lines for marked frames. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
KnifeLemon
left a comment
There was a problem hiding this comment.
Thanks @lightscape-jm, the metadata-removal change is exactly what we discussed: the note stays, the video's name, length and size give way to a one-way key, and the PDF takes the name from the video it's run on. Thanks also for #1972. I merged main into the branch (conflicts in ImageEncoder.cs, PdfSharpConverter.cs and the gallery left-out list) and added the CHANGELOG lines, including "a marked copy carries its note as PNG text". It will be merged once CI is green.
The gallery's version check counts fields added since 2.5.0; image.frame, image.frameCaption, image.frameVideo and pdf.jpegAboveWidth were missing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I pushed one more small fix (ce6129a): the gallery's version check needs every field added since 2.5.0 listed in |
What does this change?
Closes #1205: step 3 of the three agreed there, the list, note field, time strip and export. A video's marked
frames are listed in Cut a clip, each can carry a note, and they go out as one PDF or a folder of PNGs with the time,
the frame number and the note under each picture.
For the user
number (
2:04.700 · frame 3,741) and takes an optional note; Enter saves. A frame can be saved with only a note, orwith nothing drawn. Marking a frame again brings back the note saved with it.
time order: the picture as marked, the time and number, the note, and a ✕ that moves that copy to the Recycle Bin /
Trash. A row moves the playhead to its frame. Ticks on both timelines show where they are.
picture, and runs as an ordinary job (toast, cancel, history). Both go next to the video:
Site walk frames.pdf,or the folder
Site walk frames. A name already taken, the folder's too, gets " (2)", and the card shows the namethe export will get.
How it works
Filee:Frame: the video's filename, length and size, the frame's time as the playhead had it (shown and compared to the millisecond), its number,
and the note, as JSON with every letter
outside ASCII escaped (Magick.NET reads a long compressed iTXt back as nothing). It is written after any metadata is
dropped, and taken off any other picture made from a copy through the image step, so a resized copy isn't taken for
one. When Annotate is set to remove metadata, the video's name, length and size are left out: the copy carries
only a one-way key made from them (the first 16 bytes of their SHA-256), which is enough for the list to match the
copy to its video and can't be read back to a name.
output rules (with Settings › General's default folder) give a frame saved alone, and in the last 500 folders copies
of it were saved to (
marked-frames.jsonbeside the settings). Only the text chunks before the picture data areread. Online-only cloud files aren't opened (Windows' recall attributes; on macOS, the file's dataless flag). A
video of the same name but another length or size never shares a list. A remembered folder on a drive that is away
is kept for when it is back.
ncounts, soselect=eq(n\,3741)finds the same frame. It iscounted from the packets' display times without decoding, from the key frame decoding starts at: packets before it
aren't shown (a recording joined mid-stream), nor is an MP4 or MOV cut's lead-in, which FFmpeg decodes from but
drops (its edit list), nor an open group's leading pictures after a cut. Where packets have no display time (DVD VOB,
MPEG-1, AVI) the frames FFmpeg shows are counted by decoding up to the time. The save waits for it. When it can't be
counted, the frame has its time only.
frame goes to the Recycle Bin / Trash (with the Overwrite rule, the new copy takes its place). A copy written after
the new one (the same frame saved twice in a row) is left alone, as is a file of one's own made from it (renamed,
compressed).
Core/Presets/FrameExport).page turned to its picture, pages numbered. Each page draws the time and number (bold) and the note (regular)
under the picture as glyph outlines, at a fixed size on paper (11 and 10 pt), and the video's name at the foot
(
Engines/Pdf/FramePage). No font is embedded; a colour emoji goes in as a small picture. Frames wider than1920 px go in as JPEG at quality 92 (
PdfOptions.JpegAboveWidth), smaller ones lossless.(
ImageOptions.FrameCaption).reads right to left), wrapping the time and number too on a narrow frame.
regional format uses another calendar, the PDF's year was that calendar's (2569 under Thailand's, 1405 under Iran's),
and under Saudi Arabia's the page-numbering step then failed outright. The export's saves now write Gregorian dates
(
PdfSharpConverter.SaveDated). The helper is shared, so this reaches further than the export: every merged PDF,every picture → PDF, and every PDF that gets page numbers, a watermark or a password (
PdfFinishing.Finish) is nowsaved with Gregorian dates too. The other PDF tools still save with the regional calendar: [Bug]: PDF tools write the regional calendar's year as the PDF's date, and fail in Saudi Arabia and Iran #1972 lists them.
On purpose.
2 / 3) with the video's name beside it.needs it. A copy sent on its own still holds the note, unseen in the picture. With metadata removal on, the video's
name, length and size are not in it (the key above only).
Filee:Frametext instead of several keys (the reasonabove); the time and number in the PDF at a fixed size on paper rather than scaled to the picture.
Limits, with the worst case found.
10-minute 720p MPEG-4 AVI, measured in review on a heavily loaded Mac. Past ffprobe's 30 s limit the frame has its
time only. While it is counted the save waits, with Annotate already on to the next picture; Filee quitting in that
time drops that save. Files with display times read packets only: 0.7 s (MP4, MKV) and 1.4 s (TS) near the end of a
1.4 GB hour-long file, 1.6 to 2.2 s near the end of a 3-hour one (warm cache, measured in review; ffprobe reads the
packets' bytes, so a large file on a slow disk takes longer).
size).
both are kept and the list shows one of them; marking it again replaces both.
Not in this PR. DOCX or HWPX export, and selectable PDF text (#1205: "not in this round", "outlines first").
Type of change
How was it tested?
dotnet format --verify-no-changes --severity warndotnet test, all suites, on this branch rebased onmainat 79f03be (22 Nov):22 skipped. The failures also fail on unmodified
mainon this Mac (its Homebrew FFmpeg's codecs, the ISO/UDF andarchive-to-ISO tests, the memory-limit test, two App renders, the installer tests that run only on Windows), except
three LibreOffice and GIMP tests that timed out under load and passed three runs out of three alone.
also fails on unmodified
mainthere. Engines: 4,078 passed, 332 skipped, and its 10 failures also fail onunmodified
mainat 79f03be in the same VM. (A first run's test process crashed partway, in tests this PRdoesn't touch; run again, neither this branch nor
maincrashed.)dotnet/sdk:10.0-noble, arm64, as root): App 3,368 passed; the twoUpdateServiceTeststhatfail also fail on unmodified
mainat 79f03be in the same container. The frame-number tests passed with Filee'sFFmpeg (166). Engines, run on its own: 4,035 passed, 362 skipped, 23 failed, against 20 on unmodified
mainat79f03be in the same container (on the earlier base, the extra failures were timing tests that passed run alone).
7, 6 and 5 after each round of review fixes, and 9 for the 2 Dec change; the dataless-file check is the one that
can't be, since only a cloud provider can mark a file so).
8 B-frames), files cut or trimmed mid-stream (VOB, TS, and MP4 and MOV cuts with an edit list) and packets with
only a decode time (MPEG-1, AVI, AVI with frames left out); at five frames each of 14 test videos in 6 containers;
an hour of video, past the end and without video. The frame text round-tripping in any script and length, with
metadata kept or dropped, replaced whole, and removed from a picture made from a copy. The PNG strip below the
picture, wrapped, right-aligned for right-to-left text, the time and number wrapped on a 128 and 176 px frame, the
note regular. A PDF page rendered and read back: the picture as it is, the time, number and note drawn under it as
outlines with no font embedded; the JPEG rule and quality through the export's own preset. The export through the
real job queue: one PDF, PNGs with strips, a taken name, a read-only folder, and the PDF written and dated under
the Saudi, Thai and Iranian regional formats.
saved copy joining at once, a row moving the playhead to its frame, ✕ to the Trash or saying why not, a click
elsewhere closing it, the last video's list gone as soon as the next opens, no row left without its picture after
a reload; the list and export card taking the keyboard and giving it back (Tab staying in the card, Enter on a
choice exporting); the export's job, its count, the name it will get and the remembered choice. The list looking
where a frame saved alone goes, keeping a folder on a drive that is away, a video named with a dot; marking again
replacing only an earlier copy of that video's frame, never a later one. Annotate's bar under the tools, saving
with only a note, Enter in the note saving, a note per frame, the earlier note offered while the number is still
counted, the 300-character limit, typing picking no tool, nothing at the foot covering the picture.
the windows' smallest size, and in English, Japanese and Arabic dark at the usual size; each text checked whole
and inside the window.
Screenshots (UI changes)
The pictures above, from this branch's renders and its export. Every language's window is in the render tests'
screenshots (
clip-marked-*.png,annotate-frame-*.png).Checklist
src/Filee.App/Assets/i18n/*.jsonfiles (14 new)THIRD-PARTY-NOTICES.md(none added)🤖 Generated with Claude Code