tsh: split large desktop recordings into multiple files#33784
Conversation
31ab6c3 to
4ee8ead
Compare
4ee8ead to
b150775
Compare
| // writeMovie writes the events for the specified session into one or more movie files | ||
| // beginning with the specified prefix. It returns the number of frames that were written and an error. | ||
| func writeMovie(ctx context.Context, ss events.SessionStreamer, sid session.ID, prefix string, | ||
| write func(format string, args ...any) (int, error)) (frames int, err error) { |
There was a problem hiding this comment.
Why we can't just use our logger ?
There was a problem hiding this comment.
Because loggers do not output user-friendly output. They are for devs for troubleshooting, not for end users.
| // so we indicate to the user when we wrote something | ||
| if frames > 0 { | ||
| fmt.Printf("wrote recording to %v\n", fname) | ||
| _, err = writeMovie(cf.Context, authClient, session.ID(cf.SessionID), filenamePrefix, fmt.Printf) |
There was a problem hiding this comment.
Either here or within the function we should write out that we are starting the writing of recordings.
As it takes time to keep writing more files I would append the "wrote uuid.avi" with
Starting recording export
wrote uuid.avi
Continuing export to next file.
...Otherwise you could think there is a error since it output that it wrote the file but doesn't tell you it's continuing.
There was a problem hiding this comment.
At some point I'd like to add a progress bar - that's a larger change though.
Until then, I think I prefer being less noisy.
|
Exporting large and small recordings looking good. Nice that you get the progress as it goes so someone could start reviewing the audit as they get it. Gave some feedback on enhancing the output so the user knows the output is starting and continuing. |
|
@gabrielcorado PTAL |
gabrielcorado
left a comment
There was a problem hiding this comment.
LGTM. Sorry for the delay.
|
The PR changelog entry failed validation: Changelog entry not found in the PR body. Please add a "no-changelog" label to the PR, or changelog lines starting with |
AVI files contain 32-bit pointers, which means we cant just add frames to a single file until the end of time. This change properly detects when a recording export has reached the maximum size of an AVI file and splits the recording into multiple files.
changelog: Split large desktop recordings into multiple files during export.
Closes #33109
Closes #33110