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

Lossless masking? #1895

Closed
4 tasks done
dcdom2 opened this issue Feb 15, 2024 · 4 comments
Closed
4 tasks done

Lossless masking? #1895

dcdom2 opened this issue Feb 15, 2024 · 4 comments

Comments

@dcdom2
Copy link

dcdom2 commented Feb 15, 2024

The fewer issues I have to read, the more new features I will have time to implement, so I ask that you please try these things first

Description

Here is my case: I want to remove the image part of a video, but keep the audio. Normal cutting wouldn't do.

VirtualDub (the original) had a feature called masking where if you mask frames 101-150, the video appears to "hang" on frame 100 for that duration until it resumes with frame 151. This was lossless in the sense: 1-100 untouched + 101-150 replaced with the 100 keyframe (I think) as long as the specified duration in the same video parameters + 151-end untouched, then all were losslessly merged.

I think this will be an awesome addition to LosslessCut and in the same spirit of "cutting".

Thank you

@mifi
Copy link
Owner

mifi commented Feb 16, 2024

Hi. I believe this is technically similar to #1268 - I've added your suggestion there, and will close this

@mifi mifi closed this as completed Feb 16, 2024
@dcdom2
Copy link
Author

dcdom2 commented Feb 17, 2024

Thanks.

I just want to add: I am not sure if the frame is actually repeated during the masked segment or that is just a quirk of the media player (if I jump forward within the masked segment (e.g. to frame 130), the player changes to the first unmasked frame (151) for the duration (130-150) then continues to play normally (151-end)) . So, the issue might not exactly be frame manipulation. Could I ask you to try it in VirtualDub (doesn't work in VirtualDub 2) to be sure how it is done? Thanks.

@mifi
Copy link
Owner

mifi commented Feb 18, 2024

not sure how to test that. maybe you can do it and then load the video into losslesscut and see if there are many keyframes in a short period of time

@dcdom2
Copy link
Author

dcdom2 commented Feb 18, 2024

It seems that all the masked frames are replaced with what VirtualDub calls D frames or "A drop or null frame, which repeats the previous frame".

Here is the output video of VirtualDub:

1min.zip

Steps to reproduce:

  • Download VirtualDub
  • Download the QuickTime plugin (and the MKV plugin if you need it).
  • Put the extracted plugin files into the plugins64 folder of VirtualDub.
  • Download https://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4 (62 MB)
  • Open in LosslessCut. Cut from 0 to 1 minute. save as 1min.mp4
  • Load 1min.mp4 into VirtualDub. From the toolbar menu, select Video --> Direct stream copy
  • Mark from second 5 to second 20 using the buttons at the bottom
  • Edit --> Mask selected frames
  • Ctrl+D (to clear selection)
  • File --> Save as AVI ...
  • Close 1min.mp4, open 1min.avi in VirtualDub
  • Check frames between second 5 to second 20. All D frames

P.S. Interestingly, the file size of output avi file gets smaller and smaller the longer you make the masked portion, sugesting that it is not full keyframes inserted and the frames are actually dropped.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants