Insert Media after 10 sec

Questions and answers on how to get the most out of FFAStrans
authorleon
Posts: 108
Joined: Fri May 08, 2020 5:18 pm

Re: Insert Media after 10 sec

Post by authorleon »

first of all thank you very much.

I got the base concept working.

I have a few questions
1. Is it better to use MXF format over MP4. taking into account I mentally working with 50 FPS. is this process achievable with only MP4 format? thank you

2. What does the variable length of inserted clip frames 75 refer to???

You mentioned this: 1) you should start the WF by submitting only the video file. E.g. if you test in a watchfolder, exclude *.txt... the WF calculates the text files name from the video file name and waits 1 hour until it exists. Sure you could easily exchange this and submit the text file, then calculate the video's file name (if the extension of the video is always the same, e.g. *.mxf).

I do not naturally quite understand this. I tested the system and put the files directly in the folder and everything seemed to work. from what I understand. you are suggesting that I should delay the text file being added into the in folder? if that is the case, a CMD executed can be used to move the text file with the correct name from one folder to another making the process pretty much automated. I think that's what you mean, but if not please let me know.

Image


I'm still testing out the system and I will post my results and it a bit later.

Thanks
emcodem
Posts: 1652
Joined: Wed Sep 19, 2018 8:11 am

Re: Insert Media after 10 sec

Post by emcodem »

authorleon wrote: Fri Feb 05, 2021 12:38 pm I got the base concept working.
I have a few questions
1. Is it better to use MXF format over MP4. taking into account I mentally working with 50 FPS. is this process achievable with only MP4 format? thank you
Cool, looking forward to see your results!
MP4 or MXF or mov.... doesnt really make any differnce for opener and closer, as we do not "seek" in those files. The only thing that really matters is the audio track/channel layout. But your "main" file should be seekable, so mxf helps, even better I-Frame (but i guess you cannot choose on the format of the main file, can you?)
authorleon wrote: Fri Feb 05, 2021 12:38 pm 2. What does the variable length of inserted clip frames 75 refer to???
the variable i_length_of_inserted_clip_frames: you need to tell how many frames duration the opener clip has
the variable i_outro_length_Frames: same for closer.

This disables the need for the workflow to "analyze the duration of the inserted clips".
authorleon wrote: Fri Feb 05, 2021 12:38 pm You mentioned this: 1) you should start the WF by submitting only the video file. E.g. if you test in a watchfolder, exclude *.txt... the WF calculates the text files name from the video file name and waits 1 hour until it exists. Sure you could easily exchange this and submit the text file, then calculate the video's file name (if the extension of the video is always the same, e.g. *.mxf).

I do not naturally quite understand this. I tested the system and put the files directly in the folder and everything seemed to work. from what I understand. you are suggesting that I should delay the text file being added into the in folder? if that is the case, a CMD executed can be used to move the text file with the correct name from one folder to another making the process pretty much automated. I think that's what you mean, but if not please let me know.
Hehe sorry, yeah this is the part i left a little bit open. It is your choice how you start the job. You can start the job using various methods e.g. manual submission but you already say you do it by watchfolder.

So, when using watchfolder, you must decide if you start by the "arrival of ONE file" in the watchfolder, so choose for either watch for .txt or .mxf, whatever comes in as "last" file. If you "monitor" your folder for both files, you will end up with one failed job and one success job in the job monitor.

In the first "populate" node, you see this line:

Code: Select all

$replace("%s_source%",".%s_original_ext%",".txt")
In words: Replace in the SOURCE FILE the ORIGINAL EXTENSION by ".txt". (it is just about strings, it does not really replace any files hehe)
If you do not wish to "start" the job based on the arrival of a .mxf file in the watchfolder but .txt instead, we need to change a little logic in the first populate processor.

In the end, after the first popolate node is finished, you should make sure that:
%s_temp% is the full path to the txt file and
%s_source% is the full path to the main media file
emcodem, wrapping since 2009 you got the rhyme?
authorleon
Posts: 108
Joined: Fri May 08, 2020 5:18 pm

Re: Insert Media after 10 sec

Post by authorleon »

thanks for the reply.

I am testing out the system.

What if you can however quick thing please. think I might have found a bug:

Image

it stays on node number six.

I'm not sure what it could be.

I am running through multiple tests and I will keep you fully updated.


In response to your question to the format I can choose:

Image

Please let me know what would be the best option.

Core goal,
50 FPS, stereo where possible.
MONO if need be to make things easier.
1980x1080.
End Format H264 for Social Media Platforms etc.

Thank you!!
emcodem
Posts: 1652
Joined: Wed Sep 19, 2018 8:11 am

Re: Insert Media after 10 sec

Post by emcodem »

Uhm, i tried to reproduce your issue with "Waiting for resources" using the picture of the workflow you posted but it works for me.
Are you sure that the CPU resources were enough at this time on your machine? ("CPU roof" configuration in Options->Configuration->Host)

Regarding the Format of the clips, just take the same format that you work with usually. As said, for the main clip it does not matter and for the opener/closer, you just choose the Audio layout that works, e.g. 1 stereo track. Choosing MXF as container format is always good.
emcodem, wrapping since 2009 you got the rhyme?
authorleon
Posts: 108
Joined: Fri May 08, 2020 5:18 pm

Re: Insert Media after 10 sec

Post by authorleon »

Strange BUG.

Image

This ONLY happens when CLIP INSERT & OUTRO LOCATION are different. If I use the same file for the clip insert and outro. It works.

I will be back in about 3 hours to continue testing. Please let me know.

Thank you!!!!
emcodem
Posts: 1652
Joined: Wed Sep 19, 2018 8:11 am

Re: Insert Media after 10 sec

Post by emcodem »

Oh, thats my fault, sorry.
What you need to do is to update the "custom avisyht" script to support different opener and closer:


Script for "opener and closer" have 1 track, stereo:

Code: Select all

ffidxfile = "%s_job_work%\idx.idx"
ffidxfile2 = "%s_job_work%\idx2.idx"

#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, 0,%i_insertion_point_frames%)
clip3=Trim(m_clip, %i_insertion_point_frames%,0)

#generate silent audio for insertion clip
audio_null = BlankClip( length=%i_length_of_inserted_clip_frames% ,width=1920, height=1080, color=$000000, channels=30, audio_rate=%i_a_sample_rate%, fps=%f_frame_rate%)
#load Clip to insert
_audio_2 = FFAudioSource("%s_clip_to_insert%",cachefile=ffidxfile)
_video_2 = FFVideoSource("%s_clip_to_insert%",cachefile=ffidxfile,seekmode=0)
_audio_2 = MergeChannels(_audio_2, audio_null)
clip2 = AudioDub(_video_2,_audio_2)

#load outro
audio_null = BlankClip( length=%i_outro_length_frames% ,width=1920, height=1080, color=$000000, channels=30, audio_rate=%i_a_sample_rate%, fps=%f_frame_rate%)
_audio_4 = FFAudioSource("%s_outro_locatoin%",cachefile=ffidxfile2)
_video_4 = FFVideoSource("%s_outro_locatoin%",cachefile=ffidxfile2,seekmode=0)
_audio_4 = MergeChannels(_audio_4, audio_null)
clip4 = AudioDub(_video_4,_audio_4)

m_clip = clip1 + clip2 + clip3 + clip4

Return m_clip

Script for "opener and closer" have 2(or more) tracks, each 1 mono channel:

Code: Select all

ffidxfile = "%s_job_work%\idx.idx"
ffidxfile2 = "%s_job_work%\idx.idx"

#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, 0,%i_insertion_point_frames%)
clip3=Trim(m_clip, %i_insertion_point_frames%,0)

#generate silent audio for insertion clip
audio_null = BlankClip( length=251 ,width=1920, height=1080, color=$000000, channels=30, audio_rate=48000, fps=25)
#load Clip to insert
_audio_21 = FFAudioSource("%s_clip_to_insert%",1,cachefile=ffidxfile)
_audio_22 = FFAudioSource("%s_clip_to_insert%",2,cachefile=ffidxfile)
_audio_2 = MergeChannels(_audio_21,_audio_22)
_audio_2 = MergeChannels(_audio_2, audio_null)
_video_2 = FFVideoSource("%s_clip_to_insert%",cachefile=ffidxfile,seekmode=0)
clip2 = AudioDub(_video_2,_audio_2)

#load outro
audio_null = BlankClip( length=251 ,width=1920, height=1080, color=$000000, channels=30, audio_rate=48000, fps=25)
_audio_41 = FFAudioSource("%s_outro_locatoin%",1,cachefile=ffidxfile2)
_audio_42 = FFAudioSource("%s_outro_locatoin%",2,cachefile=ffidxfile2)
_audio_4 = MergeChannels(_audio_41, _audio_42)
_audio_4 = MergeChannels(_audio_4, audio_null)
_video_4 = FFVideoSource("%s_outro_locatoin%",cachefile=ffidxfile2,seekmode=0)

clip4 = AudioDub(_video_4,_audio_4)

m_clip = clip1 + clip2 + clip3 + clip4

Return m_clip
emcodem, wrapping since 2009 you got the rhyme?
authorleon
Posts: 108
Joined: Fri May 08, 2020 5:18 pm

Re: Insert Media after 10 sec

Post by authorleon »

Hello emcodem,

Sorry for the delay.

Okay. I am testing it out.. But now with the same videos, it does not work??? :?: :?: :?:

I think it my be something small. I am testing right now.

Image
emcodem
Posts: 1652
Joined: Wed Sep 19, 2018 8:11 am

Re: Insert Media after 10 sec

Post by emcodem »

Hi,
Above, i Provided two scripts, one for Mono Audio tracks, one for stereo. I have the feeling that you used the Script for Stereo but your clips only have 1ch per track?
emcodem, wrapping since 2009 you got the rhyme?
authorleon
Posts: 108
Joined: Fri May 08, 2020 5:18 pm

Re: Insert Media after 10 sec

Post by authorleon »

Yes... I am on the case... Testing it all out. Thank you!!! I will get back to you.

You are awesome!!
authorleon
Posts: 108
Joined: Fri May 08, 2020 5:18 pm

Re: Insert Media after 10 sec

Post by authorleon »

Hello,

You are right about the mono track. But get this:

Image

It works IF clip insert is the same as s_outro_location???

You can see the error with the index.

You can see the success here:

Image

We are so close. Thanks man!!!
Post Reply