FFASTrans - FranceBB & Algie Custom Workflows

Questions and answers on how to get the most out of FFAStrans
User avatar
FranceBB
Posts: 258
Joined: Sat Jun 25, 2016 3:43 pm
Contact:

FFASTrans - FranceBB & Algie Custom Workflows

Post by FranceBB »

FFAStrans FranceBB Workflows: Link

This is a package which contains some of the workflows I and Algie made that are meant to be used in the broadcast company I work for.
Unfortunately, some of them have not been included, but the reason is that those I removed were using FTP or had other critical credentials to access our internal server inside our .bat or other blocks and therefore I couldn't safely share them.
Anyway, those inside the build are pretty much the most used one, so they should cover a broad range of cases.
They're mainly focused on MPEG-2 XDCAM50 encoding, however, they can be easily modified and used to encode and deliver other formats.
The only "catch" is that they're really meant for PAL regions, so I don't know how useful can be for those living in NTSC countries.
Please note that we have three platforms:
TG24 which stands for "Television Journal 24h" in other words a round-the-clock news channel. It's basically the non-English version of Sky News.
SPORT which is basically dedicated to sports channels.
PCE which stands for "Production Cinema Entertainment" which is dedicated to our cinema channels, our original productions, our general purpose channels and so on, but only for "promo" i.e "commercial ads", in fact the real programs that fall in this category are encoded with manually written scripts and 16bit planar precision post-processing to deliver the best possible quality all the time and those tasks couldn't be automatized (why would I even care to go to work if they could? xD).
Anyway, those three platforms have three different RAID-6 storages in which there are different input folders, namely "Avisynth Server 1" -> TG24 / SPORT / PCE -> "Node 1 / 2 / 3 / 4" -> OUTPUT.
There's a conditional logic that outputs the file to the correct folder according to which platform is being used (i.e in which server the input folder is) and which node has been used.
There are also some workflows that deliver to either Vantage or to MediaDirector so that they can check-in the file inside AVID Interplay Access automatically.
Alright, let's get started and dig into our workflows.

Images: https://imgur.com/a/BY9coy8

01 - AppleProRes_in

This is a very simple workflow.
It's not really used much as it's just a quick and dirt AppleProRes encode using iCodecPro from ffmpeg.
The only reason it's there is that sometimes, when we have to deliver files (that have already been post-processed and encoded and that are ready to air) to other companies they ask us to send them in AppleProRes, so I needed something to automatize it.

02 - Avisynth_in & ANY

This is more like it.
This workflow is one of the most used.
It basically uses Avisynth x64 to index the source file, it checks the audio channels and make sure to always have 8 mono channels (if you have like a stereo file with just FL FR, it then maps CH1 FL CH2 FR, CH3 FL CH4 FR CH5 FL CH6 FR CH7 FL CH8 FR) and it performs a Loudness Correction to -24 LUFS, then it bob-deinterlaces everything if needed, and it decides what to do:
if it's 23.976fps or 24fps it performs a 4% speed-up + pitch adjustment to 25p and encodes it as progressive flagged as interlaced
if it's 25p it leaves it alone and encodes it as progressive flagged as interlaced
if it's 25i it bob-deinterlaces it to 50p and then re-interlaces it correctly to avoid any interlacing artifacts
if it's below 23p then it blends it to 50p, divides it in fields and encodes it to 25i
if it's above 24p but below 50 it blends it to 50p, divides it in fields and encodes it to 25i
if it's 29.970p then it blends it to 50p, divides it in fields and encodes it to 25i
if it's 29.970i then it bob-deinterlaces it to 60p, blends it to 50p, divides it in fields and encodes it to 25i
if it's 50p then it divides it in fields and encodes it to 25i
if it's 60p then it blends it to 50p, divides it in fields and encodes it to 25i
if it's above 60p but below 70p, it blends to 50p, divides it in fields and encodes it to 25i
if it's above 70p then it just drops frames to 50p, divides it in fields and encodes it to 25i

Then it brings luma and chroma in Limited TV Range 8bit planar 0.7mV 16-235 by clipping, lastly it encodes and delivers the file.

Of course, if you have a structure like:

Folder: Shooting\Day1\CameraA\000454.mov

it creates the very same path in the output:

Folder: Shooting\Day1\CameraA\000454.mxf

so if you have several folders and sub-folders with many different files inside, you can copy all of them in the input watchfolder and it will create them back in the output.

Lastly it will perform "Cache Cleanup" just like any other workflow which means that the input file is gonna be deleted along with all the temporary files created in-between.

03 - Avisynth_in Antialiasing SLOWMO

It performs a slow-motion of the input files using AssumeFPS, then it performs anti-aliasing and brings luma and chroma to limited TV range and encodes.
Audio is preserved and slowed down as well when possible (i.e unless the clip is slowed down too much).


04 - Avisynth_in P2

This takes a Panasonic P2 folder structure which has 1 video and 4 different mono PCM audio channels NOT Embedded (i.e not muxed together).
It uses the built-in function of FFASTrans which reads the .xml metadata and uses them to detect video and audio files and put them together using Avisynth.
After that the very same logic is applied, namely Loudness Correction to -24 LUFS and Luma and Chroma in Limited TV Range.
The user can choose whether the files within the folder have to be appended together to make a single final Masterclip or whether they should be encoded one at a time.

05 - Avisynth_in SD

This is rarely used nowadays, but it takes the file in input and encodes in IMX50.
The same logic is applied: 8 audio channels, Limiter TV Range and Loudness Correction.

06 - Avisynth Remaster

This is still at a very beta stage and it hasn't been used yet other than for some tests.
Basically, what it does, is that it receives an old SD file and it upscales it to FULL HD in the least painful way (NNEDI3 + Spline64 with 16bit planar precision) and it also performs automatic white-balancing and it attempts to fix color-dominance if detected (i.e blue tint etc). Lastly, it performs a quick and dirt sharpening, clips everything to 16-235 and performs loudness correction.
It's still a beta 'cause I still have to decide which Sharpening filter I'm gonna use (LSFMod, SeeSaw etc) and whether I'm gonna use GamMac in a sort of automatic fashion or not.
Besides, I still haven't made up my mind about which option I'm gonna use to go from BT601 to BT709: the old ColorMatrix which works in 8bit planar only? Matrix from HDRTools which works in 16bit interleaved? I still have to make a few tests.
Last but not least, I don't know whether I'm gonna go on with it or if I'm gonna include the whole Fred Van de Putte series of filters instead.
Again, I gotta test.

07 - DNxHD

Quick and dirt workflow that does exactly what the AppleProRes one does, but for DNxHD.

08 - HuffYUV_in

This is for lossless mezzanine file only that have to be encoded as it encodes the input in HuffYUV lossless.

09 - Linear Interpolation

The workflow speaks for itself as it uses MVTools and its forward and backward vectors to perform linear interpolation to 50p in case it's needed.
This workflow does not maintain AR (contrary to the other workflows) and it's only used when it's really necessary, like if we have a mixed content show and we want everything to be at true 25i and smooth, however it's only used if the director specifically tells us to do so as he becomes responsible for eventual artifacts created every now and then by linear interpolation and of course if there are too many or if he thinks that it's not the result he wanted, he can definitely tell us to do it again without linear interpolation and have an hybrid show instead (progressive + interlaced).

10 - Linear Transformations 1, 2, 3

These 3 workflows apply one of my matrices of linear transformation to map each and every point of a curve into another with 16bit precision.
All calculations are done in PlanarRGB 16bit and the result is dithered down to 8bit planar using the Floyd-Steinberg error diffusion.
The resulting output is then limited to 8bit TV Range 16-235, loudness corrected to -24 LUFS and encoded.
It performs the following linear transformation:

HLG BT2020 -> Linear BT709
PQ BT2100 -> Linear BT709
S-Log3 -> Linear BT709
C-Log3 -> Linear BT709
Log-C -> Linear BT709
D-Log -> Linear BT709

Of course it can be replicated and used with any of my LUTs to perform whatever linear transformation you want.
As for HLG and PQ, I've been thinking for a while about using a tone-mapping algorithm instead, namely Reinhard, using the plugin from Jean-Philippe Scotto di Rinaldi (although the one from Donald Graft is also a perfectly valid alternative, so I don't which one I'm gonna use or if I'm gonna keep a custom LUT instead).

11 - Slowmo ANY

It performs slow-motion using AssumeFPS() to anything unless it's 25p. In that case it leaves it as it is.
It's the same as Slowmo-Antialiasing, but it doesn't do any antialiasing.
As always, the output is brought to 8bit Limited TV Range 16-235.

12 - x262_in

It's a conversion to XDCAM 25i without using any fancy conditional logic or Avisynth.
It started with x262, but I then changed it to ffmbc and now it's using the MPEG-2 encoder from ffmpeg with the built-in logic of the XDCAM block made by Steinar Apalnes.

13 - x262 DVD in

Just like the one above, it started with x262 but now it's using the MPEG-2 encoder inside ffmpeg and it produces an ISO file that it's ready to be burned in a PAL DVD.
The reason why there's no manually-written conditional logic at all other than the one written by Steinar for this particular block is that if we make a DVD it's from one of our final file that is already ready to go on air, therefore nothing fancy has to be done other than interlace-aware downscaling and BT709 to BT601 conversion.
As a matter of fact, this replaced the old method of using physical DVD recorders to literally make a DVD from the hardware-downscaled FULL HD SDI input.

14 - x264

First of all, we don't internally encode to H.264 straight away and it's generally used as something that we send to either users or external productions that need it as a backup.
There are quite a few watchfolders, some of them encode in FULL HD with a very low bitrate, some other downscale to a ridiculous resolution and encode it with a file-size that is just right for WhatsApp, some other make a crappy proxy that is used... you know... as a proxy to just know what that file is about and one is used to encode the input files to 50p FULL HD BT709 4:2:2 8bit planar 25 Mbit/s and that's the file that is sent as a very last resort backup to external on-field productions if everything else fails.
For instance, if they're in an OBI-Van and the masterfile of the intros can't be used and their second HDD backup fails and they can't connect to our storage and their disk backup fails as well then they're gonna use this 25Mbit/s H.264 file for the opening before the program begins. Opening means just a small intro or a logo, a bumper etc.


15 - x265

It can be used to either encode a file that is already ready to go but in H.265 with a very low crf to be delivered to users via internet (nothing linear) or as an alternative to HuffYUV for lossless mezzanine file if the x265_lossless fodler is selected instead.

16 - Avisynth Metadata

The name is misleading since it doesn't have to do anything with metadata, but it's the name of the department who uses it "Metadata Management".
Basically those are cheap low-res proxy that are generally sent away to celebrities that have been interviewed and wanna have a copy before it goes on air.
It's 25p, low quality, H.264, with a logo and a timecode to avoid leaks since we don't really have any control of the file once it has been sent out to the celebrity.
As a matter of fact, it's done by another department and not the one I work in 'cause they are aware of legal rights and other stuff about what can and cannot be done (I don't know any of that so I don't really mess up with that).


Alright, that's pretty much it. :)

Have a good week-end,
bye!
Last edited by FranceBB on Thu Oct 15, 2020 12:21 pm, edited 2 times in total.
momocampo
Posts: 594
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: FFASTrans - FranceBB & Algie Custom Workflows

Post by momocampo »

Hello FranceBB and Algie
Amazing!! It is so generous of you !! Thank you so much!
I already see workflows that will be very useful to me :D
Thank you guys and "bravo vous êtes les meilleurs !"
Chères.
B.
emcodem
Posts: 1752
Joined: Wed Sep 19, 2018 8:11 am

Re: FFASTrans - FranceBB & Algie Custom Workflows

Post by emcodem »

How nice from you! As most of your nodes are for watching in different folders and based on the folder, set some variables for output delivery, i know which "new feature" will be discussed internally next... we need to keep the watchfolders in a list just as most other transcoders do.
I am sure we will discuss lots of details with you next but currently i am interested in where you use this string replacement you asked for lately, i did not find any workflow that uses it...
emcodem, wrapping since 2009 you got the rhyme?
momocampo
Posts: 594
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: FFASTrans - FranceBB & Algie Custom Workflows

Post by momocampo »

Hello ,
I'm just starting to discover your workflows but I think I found a little error in the "x264 workflow"(error probably during translation). Into the 2 nodes called "bitrate", you populate a variable called "%s_myvariablebitrate" with 2 other variables. These 2 other variables are those populated just before -> %s_myvariableduration% and %s_myfixedfilesize% BUT the "m" is missing for "s_myvariableduration".
Otherwise, it is really a good job and well done to keep original path for destination ;)
Cheers.
Benjamin
User avatar
FranceBB
Posts: 258
Joined: Sat Jun 25, 2016 3:43 pm
Contact:

Re: FFASTrans - FranceBB & Algie Custom Workflows

Post by FranceBB »

momocampo wrote: Sun May 31, 2020 11:29 am Hello ,
I'm just starting to discover your workflows but I think I found a little error in the "x264 workflow"(error probably during translation). Into the 2 nodes called "bitrate", you populate a variable called "%s_myvariablebitrate" with 2 other variables. These 2 other variables are those populated just before -> %s_myvariableduration% and %s_myfixedfilesize% BUT the "m" is missing for "s_myvariableduration".
Otherwise, it is really a good job and well done to keep original path for destination ;)
Cheers.
Benjamin
Oh crap. Yes, you're right, an "m" is missing.
I made a boo boo during the translation. I'll fix that. Thanks. :)
emcodem wrote: Sun May 31, 2020 8:20 am currently i am interested in where you use this string replacement you asked for lately, i did not find any workflow that uses it...
Well, that's because we haven't implemented it yet, we were just testing it to create folders in the output according to a certain custom logic, but we haven't done that yet.
momocampo wrote: Sun May 31, 2020 7:17 am Hello FranceBB and Algie
Amazing!! It is so generous of you !! Thank you so much!
I already see workflows that will be very useful to me :D
Thank you guys and "bravo vous êtes les meilleurs !"
Chères.
B.
Well this was the least I could do. :)
emcodem wrote: Sun May 31, 2020 8:20 am As most of your nodes are for watching in different folders and based on the folder, set some variables for output delivery, i know which "new feature" will be discussed internally next... we need to keep the watchfolders in a list just as most other transcoders do.
That would be nice as well, considering that it's getting "crowded" in there. :P
Anyway, it's still possible to handle that as it is now, so at the moment is fine.
Ghtais
Posts: 164
Joined: Thu Jan 19, 2017 11:06 am

Re: FFASTrans - FranceBB & Algie Custom Workflows

Post by Ghtais »

Hi !!

thank you very much for sharing your workflows.
Just a question : is it possible to have a 0.9.4 FFASTrans version (If you still have it of course) ?

thank you.
crispyjones
Posts: 106
Joined: Wed Dec 27, 2017 3:21 am

Re: FFASTrans - FranceBB & Algie Custom Workflows

Post by crispyjones »

Thanks for sharing! Can't wait to dig into these workflows.
momocampo
Posts: 594
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: FFASTrans - FranceBB & Algie Custom Workflows

Post by momocampo »

Ghtais wrote: Mon Jun 01, 2020 8:52 pm Hi !!

thank you very much for sharing your workflows.
Just a question : is it possible to have a 0.9.4 FFASTrans version (If you still have it of course) ?

thank you.
I send you a pm Ghtais.
cheers.

Benjamin
taner
Posts: 204
Joined: Sun Jun 19, 2016 6:36 pm

Re: FFASTrans - FranceBB & Algie Custom Workflows

Post by taner »

Thanks for sharing!
momocampo
Posts: 594
Joined: Thu Jun 08, 2017 12:36 pm
Location: France-Paris

Re: FFASTrans - FranceBB & Algie Custom Workflows

Post by momocampo »

Hello dear @FranceBB,
I continue to discover your wf and necessarily I seek to understand :D
You apply a loudness correction to -24 LUFS but I must admit I didnt know that's possible with avisynth. You use "n=Normalize(r, 0.22)" but is it a real loudness correction?I mean, if I'm not mistaken, a volume correction is not normalization. Ok, I'm not an audio pro but I was wondering how it works.
You target -24 LUFS, can I ask you how to do it for -23?
Thank you so much.

Benjamin.

PS: I think I will have more questions about other workflows too :D
Post Reply