This commit introduces the VideoEditor class in editor.py, encapsulating various video editing features such as playback control, cropping, zooming, and motion tracking. The class manages video file handling, state saving/loading, and user interactions, providing a comprehensive interface for video editing. Additionally, it includes configuration constants for timeline and progress bar settings, improving the overall user experience and maintainability of the codebase.
This commit simplifies the main.py file by removing the Cv2BufferedCap, MotionTracker, and ProjectView classes, which have been relocated to their respective modules. The import statements have been updated accordingly to enhance clarity and maintainability of the codebase.
This commit introduces two new methods, transform_video_to_screen and transform_screen_to_video, to handle the conversion between video and screen coordinates, accounting for crop, rotation, and zoom transformations. Additionally, the existing transform_point_for_display method is updated to utilize the new transformation logic, enhancing the accuracy of point display during video editing. These changes improve the overall functionality and user experience in the VideoEditor.
This commit updates the crop functionality to include motion tracking offsets when applying crop adjustments. It ensures that the crop center aligns with tracked positions if motion tracking is enabled, improving the accuracy of cropping during video editing. This enhancement builds on previous updates to motion tracking and crop handling, further refining the user experience.
This commit updates the _process_frame_for_render method to include frame number handling for motion tracking. It allows the crop center to adjust dynamically based on tracked positions, improving the accuracy of cropping during video rendering. Additionally, debug statements have been added to provide insights into the motion tracking status and the positions of tracked points, enhancing the debugging experience for developers.
This commit modifies the key bindings for toggling motion tracking and clearing tracking points in the VideoEditor. The keys 't' and 'T' have been changed to 'v' and 'V' respectively, improving consistency in user interactions. This update enhances the overall usability of the motion tracking features during video editing.
This commit simplifies the calculation of display dimensions by utilizing the transformed display frame directly, eliminating redundant width and height calculations based on rotation and crop. It enhances the overall efficiency of the display handling process, ensuring accurate scaling and improved performance during video editing.
This commit enhances the motion tracking logic by refining how the crop center is adjusted based on tracked points. It introduces a new method, transform_point_for_display, which applies cropping, rotation, and zoom transformations to video coordinates for accurate screen positioning. Additionally, it removes redundant motion tracking offset calculations, streamlining the overall crop and display handling process, thereby improving the user experience during video editing.
This commit updates the crop functionality to incorporate motion tracking offsets, ensuring that the crop center aligns with tracked points when motion tracking is enabled. It also refines the handling of crop adjustments and display offsets, improving the overall user experience during video editing. Additionally, the key mappings for expanding crop dimensions have been corrected for clarity in user interactions.
This commit simplifies the crop application process by removing unnecessary motion tracking offset calculations in certain areas. It enhances the distance calculation for tracking point removal by switching from screen to video coordinates, improving reliability. Additionally, it updates the HJKL key mapping to ensure visual directions correspond correctly to the current video rotation, enhancing user interaction during editing.
This commit updates the MotionTracker class to improve the offset calculation for centering crops on tracked points. It modifies the user interaction for adding and removing tracking points, allowing for nearby points to be removed with a right-click. Additionally, it introduces a method to map HJKL keys to directions based on the current rotation, enhancing the crop adjustment experience. The VideoEditor class has been updated to apply these changes, ensuring a more intuitive and responsive editing workflow.
This commit introduces the MotionTracker class, which manages motion tracking points for crop and pan operations. It allows users to add, remove, and clear tracking points, as well as interpolate positions based on these points. The VideoEditor class has been updated to integrate motion tracking functionality, including user interactions for adding tracking points and toggling tracking on and off. Additionally, the display now reflects motion tracking status and visualizes tracking points on the canvas, improving the editing experience.
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.