Commit Graph

184 Commits

Author SHA1 Message Date
1bd935646e Refactor motion path and snapping logic in VideoEditor
This commit enhances the VideoEditor class by refining the logic for drawing motion paths and checking line snapping between tracking points. It introduces a unified approach to handle both previous→next and previous→current lines, improving the clarity of the visual representation. Additionally, debug statements have been updated to provide better insights during the snapping process, ensuring accurate tracking point interactions. The display update method is also called to refresh the visual state after changes.
2025-09-17 15:44:55 +02:00
c3e0088a60 Refactor point-to-line distance calculation in VideoEditor
This commit refines the distance calculation method in the VideoEditor class by introducing a new function, _point_to_line_distance_and_foot, which computes the distance from a point to an infinite line and returns the foot of the perpendicular. The snapping logic has been updated to utilize this new method, enhancing the accuracy of line snapping between tracking points. Additionally, debug statements have been added to assist in tracking the snapping process and verifying point conversions.
2025-09-17 15:38:57 +02:00
68a1cc3e7d Enhance snapping functionality in VideoEditor to include line snapping
This commit improves the snapping feature in the VideoEditor class by adding the ability to snap new tracking points to the closest point on the line segment between consecutive tracking points, in addition to existing point snapping. The distance calculation logic has been refined, and the specification has been updated to reflect the new snapping behavior, which now operates within a 10px radius for both point and line snapping, enhancing the precision of motion tracking.
2025-09-17 15:12:35 +02:00
498a1911b1 Refactor constants to constants 2025-09-17 15:09:10 +02:00
d068da20f4 Remove some dead code 2025-09-17 15:08:42 +02:00
84a0748f0b Implement snapping functionality for tracking points in VideoEditor
This commit enhances the VideoEditor class by adding a snapping feature that allows users to snap new tracking points to existing points from any frame within a 50px radius. The logic first checks for the removal of existing points before determining if a new point should be added or if it should snap to a nearby point. The specification has been updated to reflect this new snapping behavior, improving the precision of motion tracking.
2025-09-17 15:05:12 +02:00
8c45b30bca Enhance VideoEditor with motion path visualization for tracking points
This commit updates the VideoEditor class to visualize the motion path between previous and next tracking points using yellow arrows. The rendering of tracking points has been modified, with previous points displayed as red circles and next points as magenta circles, both with white borders for better visibility. The specification has been updated to reflect these changes in the display of tracking points and their motion direction.
2025-09-17 14:34:26 +02:00
615a3dce0d Implement methods for retrieving previous and next tracking points in VideoEditor
This commit introduces two new methods, _get_previous_tracking_point and _get_next_tracking_point, to the VideoEditor class. These methods allow for the retrieval of tracking points from the previous and next frames that contain tracking data, enhancing navigation capabilities. The rendering logic has been updated to utilize these methods, ensuring that the previous (red) and next (green) tracking points are displayed correctly during video playback. Additionally, the specification has been updated to reflect these changes in the display of tracking points.
2025-09-17 14:29:11 +02:00
1ce05d33ba Add complete reset functionality to VideoEditor for all transformations
This commit introduces a new method, complete_reset, in the VideoEditor class, allowing users to reset all transformations and settings, including crop, zoom, rotation, brightness, contrast, and motion tracking. The method ensures a clean slate for editing by clearing the transformation cache and saving the state. Additionally, the specification has been updated to include this new functionality, enhancing user control over the editing environment.
2025-09-17 14:12:02 +02:00
1aea3b8a6e Update VideoEditor encoding settings for improved output quality
This commit modifies the encoding parameters in the VideoEditor class, changing the preset to 'veryslow' and adjusting the CRF value to 12 for enhanced video quality. Additionally, it introduces new parameters for profile and level settings, as well as x264 parameters for reference frames and B-frames, optimizing the encoding process for better performance and visual fidelity.
2025-09-17 13:55:13 +02:00
fbac3b0dbb Enhance VideoEditor mouse wheel functionality for zoom and frame seeking
This commit updates the mouse wheel event handling in the VideoEditor class to allow for zooming in and out with Ctrl+scroll, while enabling frame seeking with plain scroll. The specification has been updated to reflect the new mouse wheel behavior, improving user navigation and control during video editing.
2025-09-17 11:49:25 +02:00
b90b5e5725 Merge branch 'motion-track-01' 2025-09-17 11:42:15 +02:00
ed6f809029 Refactor marker navigation in VideoEditor to utilize tracking points
This commit enhances the VideoEditor class by updating the marker navigation methods to focus on tracking points instead of cut markers. The new methods, jump_to_previous_marker and jump_to_next_marker, now utilize a sorted list of frames with tracking points, improving navigation efficiency. Additionally, the documentation has been updated to reflect these changes, providing clearer instructions for users on how to navigate using tracking markers.
2025-09-17 11:41:45 +02:00
8a7e2609c5 Add marker navigation functionality to VideoEditor
This commit introduces keyboard controls for jumping to previous and next markers (cut start or end) in the VideoEditor class. The new functionality enhances user navigation during video editing, allowing for more efficient management of cut points. This addition improves the overall editing experience by providing quick access to key markers in the timeline.
2025-09-17 11:33:40 +02:00
dd1bc12667 Add exact frame seeking functionality to VideoEditor
This commit introduces a new method, seek_video_exact_frame, in the VideoEditor class, allowing users to seek video by exactly one frame, independent of the seek multiplier. The functionality is integrated with keyboard controls for navigating to the previous and next frames, enhancing precision in video editing. This addition improves user control and responsiveness during frame navigation.
2025-09-17 11:23:48 +02:00
9c14249f88 Update VideoEditor configuration for seek multiplier settings
This commit modifies the seek multiplier settings in the VideoEditor class, increasing the SEEK_MULTIPLIER_INCREMENT from 2.0 to 4.0 and expanding the MAX_SEEK_MULTIPLIER from 100.0 to 1000.0. These changes enhance the flexibility and responsiveness of the seeking functionality during video editing.
2025-09-17 11:18:35 +02:00
47ec7fed04 Enhance VideoEditor with previous and next frame tracking point visualization
This commit adds functionality to the VideoEditor class to render tracking points from the previous and next frames with 50% alpha blending. Red circles indicate previous frame points, while green circles represent next frame points, improving the visual feedback during video editing. Additionally, the feedback message duration has been reduced for a more responsive user experience.
2025-09-17 10:42:54 +02:00
e80278a2dd Refactor frame processing in VideoEditor to enhance cropping and rotation handling
This commit updates the frame processing logic in the VideoEditor class to apply rotation before cropping, ensuring accurate handling of frames in rotated space. It introduces effective cropping that accommodates out-of-bounds scenarios by padding with black, improving the visual output during editing. Additionally, debug statements have been refined to provide clearer information on output dimensions and effective crop details, enhancing the overall user experience in video editing.
2025-09-17 09:00:14 +02:00
f1d4145e43 Implement unified display parameters in VideoEditor for improved cropping and zoom handling
This commit introduces a new method, _get_display_params, in the VideoEditor class to centralize the calculation of display parameters, including effective crop dimensions, offsets, and scaling factors. The coordinate mapping methods have been updated to utilize these unified parameters, enhancing the accuracy of point mapping between original and screen coordinates during zoom and cropping operations. This refactor improves code readability and maintainability while ensuring a consistent user experience in video editing.
2025-09-17 08:06:52 +02:00
1d987a341a Refactor visibility calculations in VideoEditor to ensure proper cropping bounds
This commit updates the visibility width and height calculations in the VideoEditor class to use the minimum of the new dimensions and the window dimensions when cropping due to zoom. This change enhances the accuracy of the displayed area during zoom operations, ensuring that the canvas scaling is correctly applied and improving the overall user experience in video editing.
2025-09-17 01:56:16 +02:00
47ce52da37 Refactor coordinate mapping in VideoEditor to improve effective crop handling
This commit updates the coordinate mapping methods in the VideoEditor class to utilize the effective crop dimensions more accurately. It clarifies the calculations for mapping points between rotated frame coordinates and screen coordinates, ensuring consistent behavior during zoom and cropping operations. Additionally, comments have been refined for better understanding of the effective crop application, enhancing code readability and maintainability.
2025-09-17 01:54:04 +02:00
6c86271428 Refactor cropping logic in VideoEditor to utilize effective crop rectangle
This commit updates the cropping functionality in the VideoEditor class to use an effective crop rectangle derived from the current frame. It ensures that the crop is applied correctly within the bounds of the processed frame, enhancing the accuracy of cropping after rotation. Additionally, a visual outline of the effective crop is drawn on the canvas for debugging purposes, improving the user experience during video editing.
2025-09-17 01:51:56 +02:00
d0d2f66b11 Enhance effective crop rectangle calculation in VideoEditor for motion tracking
This commit updates the _get_effective_crop_rect_for_frame method to improve the calculation of the crop rectangle in rotated frame coordinates, incorporating tracking follow functionality. It ensures that the crop rectangle is accurately centered on the interpolated tracking position when motion tracking is enabled. Additionally, comments have been clarified to reflect the use of the effective crop, enhancing code readability and maintainability.
2025-09-17 01:48:49 +02:00
eeaeff6fe0 Enhance tracking point management in VideoEditor with rotated frame coordinates
This commit updates the VideoEditor class to store and manage tracking points in rotated frame coordinates, improving accuracy in overlay rendering and user interactions. It introduces a new method for mapping rotated coordinates to screen space and modifies existing methods to ensure consistent handling of coordinates throughout the editing process. These changes enhance the overall functionality and user experience when working with motion tracking in video editing.
2025-09-17 01:44:58 +02:00
d478b28e0d Refactor cropping and coordinate mapping in VideoEditor to support rotation
This commit modifies the cropping functionality to apply transformations in rotated frame coordinates, ensuring accurate cropping after rotation. It introduces a new method for mapping screen coordinates back to rotated frame coordinates, enhancing the overall cropping experience. Additionally, debug statements are added for better tracking of crop operations, improving the debugging process during development.
2025-09-17 01:42:08 +02:00
b440da3094 Refactor coordinate mapping in VideoEditor for improved zoom and rotation handling
This commit enhances the _map_original_to_screen and _map_screen_to_original methods by clarifying the calculations for zoom and rotation. It introduces new variables for better readability and ensures accurate mapping of coordinates, including adjustments for display offsets. The changes streamline the processing of frame dimensions and improve the overall functionality of the video editing experience.
2025-09-17 01:19:12 +02:00
fdf7d98850 Add motion tracking functionality to VideoEditor
This commit introduces motion tracking capabilities, allowing users to add and remove tracking points on video frames. The tracking state is managed with new attributes, and the crop functionality is enhanced to follow the tracked motion. Additionally, the user interface is updated to reflect the tracking status, and keyboard shortcuts are added for toggling tracking and clearing points. This feature improves the editing experience by enabling dynamic cropping based on motion analysis.
2025-09-17 01:14:26 +02:00
3ee5c1bddc Update spec 2025-09-17 00:18:40 +02:00
1d1d113a92 Refactor tracking point management in VideoEditor and MotionTracker to ensure accurate display coordinates
This commit modifies the handling of tracking points in the VideoEditor and MotionTracker classes by removing the storage of display coordinates. Instead, display coordinates are now calculated dynamically during rendering, ensuring accuracy regardless of crop or rotation states. The changes enhance the consistency of point transformations and improve logging for better debugging and verification of coordinate accuracy during mouse interactions.
2025-09-16 22:07:16 +02:00
e162e4fe92 Refactor tracking point management in VideoEditor and MotionTracker to ensure accurate display coordinates
This commit modifies the handling of tracking points in the VideoEditor and MotionTracker classes by removing the storage of display coordinates. Instead, display coordinates are now calculated dynamically during rendering, ensuring accuracy regardless of crop or rotation states. The changes enhance the consistency of point transformations and improve logging for better debugging and verification of coordinate accuracy during mouse interactions.
2025-09-16 21:34:17 +02:00
cd86cfc9f2 Enhance tracking point management in VideoEditor and MotionTracker with dual coordinate storage
This commit introduces a new TrackingPoint class to encapsulate both original and display coordinates for tracking points, improving the accuracy and consistency of point transformations. The VideoEditor class has been updated to utilize this new structure, allowing for better handling of tracking points during video editing. Additionally, logging has been enhanced to provide clearer insights into the addition and processing of tracking points, while redundant verification steps have been removed for efficiency. This change streamlines the tracking process and improves the overall user experience.
2025-09-16 21:33:28 +02:00
33a553c092 Refine VideoEditor point transformation methods with enhanced consistency and logging
This commit improves the point transformation and untransformation methods in the VideoEditor class by ensuring they match the applied transformations precisely. It adds checks for null points and current display frames, enhancing robustness. Additionally, detailed logging has been introduced to track coordinate adjustments during cropping and transformations, aiding in debugging and ensuring consistent behavior across the coordinate mapping process.
2025-09-16 20:58:54 +02:00
2979dca40a Refine VideoEditor point transformation and crop handling with enhanced logging
This commit improves the point transformation methods in the VideoEditor class by incorporating interpolated positions for cropping and refining the handling of coordinates during transformations. It adds detailed logging to track the adjustments made to crop centers and the verification of transformed points, ensuring better debugging and visibility into the state of the video editing process. Additionally, it enhances bounds checking for transformed points, maintaining consistency with the original frame dimensions.
2025-09-16 20:38:16 +02:00
cb097c55f1 Enhance VideoEditor with improved point transformation, bounds checking, and debugging features
This commit refines the point transformation methods in the VideoEditor class, ensuring coordinates are validated against frame dimensions and crop areas. It adds detailed logging for point transformations and mouse interactions, improving visibility into the state of tracking points. Additionally, it introduces debug features for visualizing crop rectangles and point indices, enhancing the debugging experience during video editing.
2025-09-16 20:32:33 +02:00
70364d0458 Update .gitignore and enhance VideoEditor with improved crop handling and logging
This commit adds a new entry to the .gitignore file to exclude log files. In the VideoEditor class, it refines the crop position adjustment logic to calculate the center of the crop rectangle before applying offsets, ensuring more accurate positioning. Additionally, it enhances logging throughout the point transformation and tracking processes, providing better insights into the state of tracking points and their visibility relative to the crop area.
2025-09-16 20:24:20 +02:00
c88c2cc354 Enhance VideoEditor and MotionTracker with improved logging and crop handling
This commit adds detailed logging to the VideoEditor and MotionTracker classes, providing insights into the transformations and adjustments made during point processing and cropping. It refines the crop position adjustment logic to ensure offsets are only applied when necessary and enhances the visibility of tracking points based on their position relative to the crop area. Additionally, it improves the handling of motion tracking toggling, ensuring a default crop rect is created when needed, thus enhancing the overall user experience during video editing.
2025-09-16 20:17:54 +02:00
9085a82bdd Enhance VideoEditor with improved point transformation and tracking logic
This commit refines the point transformation process in the VideoEditor class by ensuring coordinates are converted to floats and validating their positions relative to the crop area. It also updates the right-click event handling to accurately convert display coordinates to original frame coordinates, allowing for better interaction with tracking points. Additionally, the MotionTracker class is modified to set a default zoom center based on the crop rect if none is provided, improving the tracking functionality.
2025-09-16 20:04:34 +02:00
85891a5f99 Add motion tracking functionality to VideoEditor
This commit introduces a new MotionTracker class for handling motion tracking during video editing. The VideoEditor class has been updated to integrate motion tracking features, including adding and removing tracking points, interpolating positions, and applying tracking offsets during cropping. The user can toggle motion tracking and clear tracking points via keyboard shortcuts. Additionally, the state management has been enhanced to save and load motion tracking data, improving the overall editing experience.
2025-09-16 19:56:58 +02:00
66b23834fd Add spec file 2025-09-16 19:46:16 +02:00
5baa2572ea Add Cv2BufferedCap class for efficient video frame handling in VideoEditor
This commit introduces the Cv2BufferedCap class, which provides a buffered wrapper around cv2.VideoCapture. It implements frame caching with LRU eviction to optimize frame retrieval and reduce latency during video playback. The VideoEditor class has been updated to utilize this new class, enhancing performance and simplifying frame management. Unused frame cache methods have been removed to streamline the codebase.
2025-09-16 13:35:55 +02:00
c7c092d3f3 Implement frame caching in VideoEditor: add methods for managing frame cache with LRU eviction, improving playback performance by reducing frame retrieval time. Clear cache when switching videos to optimize memory usage. 2025-09-16 13:29:09 +02:00
f0d540be27 Add refresh_progress_data method in ProjectView and update VideoEditor to call it on state save. This ensures progress data is up-to-date when the editor state changes, enhancing user experience and project management. 2025-09-16 10:06:44 +02:00
c8dfcca954 Refactor thumbnail caching in ProjectView: store original thumbnails by video path instead of size, allowing for on-demand resizing. This change optimizes thumbnail generation and improves performance by reducing redundant processing. 2025-09-16 10:05:09 +02:00
b9cf9f0125 Update keyboard shortcuts in ProjectView: correct functionality for adjusting items per row, swapping the actions for 'Q' and 'Y' to improve user navigation and experience. Revise instructions to reflect these changes. 2025-09-16 10:04:00 +02:00
b8899004f3 Refactor ProjectView to improve thumbnail layout and item display: set default items per row to 2, implement dynamic thumbnail size calculation, and update keyboard shortcuts for adjusting items per row. Enhance thumbnail caching mechanism to optimize performance and maintain aspect ratio during resizing. 2025-09-16 10:02:53 +02:00
8c4663c4ef Remove unnecessary mouse interaction handling in VideoEditor when in project view mode, streamlining the mouse callback functionality. 2025-09-16 09:56:50 +02:00
9dd0c837b4 Update keyboard shortcuts in ProjectView: add 'q' for quitting and refine instructions for user navigation. Enhance VideoEditor to handle quit action, improving overall user experience. 2025-09-16 09:54:16 +02:00
c56b012246 Enhance ProjectView responsiveness: dynamically adjust canvas size and layout based on actual window dimensions, improving thumbnail placement and visibility. Update calculations for text positioning and item display to ensure consistent user experience across varying window sizes. 2025-09-16 09:48:11 +02:00
46f4441357 Improve thumbnail handling in ProjectView: add bounds checking for thumbnail placement on canvas and adjust resizing logic to prevent exceeding canvas dimensions. Update thumbnail size constraints for resizing operations to ensure minimum size limits. 2025-09-16 09:46:14 +02:00
d60828d787 Refactor thumbnail layout and navigation in ProjectView: dynamically calculate items per row based on window width and thumbnail size, and add keyboard shortcuts for resizing thumbnails. Update instructions to reflect new functionality. 2025-09-16 09:43:01 +02:00