Page 4 of 6

Re: Insert Media after 10 sec

Posted: Mon Feb 08, 2021 1:11 pm
by emcodem
It is not really "adding a frame", it is just displaying the frame of the original main clip (02.mxf) at TC 00:00:05:00 (picture content = 00:00:10:01) because you specified the insertion point 5 seconds in your text file.

I guess it is a matter of perspective if it is correct or not, but anyway you have to live with it and it is easy to deal with the situation: Either just specify the inpoint in your text file as e.g. 4.96 instead of 5 (all in seconds), or use the populate vars node to calculate the i_insertion_point_frames and just subtract 1 from the final calculated value in the Populate vars node before the A/V media decoder.

Edit: i just read the documentation for avisynth trim function here http://avisynth.nl/index.php/Trim

Code: Select all

Returns a clip starting at first_frame and running up to and including last_frame.
So it would i think the best would be to subtract -1 from the insertion_point_frames in the populate vars node (or in the .avs script itself).

Re: Insert Media after 10 sec

Posted: Mon Feb 08, 2021 1:27 pm
by authorleon
Okay... GREAT...

I understand your point. It is not an extra frame it is effectively using trim just to get the exact correct amount. In this case. 4.96 is the exact correct amount. 5.0 is too much. using 4.96 in the text document has made a smooth transition for the insert point and has removed the pop in the audio.

1. point of insertion works perfectly if I put it is 4.96 and the audio does not pop... EXCELLENT!!!!. Thank you!!!
2. so the same issue applies for the endpoint. The problem is I don't how to specify the endpoint?
3. Question. Can you put some minor one frame in the AVS script ??

Thank you


08-02-21--x--58.gif
08-02-21--x--58.gif (125.65 KiB) Viewed 10716 times

Re: Insert Media after 10 sec

Posted: Mon Feb 08, 2021 1:39 pm
by emcodem
authorleon wrote: Mon Feb 08, 2021 1:27 pm 2. so the same issue applies for the endpoint. The problem is I don't how to specify the endpoint?
Endpoint of the Main Clip i assume? ...so you you do not want to display the full main clip until the end but set an outpoint, correct? This outpoint should be relative to the start of the main clip, correct? (so not to the start of opener+mainclip).
How you want to do that, using a second text file or a second line in the text file? (second text file would be easiest, e.g. %inputname%_out.txt)
authorleon wrote: Mon Feb 08, 2021 1:27 pm 3. Question. Can you put some minor one frame in the AVS script ??
Not sure what you mean, do you mean you want to subtract ONE frame from the main clip? ..because how i understand this question is like you want to insert ONE single frame e.g. like a jpg or such hehe...

Re: Insert Media after 10 sec

Posted: Mon Feb 08, 2021 1:46 pm
by authorleon
emcodem wrote: Mon Feb 08, 2021 1:39 pm
authorleon wrote: Mon Feb 08, 2021 1:27 pm 2. so the same issue applies for the endpoint. The problem is I don't how to specify the endpoint?
Endpoint of the Main Clip i assume? ...so you you do not want to display the full main clip until the end but set an outpoint, correct? This outpoint should be relative to the start of the main clip, correct? (so not to the start of opener+mainclip).
How you want to do that, using a second text file or a second line in the text file? (second text file would be easiest, e.g. %inputname%_out.txt)
authorleon wrote: Mon Feb 08, 2021 1:27 pm 3. Question. Can you put some minor one frame in the AVS script ??
Not sure what you mean, do you mean you want to subtract ONE frame from the main clip? ..because how i understand this question is like you want to insert ONE single frame e.g. like a jpg or such hehe...
Sorry, my bad. I should explain things better.

1. The end clip goes at the end of the scene. Nothing has to be calculated it should just fit right at the end perfectly.
2. I think your idea of using trim function is a really good idea.
- I just tried it (I did also put the text file back to 5)

Code: Select all

#trim existing source, creating 2 clips: one up to the point of insert, the other one from the point of insert
clip1=Trim(m_clip, -1,%i_insertion_point_frames%)
clip3=Trim(m_clip,%i_insertion_point_frames%,0)
I assume this is where I have to change it.

I think the best course of action is to tackle one problematic time. Let's get the insertion clip, the first one sorted and then we can worry about the rest.

I tried changing the variables to even -4, but no success.

I'm reading thhe documentation now.

I feel we are very close.

I love the idea of inserting one frame. Some subliminal messages. I think they used to do that in the movie theatres?

Re: Insert Media after 10 sec

Posted: Mon Feb 08, 2021 2:16 pm
by emcodem
Cool that you really get some understanding about whats going on, thats important when you use this in production.

What you do:

Code: Select all

clip1=Trim(m_clip, -1,%i_insertion_point_frames%)
clip3=Trim(m_clip,%i_insertion_point_frames%,0)
The Trim function has 3 aguments:
1) input clip (m_clip is the original main clip in its full length)
2) inpoint (you provide -1, thats definitely no valid inpoint)
3) outpoint

What you WANT to do is most likely like this:

Code: Select all

clip1=Trim(m_clip, 0,%i_insertion_point_frames%-1)
clip3=Trim(m_clip, %i_insertion_point_frames%-1,0)
As you know, %i_insertion_point_frames% was read from the text file and cacluated from seconds to frames.
Fortuantely we can use simple arithmetic functions in avisynth so "%i_insertion_point_frames%-1" is OK

Re: Insert Media after 10 sec

Posted: Mon Feb 08, 2021 2:22 pm
by authorleon
fantastic work..

Okay go to upload this here because I've done this and this works.

I'm going to implement your strategy as a think it is far more correct.

Image

Re: Insert Media after 10 sec

Posted: Mon Feb 08, 2021 2:28 pm
by emcodem
authorleon wrote: Mon Feb 08, 2021 1:46 pm I love the idea of inserting one frame. Some subliminal messages. I think they used to do that in the movie theatres?
I think we are on the same page here :mrgreen:
Looking forward to see your progress :D

Re: Insert Media after 10 sec

Posted: Mon Feb 08, 2021 3:18 pm
by authorleon
okay, I think everything has come together. I will continue testing over the next few days in detail with scenarios. Thank you!!! emcodem!!!!

I will keep you fully updated.

Image

Re: Insert Media after 10 sec

Posted: Mon Feb 08, 2021 4:26 pm
by emcodem
Nice!
One thing i wonder is why you say that you can work in any format... don't you prefer if it is not recodec when you export it from NLE?
Anyway, actually whatever professional format you use should work, as long as it has only 1 audio per track and at least 2 tracks.

One thing you might want to know about this custom avisynth script is that you have to imagine lots of stuff that was generated by the ffastrans A/V decoder before. The custom avs node just "appends" your stuff to what was already generated. And what was generated? - m_clip was loaded with the original main clip 32 audio channels were generated. Thats why we also need to generate the missing 30 channels in our custom script.
This all to provide maximum compatibility to the rest of ffastrans processors.

To dig a little deeper, configure your workflow in the "maintenance" tab to "keep work files on completion", then open the work dir from the status monitor and check out the .avs files that was generated by the custom avsiynth node.

Also, i can recommend to use the webinterface while you are developing on workflows, the log viewer is somewhat helpful.

Re: Insert Media after 10 sec

Posted: Mon Feb 08, 2021 5:38 pm
by authorleon
okay am just back from having some food.

About to get into again. Let's go

I could not wait. I'm going to continue testing now.