Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VideoExport sample #101

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

VideoExport sample #101

wants to merge 3 commits into from

Conversation

alafleur-genetec
Copy link
Member

Updated copyright and licensing information in Program.cs to 2024 and Apache License, Version 2.0. Refactored Program.cs:

  • Moved SdkResolver.Initialize() out of the constructor.
  • Simplified Main method to call new RunSample method.
  • RunSample now handles engine connection, camera retrieval, and video export.
  • Refactored Export method with modern C# features, better error handling, progress reporting, and cancellation support.
  • Export method initializes MediaExporter and sets export format to G64X.
  • Configured export settings using CameraExportConfig.

Removed ExportOption.cs, G64ConverterBaseExtensions.cs, VideoExport.cs, and VideoExportFormat.cs.

Updated copyright and licensing information in `Program.cs` to 2024 and Apache License, Version 2.0. Refactored `Program.cs`:
- Moved `SdkResolver.Initialize()` out of the constructor.
- Simplified `Main` method to call new `RunSample` method.
- `RunSample` now handles engine connection, camera retrieval, and video export.
- Refactored `Export` method with modern C# features, better error handling, progress reporting, and cancellation support.
- `Export` method initializes `MediaExporter` and sets export format to `G64X`.
- Configured export settings using `CameraExportConfig`.

Removed `ExportOption.cs`, `G64ConverterBaseExtensions.cs`, `VideoExport.cs`, and `VideoExportFormat.cs`.
- Replace `as` operator with pattern matching `is not` operator
- Add `CancellationTokenSource` for export cancellation
- Subscribe to `Console.CancelKeyPress` for Ctrl+C cancellation
- Add `try-catch` for `OperationCanceledException` feedback
- Update `Export` method to use named parameters
- Add comments explaining code blocks and export configuration
Updated the export progress display to overwrite the same line in the console for smoother visual updates. Added a new console message to inform the user about the time range of the video being exported. Modified the completion message to start on a new line for better readability.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant