OpenShot / openshot-qt

OpenShot Video Editor is an award-winning free and open-source video editor for Linux, Mac, and Windows, and is dedicated to delivering high quality video editing and animation solutions to the world.
http://www.openshot.org
Other
4.33k stars 540 forks source link

Drag-and-drop Image Sequence import issues under MacOS #3782

Closed ferdnyc closed 3 years ago

ferdnyc commented 4 years ago

@ferdnyc I downloaded and installed OpenShot-v2.5.1-dev2-1603218028-07a447c9-78db4b94-x86_64.dmg (October 20, 2020) on my MacBook Pro laptop. I tested the import folder function by dragging-and-dropping the Media Test Files folder to the Project List.

Now, I can drag-and-drop single and multiple images, audio and video but not image sequences. When I drag-and-drop an image sequence, I am prompted whether or not I want to import the file as a sequence, which I answer yes. However, I cannot use the mouse to do so, I have to use the keyboard to tab to the Yes button then press Return.

When I use the File Import dialog the image sequence imports to the Project Files list and I can preview the Snow%04d.png file using the right-click menu. When I add the image sequence to the timeline then press play under the Preview window, OpenShot either freezes at frame 13 or crashes. If OpenShot freezes, I have to Force Quit the application.

Windows and Linux tested successfully without issues.

Originally posted by @USATechDude in https://github.com/OpenShot/openshot-qt/issues/3492#issuecomment-713127089

ferdnyc commented 4 years ago

@USATechDude

Now, I can drag-and-drop single and multiple images, audio and video but not image sequences. When I drag-and-drop an image sequence, I am prompted whether or not I want to import the file as a sequence, which I answer yes. However, I cannot use the mouse to do so, I have to use the keyboard to tab to the Yes button then press Return.

Hmm. I think I might know what's going on there, though if I'm right I'm surprised it would only affect macOS.

When I use the File Import dialog the image sequence imports to the Project Files list and I can preview the Snow%04d.png file using the right-click menu. When I add the image sequence to the timeline then press play under the Preview window, OpenShot either freezes at frame 13 or crashes. If OpenShot freezes, I have to Force Quit the application.

Issues like that are unlikely to be related to the import code, if it correctly sets up the Project Files entry then it's done its job. It's possible there's something going on with the Reader code for image sequences in libopenshot. This could possibly be related to OpenShot/libopenshot#581, though it seems unlikely.

Unfortunately I don't have access to a Mac to test on, so I'm kind of taking shots in the dark. But let me fix one bit of code that I've always been skeptical about, and which could be causing Qt to ignore mouse input when the Image Sequence prompt is displayed. If that works, then we can figure out how to approach the playback issues.

ferdnyc commented 4 years ago

@USATechDude

Here's a build of OpenShot with the changes from PR #3784. If you're able to, please give it a try. I'm hoping it may help with the issue of the Image Sequence dialog box not accepting mouse input during an import. Thanks!

https://drive.google.com/file/d/1fNTdkqjFvPx0JMk-zUJ2aWZrUHOsfRqS/view?usp=sharing

sc0nway commented 4 years ago

@ferdnyc I downloaded the DMG file from the link above and ran it through the Daily Testing Plan. I'm afraid it didn't do too well. Here are my results:

  1. Files • 1.1 - Drag and drop on Project Files (video, image, audio) - Passed • 1.2 - Delete multiple files from Project Files - Passed • 1.3 - Use Import File dialog (video, image, audio) - FAILED

If you start with a fresh launch of OpenShot, either drag-and-drop or Import File dialog work. However, if you change methods while OpenShot is still open when you add files OpenShot crashes. On multiple occasions, OpenShot crashed when using the “+” button to open the Import Files dialog regardless of previous import methods used.

• 1.4 - View file properties (video, image, audio) - Passed • 1.5 - Preview files (video, image, audio) - Passed

  1. Clips • 2.1 - Drag and drop Project Files onto the timeline (video, image, audio) - Passed • 2.2 - Move single clip, and scrub the timeline to verify preview – FAILED

On a fresh launch, this test passes. However, if I start a new project or recover a project after a crash it fails. After adding files to the Project List, I move the playhead to scrub the timeline, but the image in the Preview windows does not change. When I clicked the Play button the playhead did not move.

• 2.3 - Move multiple clips, and scrub the timeline to verify preview – FAILED

Same errors as moving a single clip

• 2.4 - Overlap two clips, the transition should be automatically created - Passed • 2.5 - Context menu: fade clip in and out - Passed • 2.6 - Context menu: animate clip in and out - Passed • 2.7 - Slice clip: move playhead over clip, and right-click on the clip - Passed • 2.8 - Slice clips: move playhead over multiple clips, and right-click on the timeline - Passed • 2.9 - Remove the single clip and multiple clips - Passed • 2.10 - Verify snapping toggle works on the timeline - Passed • 2.11 - Verify zoom slider works (and CTRL+scroll wheel) - Passed • 2.12 - Add to Timeline: verify adding multiple clips to timeline works - Passed • 2.13 - Context menu: Time->Fast->2X (verify clip becomes shorter) - Passed

  1. Effects • 4.1 - Filter effects - Passed • 4.2 - Drag and drop chromakey effect - Passed • 4.3 - Adjust color and fuzz, and verify color is removed – FAILED

Selecting the color manually works but using the screen color selector failed. When you click the Pick Screen Color button the color selection is limited to the Select a Color window.

• 4.4 - Adjust top, bottom, left, and right sides of bars - Passed • 4.5 - Remove selected effect, verify effect removal in preview - Passed • 4.6 - Add a common transition (i.e. Circle Out To In) and verify transition covers entire image - Passed • 4.7 - Add an extra transition (i.e. 4 Squares Left Barr) and verify transition covers entire image – Passed

I could not open the properties for the transitions by selecting the transition, using the right-click menu, or pressing CTRL+I. I was able to use the slice commands to cut the transition down to size and place it on the clips and verify the transition works.

  1. Projects • 5.1 - New project should clear the current one (and prompt to save if changes were made) - Passed • 5.2 - Add files (video, audio, image) to project and timeline – Passed conditionally (see above) • 5.3 - Save project / Save project as: both should prompt for a project location and name - Passed • 5.4 - New project, to clear the saved one above - Passed • 5.5 - Open project, to reload the saved project from above - Passed • 5.6 - Undo/Redo history should still be intact, undo a few times, redo a few times - Passed • 5.7 - Change profile to 'VCD NTSC', verify preview is smaller - Passed • 5.8 - Change profile to 'HD 720p 30 fps', verify preview is clearer - Passed • 5.9 - Verify profile is correctly set when loading saved project - Passed
  2. Exports • 6.1 - Simple: choose each profile in the list (to verify formats and quality settings load for each one) - Passed • 6.2 - Simple: Export a video: All Formats, MP4 (h.264), high quality (non-crf) - Passed • 6.3 - Simple: Export a video: All Formats, WEBM (vp9), high quality (CRF) – FAILED

I cannot export to WEBM (vp9) format because the option is not available in the menu selection. I tried to scroll down the available options to the bottom where WEBM (vp9) usually resides but I was not able to do so.

  1. Titles • 7.1 - Set SVG editor path and Blender path in preferences - Passed • 7.2 - Create a title, it should appear in Project Files, and preview correctly on the timeline - Passed • 7.3 - Edit the created title, both in the title editor, and using Inkscape/Advanced button – FAILED

When I tried to open the title in the Advanced Editor (Inkscape) the information is passed properly to Inkscape but the Title window stays on top and does not allow me to switch to Inkscape to edit the text. The cursor changes to the spinning color wheel.

• 7.4 - Duplicate title in Project Files, and verify the new file is created and previews correctly - Passed

Additional Notes: I can drag-and-drop single and multiple images, audio, video, and image sequences into the Project Files list from Finder. When I am prompted whether or not I want to import the image as a sequence, I can use the mouse to select "Yes". When I use the Import Files dialog to import the first file in an image sequence, the prompt appears but I cannot use the mouse to click "Yes" or "No". I can use the keyboard to Tab to the "Yes" button then the import happens but I am unable to preview the file in the Project List or play it in the Preview window from the Timeline.

ferdnyc commented 4 years ago

@USATechDude

I can drag-and-drop single and multiple images, audio, video, and image sequences into the Project Files list from Finder. When I am prompted whether or not I want to import the image as a sequence, I can use the mouse to select "Yes".

Is that a change from before, or did I misunderstand your previous report? I had originally thought this was about drag-and-drop.

When I use the Import Files dialog to import the first file in an image sequence, the prompt appears but I cannot use the mouse to click "Yes" or "No". I can use the keyboard to Tab to the "Yes" button then the import happens

Hmmm. If that's happening when using the dialog, it's got to be something related to window modality. Most likely the exact same issue is what's interfering with the color picker selecting outside its own borders.

Unfortunately, without access to a Mac I'm not sure how I could realistically work on those issues. I think they'll have to fall to @jonoomph or one of the other devs.

Thanks again for the detailed info, though. It should be a big help to anyone who picks this up.

ferdnyc commented 4 years ago

Hmmm. If that's happening when using the dialog, it's got to be something related to window modality.

Actually, let me amend that. It's either that, or Qt has the concept of input "grabs" that their widgets can make, which permits them to do things like direct mouse or keyboard input to a certain specific screen element. (Useful when, say, you're dragging a slider, so that moving your mouse beyond its borders doesn't break the drag.)

It could be that something is accidentally or intentionally grabbing input during both of those scenarios, when it shouldn't. (Well, in the case of the image sequence dialog, IT should be grabbing input.)

sc0nway commented 4 years ago

@ferdnyc

Is that a change from before, or did I misunderstand your previous report? I had originally thought this was about drag-and-drop.

Yes, this is a change from the previous report. I can drag-and-drop the folder into the Project Files list, and the Preview File context option works. But when I drag the clip to the Timeline, click the Play button under the Preview window, OpenShot crashes.

If I use the Import Files dialog, sometimes OpenShot crashes, and if it doesn't crash, when I preview the clip OpenShot then crashes or freezes and I have to Force Quit.

ferdnyc commented 4 years ago

@ferdnyc

Is that a change from before, or did I misunderstand your previous report? I had originally thought this was about drag-and-drop.

Yes, this is a change from the previous report.

Oh!! Good, excellent. Then I was right about the event accept() being the issue.

Well, in that case the one thing I can do is look over the rest of our event handlers and make sure they're correctly processing input events (meaning, always accept()ing anything they do handle) -- it sounds like there are other issues there. Possibly because it doesn't really matter on Windows and Linux, so it allowed bad habits to creep into the code.

I'll look for more issues of that type and add the fixes to #3784 before I merge it.

The rest of the issues, those are libopenshot-related, possibly due to the audio redesign that's still in progress. (Even clips without any audio of their own, like image sequences, have "silent" audio streams generated for them by libopenshot. For some reason.)

ferdnyc commented 4 years ago

@USATechDude

OK, here's an updated build from that same branch, extending the changes in #3784:

https://drive.google.com/file/d/10T33eHQ3n4dVqZtdSyYH_vDwUSdwyc46/view?usp=sharing

Changes to address the input issues you reported

Unrelated or only loosely-related

Playback/preview issues

This build WILL NOT change anything related to playback, freezing during previews, anything like that. Those are libopenshot issues, and this version is built with exactly the same version of libopenshot as the previous one and the regular Daily Builds. It would only be surprising if anything did change on that front, but that's not the focus here.

General input handling (esp. keyboard shortcuts)

Some of the changes I made to some of the event handling may affect processing of keyboard input — that is to say, there were a few wrong things I removed that, though wrong, may have been there for a reason, because they were working around other bugs. So, I'm curious to hear if there are any changes on that front vs. the current Daily Builds. If there are, and they're negative changes, then the bits I removed will have to be replaced with some other solution to whatever problem they were previously hiding.

sc0nway commented 3 years ago

@ferdnyc Sorry I took so long to test this; I've been under the weather recently. Here are my results of testing OpenShot-v2.5.1-dev2-DropAccept2-1603487713-07a447c9-78db4b94-x86_64:

  1. Files • 1.1 - Drag and drop on Project Files (video, image, audio) - FAILED

When I select all files from the Media Test Files folder on my hard drive and drag them to the Project Files list, when I release the mouse button, OpenShot crashes. When I add the files one at a time, OpenShot crashes when I add the MP4 file. If I add the MP4 file first, OpenShot crashes when I add a WAV file. If I drag-and-drop the Media Test Files folder to the Project Files list, OpenShot crashes. If I drag-and-drop the animation folder, OpenShot prompts me to import Snow0001.png as an image sequence, which I cannot use the mouse to select Yes, but the sequence successfully imports.

•   1.2 - Delete multiple files from Project Files - Passed
•   1.3 - Use Import File dialog (video, image, audio) - Passed
•   1.4 - View file properties (video, image, audio) - Passed
•   1.5 - Preview files (video, image, audio) - Passed

After testing all of the Media Test Files sequentially, when I Previewed the MP4 file, OpenShot crashed. I relaunched OpenShot, it recovered my project, and I was able to preview the MP4 file successfully.

  1. Clips • 2.1 - Drag and drop Project Files onto the timeline (video, image, audio) - Passed • 2.2 - Move single clip and scrub the timeline to verify preview - Passed • 2.3 - Move multiple clips, and scrub the timeline to verify preview - Passed • 2.4 - Overlap two clips; the transition should be automatically created - Passed • 2.5 - Context menu: fade clip in and out - Passed • 2.6 - Context menu: animate clip in and out - Passed • 2.7 - Slice clip: move playhead over clip, and right-click on the clip - Passed • 2.8 - Slice clips: move playhead over multiple clips, and right-click on the timeline - Passed • 2.9 - Remove single and multiple clips - Passed • 2.10 - Verify snapping toggle works on the timeline - Passed • 2.11 - Verify zoom slider works (and CTRL+scroll wheel) - Passed • 2.12 - Add to Timeline: verify adding multiple clips to timeline works - Passed • 2.13 - Context menu: Time->Fast->2X (verify clip becomes shorter) - Passed

OpenShot randomly crashed when making edits per the testing plan. When I relaunch OpenShot, it recovers my project, and I can make the edits according to the Testing Plan. OpenShot mostly crashed when editing the MP4 file.

  1. Effects • 4.1 - Filter effects - Passed • 4.2 - Drag and drop chromakey effect - Passed • 4.3 - Adjust color and fuzz, and verify color is removed - Passed • 4.4 - Adjust top, bottom, left, and right sides of bars - Passed • 4.5 - Remove selected effect, verify effect removal in preview - Passed • 4.6 - Add a common transition (i.e., Circle Out To In) and verify transition covers entire image - Passed • 4.7 - Add an extra transition (i.e., 4 Squares Left Barr) and verify transition covers entire image - Passed

When I added the transitions to the Timeline image, they added with a default length of 10 seconds, while my image was only 5 seconds. I right-clicked the transition then clicked Properties, but the properties for the transition did not appear. I moved the transition to another track, aligned it with the beginning of the clips, then moved the playhead to the end of the clip and chose Slice, Keep Right Side. This cut the transitions to the proper length; then, I moved it on top of the clip for testing the effect.

  1. Projects • 5.1 - New project should clear the current one (and prompt to save if changes were made) - Passed • 5.2 - Add files (video, audio, image) to project and timeline - Passed • 5.3 - Save project / Save project as: both should prompt for a project location and name - Passed • 5.4 - New project, to clear the saved one above - Passed • 5.5 - Open project, to reload the saved project from above - Passed • 5.6 - Undo/Redo history should still be intact, undo a few times, redo a few times - Passed • 5.7 - Change profile to 'VCD NTSC', verify preview is smaller - Passed • 5.8 - Change profile to 'HD 720p 30 fps', verify preview is clearer - Passed • 5.9 - Verify profile is correctly set when loading saved project - Passed

  2. Exports • 6.1 - Simple: choose each profile in the list (to verify formats and quality settings load for each one) - Passed • 6.2 - Simple: Export a video: All Formats, MP4 (h.264), high quality (non-crf) - Passed • 6.3 - Simple: Export a video: All Formats, WEBM (vp9), high quality (CRF) - FAILED

I cannot select the WEBM (vp9) Target because the option is not available on the menu, and I am not able to use the arrow keys or the mouse to scroll down the menu to the correct option.

  1. Titles • 7.1 - Set SVG editor path and Blender path in preferences - Passed • 7.2 - Create a title; it should appear in Project Files and preview correctly on the timeline - Passed • 7.3 - Edit the created title, both in the title editor and using Inkscape/Advanced button - Passed

When I clicked the Advanced Editor button, the Titles window did not move below the active window and allow me access to Inkscape. I was able to drag the Titles window off-screen and use Inkscape to edit and save the title. I dragged the Titles window back on screen and clicked the Save button to save the changes the title made in Inkscape.

•   7.4 - Duplicate title in Project Files, and verify the new file is created and previews correctly - Passed
ferdnyc commented 3 years ago

@USATechDude Thanks, I think.

Any chance you could distill that down into either:

  1. What's different from previous tests, or
  2. What tests actually involve any of the very, very few changes I made in that build (all of which are detailed in my previous comment)?

Because, right now I can't figure out what actual effect, if any, the things I actually changed had on... anything. :confused:

sc0nway commented 3 years ago

@ferdnyc I think I can list what's different from my first tests.

  1. There were fewer crashes when importing files using the dialog than using the drag-and-drop method. Using both methods in a single project still produces crashes.
  2. Drag-and-drop failed regularly on importing WAV or MP4 files, especially if one type was successfully imported, importing the other type would crash the program.
  3. Moving single and multiple clips on the timeline no longer produces crashes.
  4. The Preview window no longer stops responding or causes OpenShot to stop responding.
  5. Importing more than 15 files shows counter in lower left corner of OpenShot.
  6. Recovering projects from a crash no longer results in most tests failing.