You can use s_options just as in my other example i posted to you before with nvenc.
It goes like: disable encoding - calculate the encoding cmd - modify the encoding cmd - execute encoding in a cmd proc
When you replace stuff in the internally calculated encoding cmd, you must make sure that it works in all cases, e.g. in this case i replace
by
Note the comma after 256, it is because other filter already exist in the encoding cmd.
Why did i choose this? Because -vf is always there, independent of the source file, the internally calculated ffastrans encoding cmd will always have carry exactly one "-vf" character.
Real life example:
Code: Select all
-vf sidedata=delete,metadata=delete,setrange=tv,scale=interl=1,format=yuv422p,bwdif=mode=0:parity=0,format=yuv420p,setfield=prog,setsar=r=1:max=1
The internally calculated encoding cmd looks like this. it does not have any scale filter because the h264 processor was set to encode to the same resolution as input has.
Now we can safely replace -vf as stated above, resulting in this filter cmd:
Code: Select all
-vf scale=-2:256,sidedata=delete,metadata=delete,setrange=tv,scale=interl=1,format=yuv422p,bwdif=mode=0:parity=0,format=yuv420p,setfield=prog,setsar=r=1:max=1
voila, we successfully inserted your desired scale filter into the internally calculated encoding command, from here we just need to execute the encoding in a cmd processor, see attached workflow example.
Of course, nothing speaks against combining this exapmle with the nvenc one and replacing libx264 by h264_nvenc (along with the profile settings)