ilia3101 / MLV-App

All in one MLV processing app.
https://mlv.app/
GNU General Public License v3.0
283 stars 29 forks source link

QtApp: cut-in & cut-out #15

Closed masc4ii closed 6 years ago

masc4ii commented 7 years ago

Functionality for cut-in and cut-out could be added.

bouncyball-git commented 7 years ago

'Could' is the wrong word - 'Should' is the correct one :D

masc4ii commented 6 years ago

I worked on this old enhancement issue now. What is working now:

pic

What has to be done: -> Cut export. For the video frames this should be no problem. But for audio this is a bit more difficult, at least for me..., cut out is no problem, but I don't know the syntax for a cut in. I get only crashes. Could someone please assist here?

bouncyball-git commented 6 years ago

Theoretically cutting the beginning is as simple as cutting the end. Where exactly are you stuck?

masc4ii commented 6 years ago

My problem was to cut the beginning in audio_mlv.c line 132. The end works simply with the 2nd parameter. For the first I wanted to increment the starting address, but I got only crashes.

masc4ii commented 6 years ago

This function also needs 2 parameters then - in and out frame.

masc4ii commented 6 years ago

Video export is cut now too. :-)

bouncyball-git commented 6 years ago

Clip loops from cut in to cut out when looping enabled. Is that intended behavior?

masc4ii commented 6 years ago

Yes it is. And it was not that easy as it looks ;-) And not only the loops should be cutted: playback should stop at cut out, if loop is disabled. If you press the first frame button, the position goes to cut in. If you press again, it jumps to frame 1.

masc4ii commented 6 years ago

Okay. I got it. Feature complete for cutIn cutOut. @ilia3101 : I made a new audio write wave function for compatibility reasons to your code. If you like you could easily adapt to the parameters of the new function: cut_in = 1, cut_out = getMlvFrames(video). Then we could delete the old one (and name the new again as the old function). @ all: please test, I expect some bugs. The change was more work as expected...

masc4ii commented 6 years ago

@ilia3101 : now I think you mustn't change it anymore. I made a function which generates the audio header, so the write wave functions are way smaller. So we can have both version in the code...

seescho commented 6 years ago

Works fine here for cutting video (have no audio, so I cannot tell anything about audio). Thanks for implementing.

bouncyball-git commented 6 years ago

Great job! :)

masc4ii commented 6 years ago

Thank you. So we can close, when it works for you?

bouncyball-git commented 6 years ago

I corrected buffer pointer + in_offset issue. Now everything is right and synced.

masc4ii commented 6 years ago

Cool, thank you. So this was not working on Linux? Haven't had a problem on Mac... but now it is save... :-)

bouncyball-git commented 6 years ago

I can't believe this was not a problem on mac really ;). It should be a problem anywhere!

fwrite been starting saving the data from buffer 'pointer + *cut_in 2**'!

If it is the case I'm happy that I'm not developing on a Mac! :P, I don't even understand what mechanism corrects this on the mac!

bouncyball-git commented 6 years ago

btw you wrote this some while ago:

My problem was to cut the beginning in audio_mlv.c line 132. The end works simply with the 2nd parameter. For the first I wanted to increment the starting address, but I got only crashes.

How did you solve this problem? I can't find the related commit.

masc4ii commented 6 years ago

I solved it as you can see. Before the syntax was completely wrong :-D

bouncyball-git commented 6 years ago

ok, never mind :)

I'm just so curious how compiler? or anything corrects incorrect memory access for mac. As you remember this is not the first time I'm correcting things like this to work on Linux. Freeing NULL pointer buffers and so on... it is just very strange and unacceptable to me :).