Avidemux Forum

Avidemux => Main version 2.6 => Topic started by: Accomac on September 16, 2016, 03:35:00 PM

Title: Newbie question- What is the proper way to add a clip to an existing file?
Post by: Accomac on September 16, 2016, 03:35:00 PM
I hope this is the right place to ask a question, I'll understand if it gets moved somewhere else!

I am trying to edit a video, so one section of it repeats one time. I use the >> buttons to find the key frames that show the beginning and end of part I want to have repeat. Then use COPY and PASTE at the point where I want the file to repeat. I am leaving the [A and B] markers where they were. The copy/paste seems to work fine, but as I continue the video to the end, I get files that I don't want, added to the existing one!
For instance, I get 2 sets of credits at the end as if I had deliberately added them. I must go back and delete the last set to make the clip end properly. The more times I use the COPY and PASTE the more this occurs. I keep getting these random sections of the original file added into it as if it was deliberately being done, including the ones I copied/pasted. :o

Obviously I am doing something wrong but am clueless as to what it is. All the searching I have done including YouTube have yielded no results for what I am trying to do. If my question isn't clear please let me know and I'll try and explain it again.

thank you in advance,

Accomac
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: eumagga0x2a on September 16, 2016, 04:11:08 PM
You don't do anything wrong, it is a bug. Currently it seems that the position of the B marker is not taken into account when copying video. "Paste" pastes everything from the A marker till the end of the video at the current slider position.

Mean, could this be a release blocker despite the EBML header story and the related urgency, please? Copy & paste is basic functionality, maybe the fix is not dificult in this case.
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: mean on September 16, 2016, 05:59:39 PM
The whole thing is half broken, it's not too easy to fix and more important, it is a pain to test
Meanwhile, all the mpeg1/2/4/FF encoder are broken, so i'll release tomorrow, dont know i will have time in the near future after that



Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: Accomac on September 16, 2016, 07:14:52 PM
Well at least I know what the cause of the problem is, I am surprised that it hasn't been fixed at some point. Since there seems to be no fix in the future I will simply remove both copoies from my dual boot machine running Win 7 and Linux Mint.

I'll have  to search for a replacement to do simple editing.

Thank you both for the speedy reply. although I was hoping it was me and my fat fingers causing the problem! :'(

Cheers

Accomac
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: fish on September 17, 2016, 11:15:36 AM
Why not just copy the section you want to repeat, save it. Copy the section up to where you want to add the repeat section, save that. Copy the section that will follow the repeated clip, save that and then append the clips together.
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: Accomac on September 17, 2016, 11:03:27 PM
Hi fish,

Not sure even how to copy just what I want since the [A B] buttons copy more than they should. I don't know if a simple Ctrl C will work ......and how do I choose to delineate what I want to copy/ save?

Sorry to be so lame, all my work is done on RAW files or .jpgs I am just trying to edit a few vids that I have, I do'tn want to make a vocation of it. But it would be nice to know of a work around that won't make me tear out my remaining hair! ;D

Accomac
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: Jan Gruuthuse on September 18, 2016, 05:17:10 AM
Quote from: Accomac on September 17, 2016, 11:03:27 PM
Not sure even how to copy just what I want since the [A B] buttons copy more than they should.
Your used hardware? OS? 32-bit or 64-bit?
And what is your understanding of "[A B] buttons copy more than they should."
The behaviour depends on several things
- are you using avidemux in copy mode for video? You can only select marker with keyboard up or down arrow. Not with left or right.
- the kind of video
-- video codec
-- container
-- same recording/ matching time index
- your workflow
- something we are not aware off

do use a copy of video you want to edit

mark a segment you want to cut / copy / paste with [A ] [ B]
save part01
mark next segment
save part02
and so on

check if the segments contain what you intended

Deleting fragment
mark fragment [A ] [B ], simultaneous keypress [Ctrl][X]
The segment is gone
Save Video "new01"
repeat this steps if more fragments need deleting, increase video name by 1 (new02, new03, ...) when saving.

now load the last video like new03 and add the segment part01 , save that video new03part01
load video new03part01 and add segment part02, save video new03part01part02.
at each step check if the result is there.

If you still have issues, provide a more detailed work flow, reproducible at will be us, and see if we can take it from there.

Check out: Avidemux Quickstart (http://www.avidemux.org/admWiki/doku.php?id=using:quickstart)
and please do note:
QuoteAvidemux is a simple tool for simple video processing tasks. The keyword here is simple: it does not offer tools like a timeline, multitrack editing, you cannot freely move or splice audio and video clips from various sources. However, Avidemux allows you to do elementary things in a very straightforward way.
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: eumagga0x2a on September 18, 2016, 06:39:02 AM
Quote from: Accomac on September 17, 2016, 11:03:27 PM
Not sure even how to copy just what I want since the [A B] buttons copy more than they should.

Remember, the marker A (it doesn't matter whether you set it via clicking on the button or via Ctrl+PgUp) sets the start of the segment copied to clipboard, but the marker B has no effect thus the end of the segment is always the end of the video. This applies only to the "copy to clipboard" operation, otherwise marker B is well respected, e.g. for the delete operation.

QuoteI don't know if a simple Ctrl C will work

It works or rather fails in the same way as clicking through menus.

Quote......and how do I choose to delineate what I want to copy/ save?

Currently copy & paste is directly usable only if you copy a segment at the end of the video. Otherwise you have to save the part you want to copy & paste as a separate video first, then append it to the original video. Now you can copy it and paste elsewhere. Delete the appended part at the end.

QuoteBut it would be nice to know of a work around that won't make me tear out my remaining hair! ;D

Presumably the workaround outlined above falls into the tearing hair out category. The relief is not far away: a fix for the editing engine is scheduled for the next Avidemux release (http://avidemux.org/smif/index.php/topic,17161.0.html).
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: fish on September 18, 2016, 08:41:44 AM
I do not see the issue with the 'B' mark out control (Win 7).  If I mark points A and B, I can save that section of video between the in and out markers.
If the file format is a raw file, which should be similar to an M-JPEG and DV, , in that each frame is compressed independently, rather than with interframe prediction, it should be unnecessary to cut to I-frames.
Assuming the section to be repeated is repeated without a gap of other video then, in copy mode simply mark A at the start of the video, mark B at the end of the section to be repeated. Save that as part 1. Then mark A at the beginning of the section you want repeated and mark B at the end of the video. Save as part 2. Then append part 1 and part 2, save that and you will have a video with a section repeating. If you want a section that repeats but doesn't repeat adjacent in time, then you will need to do it as I suggested previously.   
Mark A and B of the section you want to repeat, save it as part2. Mark A and B of the section where you want the repeat section to start, save that as part 1. Mark A and B of the section that will follow the repeated section, save that as part 3. Then append the clips together, which in Win7 in copy mode, is a simple case of dragging part 1 into Avidemux, followed by dragging part 2 and part 3. Then save that as your new video The section you selected as part 2 will repeat between your part 1 and part 3.
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: Jan Gruuthuse on September 18, 2016, 08:59:40 AM
Quote from: eumagga0x2a on September 18, 2016, 06:39:02 AM
>8 >8
But it would be nice to know of a work around that won't make me tear out my remaining hair! ;D
>8 >8
Presumably the workaround outlined above falls into the tearing hair out category.
I don't understand your adversity versus workarounds or my postings. Not the 1st time you're doing this.
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: eumagga0x2a on September 18, 2016, 01:15:24 PM
Quote from: fish on September 18, 2016, 08:41:44 AM
I do not see the issue with the 'B' mark out control (Win 7).  If I mark points A and B, I can save that section of video between the in and out markers.

Yes, correct, saving and deleting works. The copy operation announces at avidemux/common/ADM_editor/src/ADM_segment.cpp:804 and at line 805 that it would do the right thing like

  [HandleAction]  ************ Copy **************
  [copyToClipBoard]  Copy to clipboard from 00:18:21,160  [copyToClipBoard]  to 00:23:24,520


The values for startTime and endTime are correct for markers A and B I've set in my test video which is 38 minutes 51 seconds long. Then things start to go wrong. Actually, the second condition in

        if(s._startTimeUs<=endTime && (s._startTimeUs+s._durationUs)>endTime)
        {
           
            // need to refine last seg           
            uint64_t offset=endTime-s._startTimeUs;
            s._durationUs=offset;
            aprintf("Marker B is here offset=%d\n",(int)offset);
        }


fails as "Marker B is here offset=" message never gets printed in the console. Naively deleting

&& (s._startTimeUs+s._durationUs)>endTime

and replacing the line 829 with

            uint64_t offset=endTime-startTime;

sort of fixes the copy to clipboard function. I have no idea how many kittens have to die due to this surgery with a pry bar, but it works this way.

Of course, this is not a real fix, just an uneducated hack! Don't do it at home!
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: eumagga0x2a on September 18, 2016, 09:54:48 PM
Quote from: Jan Gruuthuse on September 18, 2016, 08:59:40 AM
Quote from: eumagga0x2a on September 18, 2016, 06:39:02 AM
Presumably the workaround outlined above falls into the tearing hair out category.
I don't understand your adversity versus workarounds or my postings. Not the 1st time you're doing this.

I'm shocked that my statement could be misunderstood this way, my apologies that my wording must have been not clear enough. The phrase was related solely to my own workaround directly above:

Quote from: eumagga0x2a on September 18, 2016, 06:39:02 AM
Currently copy & paste is directly usable only if you copy a segment at the end of the video. Otherwise you have to save the part you want to copy & paste as a separate video first, then append it to the original video. Now you can copy it and paste elsewhere. Delete the appended part at the end.

I considered mine (and only mine) workaround to be too tedious.
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: Jan Gruuthuse on September 19, 2016, 04:28:59 AM
OK, my misunderstanding in context.
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: Accomac on September 19, 2016, 04:10:26 PM
Whew!

It was never my intention to start an argument among everyone, I just wanted to know what I was doing wrong when using your program. I have never ignored anyone's posting or suggestion with a solution or workaround. When I get a reply from a senior member 'eumagga0x2a' :You don't do anything wrong, it is a bug. Currently it seems that the position of the B marker is not taken into account when copying video. "Paste" pastes everything from the A marker till the end of the video at the current slider position. I have to believe them!

to: Jan Gruuthuse My system is dual boot Win 7 64 and Linux Mint, Graphics Card is Nvidia 880GTS, 6GB RAM, Hybrid drive 1 SSD 1 500GB HDD MS is an Asus Rampage Extreme, Quad Core Intel Processor

I would love to use Avidemux to do simple editing! It's exactly what I need, I will not be creating Steven Spielberg production quality videos, that's not my intention, it's waaaaaay beyond my paygrade. I don't even own a video camera of any kind.

When you say 'choose what you want to add and save it', you lose me. I can visualize what you're telling me but I can't accomplish it. That's where it goes off the rails for me.  Sorry I didn't realize there is an COPY MODE.... You are operating under the false assumption that I understand the terminology.

You are ALL far more knowledgeable on the subject than I am and I bow to your superior skills. I don't do any coding or compiling, I am just an end user.

That said, I wonder if I was to ask you to read a schematic diagram for a MK !V Harsco Tamper, and tell my why the hydraulic cylinder on the lining frame isn't getting the signal to move the rail, how well would you do? It all depends on your skill set, just like me fumbling with Avidemux!

I am confident that at some point the proverbial light will come on and I'll sigh and think "boy this was easy, I was over thinking it!"

Right now though we aren't at that juncture.

You don't need my permission to delete the entire thread and remove me as a member of the forum, but for God's sake don't drag me into an argument because I asked a simple question and was given an answer that "You don't do anything wrong it is a bug" "

Thank you all
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: Jan Gruuthuse on September 19, 2016, 04:41:25 PM
copy mode is when Video Output and Audio Output both showing [Copy] no re-encoding takes place.

My understanding of Basic editing: Fast Edit with Copy Mode (https://www.youtube.com/watch?v=avs5AvlSq4Y&index=9&list=PLLGMi2RSm8sbiUG2tfv8mcCzJoEsK3JVN) 3.15 Minute video on youtube.
All selections here are made with keyboard up/down arrow.

Try with Linux Mint (not a virtual machine) and latest http://www.avidemux.org/nightly/appImage/ that should run without install.

If copy paste does not work: save video in parts, then load parts in order you want.
Load  part 01 and append remaining videos manually, don't let avidemux load remaing parts if it asks to do so.

remove previously created .idx2 files.
I'm basic user, and try to keep things simple, explaining from this perspective.




Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: eumagga0x2a on September 19, 2016, 07:24:18 PM
Quote from: eumagga0x2a on September 18, 2016, 01:15:24 PM
Naively deleting

&& (s._startTimeUs+s._durationUs)>endTime

and replacing the line 829 with

            uint64_t offset=endTime-startTime;

sort of fixes the copy to clipboard function.

I'm sorry for very incomplete analysis and wrong approach. There was nothing wrong with the offset calculation, but I'm pretty sure that both the second condition and the calculation of s._durationUs in this context was incorrect.

diff --git a/avidemux/common/ADM_editor/src/ADM_segment.cpp b/avidemux/common/ADM_editor/src/ADM_segment.cpp
index ef4791d..f85ab05 100644
--- a/avidemux/common/ADM_editor/src/ADM_segment.cpp
+++ b/avidemux/common/ADM_editor/src/ADM_segment.cpp
@@ -822,12 +822,12 @@ bool        ADM_EditorSegment::copyToClipBoard(uint64_t startTime, uint64_t endT
             s._durationUs-=offset;         // take into account the part we chopped
             aprintf("Marker A is here offset=%d\n",(int)offset);
         }
-        if(s._startTimeUs<=endTime && (s._startTimeUs+s._durationUs)>endTime)
+        if(s._startTimeUs<=endTime && (startTime+s._durationUs)>endTime)
         {
             
             // need to refine last seg           
             uint64_t offset=endTime-s._startTimeUs;
-            s._durationUs=offset;
+            s._durationUs=endTime-startTime;
             aprintf("Marker B is here offset=%d\n",(int)offset);
         }
         // TODO refine timing for 1st/last/duration/...


fixes the copy to clipboard function for me and doesn't kill kittens as it seems.
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: eumagga0x2a on September 19, 2016, 08:38:40 PM
Quote from: Accomac on September 19, 2016, 04:10:26 PM
Whew!

It was never my intention to start an argument among everyone, I just wanted to know what I was doing wrong when using your program.

There was no argument except of a minor misunderstanding. Thank you very much for attracting attention to this bug, which I saw myself a month or two ago, wasn't able to dissect and finally just forgot about it.

QuoteI have never ignored anyone's posting or suggestion with a solution or workaround. When I get a reply from a senior member 'eumagga0x2a' :You don't do anything wrong, it is a bug. Currently it seems that the position of the B marker is not taken into account when copying video. "Paste" pastes everything from the A marker till the end of the video at the current slider position. I have to believe them!

No, you have not, I'm not a deity :)

Anyway, if you build Avidemux on Mint yourself and want copy to clipboard function to work immediately, you could give the patch a try. Otherwise I'm sure that Mean will fix the issue in a proper way pretty soon. You will be able to obtain Avidemux nightly deb packages thanks to Jan's efforts then.
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: Accomac on September 20, 2016, 04:40:15 PM
hello again eumagga0x2a,

I should have mentioned earlier that I had a lot of trouble finding  a version of v2.6.13 that my Norton Security didn't think was a virus or malware. I don't know if the suspect versions were really infected or it was a false positive from Norton.

I have been trying the workarounds you all have suggested to me as far as making additions to an original video. I have had success doing it that way IE: clip a goes to clip b etc. but of course that way is very time consuming depending on the amount of edits I want to do.

Once the bug issue is resolved by mean, yourself and the others, will I then be able to use the [A & B] to cut and paste a clip into an existing file? If I read things correctly that's the goal.

Anyway I can work with what I have now and look forward to the 'fix' whenever it comes, there's no hurry. I would think that open source programming is a thankless endeavor, so let me say 'THANK YOU' to all of you that created Avidemux! Your work isn't going un-appreciated, I think people just forget to say those two words.

Regards,

Accomac
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: mean on September 20, 2016, 05:07:55 PM
Maybe better now
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: eumagga0x2a on September 20, 2016, 05:38:54 PM
Quote from: Accomac on September 20, 2016, 04:40:15 PM
I should have mentioned earlier that I had a lot of trouble finding  a version of v2.6.13 that my Norton Security didn't think was a virus or malware. I don't know if the suspect versions were really infected or it was a false positive from Norton.

You should always check at least published MD5 checksums for release executables you download. If they are not signed, a quick search in Google for the particular checksum allows somewhat to estimate the likelihood that this checksum is valid (yes, md5 hashing is already cracked, but there is nothing better for Avidemux yet). If the checksum matches, it was probably a false positive. If not, everything is possible, from a damaged file till a malitious attack.

You mentioned that you use Linux Mint alongside with Windows. You should not have any such problems on Linux.

Quote from: mean on September 20, 2016, 05:07:55 PM
Maybe better now

Unfortunately, not quite. s._durationUs still ends up being equal endTime. I witnessed also Avidemux not reproducibly crashing on Ctrl+C without any backtrace.
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: eumagga0x2a on September 20, 2016, 06:13:59 PM
The following works for me, tested with quite complicated multi-segment layouts:

diff --git a/avidemux/common/ADM_editor/src/ADM_segment.cpp b/avidemux/common/ADM_editor/src/ADM_segment.cpp
index 090d6b7..89b731f 100644
--- a/avidemux/common/ADM_editor/src/ADM_segment.cpp
+++ b/avidemux/common/ADM_editor/src/ADM_segment.cpp
@@ -826,7 +826,7 @@ bool        ADM_EditorSegment::copyToClipBoard(uint64_t startTime, uint64_t endT
         {           
             // need to refine last seg           
             uint64_t offset=endTime-s._startTimeUs;
-            s._durationUs=offset;
+            s._durationUs=endTime-startTime;
             aprintf("Marker B is here offset=%d\n",(int)offset);
         }
         // TODO refine timing for 1st/last/duration/...


(If it says that "Marker B" is equal offset, how can the duration be equal offset as well??
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: mean on September 20, 2016, 07:05:10 PM
Let' say you have 3 segments
0: 0..5 duration=5 Startime =0 endTime=5
1: 10..15 duration = 5 Startime =5 endTime=10
2: 40..45 duration = 5 Startime =10 endTime=15

if you copy to clip board from middle of 1 to middle of 2, i.e. 5 seconddes
you will have half of 1 from 12.5 to 15 i.e. 7.5 to 10 linear, duration =2.5
but you must  also have  half of 2 duration = 2.5 from 40 to 42.5, linear 10 to 12.5
if you do end segment  duration = startime-endtime you will get 5
Here we do
duration = end time (12.5) - segment start time = 10 == 2.5

What am i missing ?

Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: eumagga0x2a on September 20, 2016, 09:16:24 PM
Thank you for your patient explanation, now I understand what a segment is. The current code works correctly only if mark A and mark B belong to different segments. My otherwise wrong suggestion works only if A and B belong to one and the same segment. What do you think about the following approach?

diff --git a/avidemux/common/ADM_editor/src/ADM_segment.cpp b/avidemux/common/ADM_editor/src/ADM_segment.cpp
index 090d6b7..c3d9807 100644
--- a/avidemux/common/ADM_editor/src/ADM_segment.cpp
+++ b/avidemux/common/ADM_editor/src/ADM_segment.cpp
@@ -813,21 +813,23 @@ bool        ADM_EditorSegment::copyToClipBoard(uint64_t startTime, uint64_t endT
     {
         _SEGMENT s=segments[seg],s2=s;
         aprintf("Adding segment %d to clipboard\n",seg);
+        uint64_t offsetA = 0;
+        uint64_t offsetB = 0;
         if(s._startTimeUs<=startTime && (s._startTimeUs+s._durationUs)>startTime)
         {
             // need to refine 1st seg

-            uint64_t offset=startTime-s._startTimeUs;
-            s._refStartTimeUs+=offset;
-            s._durationUs-=offset;         // take into account the part we chopped
-            aprintf("Marker A is here offset=%d\n",(int)offset);
+            offsetA=startTime-s._startTimeUs;
+            s._refStartTimeUs+=offsetA;
+            s._durationUs-=offsetA;         // take into account the part we chopped
+            aprintf("Marker A is here offset=%d\n",(int)offsetA);
         }
         if(s2._startTimeUs<=endTime && (s2._startTimeUs+s2._durationUs)>=endTime)
         {           
             // need to refine last seg           
-            uint64_t offset=endTime-s._startTimeUs;
-            s._durationUs=offset;
-            aprintf("Marker B is here offset=%d\n",(int)offset);
+            offsetB=endTime-s._startTimeUs;
+            s._durationUs=offsetB-offsetA;
+            aprintf("Marker B is here offset=%d\n",(int)offsetB);
         }
         // TODO refine timing for 1st/last/duration/...
         clipboard.push_back(s);       


It seems to cover both scenarios.
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: eumagga0x2a on September 21, 2016, 04:29:04 PM
Quote from: eumagga0x2a on September 20, 2016, 09:16:24 PM
The current code works correctly only if mark A and mark B belong to different segments.

Assuming that there are two segments




0:0...5duration=5start_time=0end_time=5
1:10...20duration=10start_time=5end_time=15

Now copying to clipboard from linear 8 to 13 results at line 820 in offset=8-5=3. At the line 822 duration becomes 10-3=7. The second test evaluates after the recent partial fix correctly as true too, so we get a new offset=13-5=8 and a new duration=8 instead. Finally we try to copy from linear 8 to linear 16 which is beyond the end of the video.

The new patch would result in offsetA=8-5=3 as before, but then we get offsetB=8 and the correct duration of offsetB-offsetA=8-3=5.

In your example with 3 segments, the offsetA for segment 1 becomes 7.5-5=2.5 and duration=5-2.5=2.5 while the second test evaluates false. For segment 2, the first test evaluates false, so offsetA is zero. offsetB is 12.5-10=2.5 and duration=offsetB-offsetA=2.5-0=2.5. We end up copying 2.5 seconds starting at linear 7.5 from the segment 1 and 2.5 seconds starting at linear 10 ending at 12.5 from the segment 2, which is the expected correct behaviour.
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: mean on September 21, 2016, 04:45:15 PM
It looks fine, but a bit complicated
Wouldn't just adding
// First seg
{
...

s._startTimeUs+=offset
}
// last seg
{

}
in the first part have the same effect but simpler ?
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: eumagga0x2a on September 21, 2016, 05:11:31 PM
It would work but print wrong value for marker B offset if both markers lie within one and the same segment.

(For the sake of easy legibility I would rather not modify the value of a variable which would change the semantics, i.e. _startTimeUs stores the start time of the segment and doesn't morph into something else. If you don't mind...)
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: mean on September 21, 2016, 05:16:56 PM

It is a copy of the real one, that copy is stored in the clipboard .
In that case, that specific field has no meaning because it needs the previous segments to be computed correctly.
That field is  erased and recomputed  when the clipboard is pasted , where it has a context
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: eumagga0x2a on September 21, 2016, 05:25:11 PM
Then

diff --git a/avidemux/common/ADM_editor/src/ADM_segment.cpp b/avidemux/common/ADM_editor/src/ADM_segment.cpp
index 090d6b7..2209c88 100644
--- a/avidemux/common/ADM_editor/src/ADM_segment.cpp
+++ b/avidemux/common/ADM_editor/src/ADM_segment.cpp
@@ -820,13 +820,14 @@ bool        ADM_EditorSegment::copyToClipBoard(uint64_t startTime, uint64_t endT
             uint64_t offset=startTime-s._startTimeUs;
             s._refStartTimeUs+=offset;
             s._durationUs-=offset;         // take into account the part we chopped
+            s._startTimeUs+=offset;
             aprintf("Marker A is here offset=%d\n",(int)offset);
         }
         if(s2._startTimeUs<=endTime && (s2._startTimeUs+s2._durationUs)>=endTime)
         {           
             // need to refine last seg           
-            uint64_t offset=endTime-s._startTimeUs;
-            s._durationUs=offset;
+            uint64_t offset=endTime-s2._startTimeUs;
+            s._durationUs=endTime-s._startTimeUs;
             aprintf("Marker B is here offset=%d\n",(int)offset);
         }
         // TODO refine timing for 1st/last/duration/...


would probably do it (untested).
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: eumagga0x2a on September 21, 2016, 05:38:47 PM
Works fine, thanks!
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: Accomac on October 26, 2016, 04:07:22 PM
Hello again,

I didn't want to start a new thread since the problem is the same.

Using the latest version of Avidemux and I find that the problem with the A[ copying to the end of the video is still there. It blows right past the ]B as if it wasn't there.

Not sure if that was one of the things that was to be fixed in this release or not, but I thought I'd just mention it.

Thanks to you all,

Accomac
Title: Re: Newbie question- What is the proper way to add a clip to an existing file?
Post by: eumagga0x2a on October 26, 2016, 04:13:26 PM
The patch (https://github.com/mean00/avidemux2/commit/9359db57c095cc7854003f2b38c4ee62eff5d53c) was pushed to git on Sep 21, it missed the 2.6.14 release by 4 days. Please use the current nightly, it includes more editor related fixes.

edit: here is a probably incomplete list of editor and navigation related commits past the 2.6.14 release till now: