I can't see myself wanting to handle the complexities of setting up x264 command line parameters. However, using the Handbrake command line program for H.264 encoding in a VAP post process script has been common for a while. The HB parameters can be perfected using the GUI version and pasted into the script. The catch is getting the metadata into the resulting .mp4 (or .m4v) file. There are two options for that, both of which would require you to configure VAP to produce pyTivo metadata files. These are programs that read pyTivo MD files and insert the MD into mpeg4 files:
pyTivoParsley and
pyTiVoMetaPopper (available on VAP download site).
pyTiVoParsley:
The documentation is in the zip download. I think it needs a little updating to get the optimum MD structure and it will never quite equal the MD insertion done by VAP because the pyTivo MD file doesn't capture as much info.
pyTiVoMetaPopper:
The documentation is in
this thread. This program works on both mpeg4 and wtv/dvr-ms targets and thus carries extra baggage if all you want is mpeg4 insertion. It also needs to be updated slightly so it doesn't require the input video file to be present in order to run. A major factor to be considered is that it works on all file-sets in the input and output folders each time it is invoked. Thus if you want to use it on a per-file basis you have to move or delete one of the files after each invocation.
My guess is you would prefer to use an updated version of pyTivoParsley, although the current version is plenty good for test purposes.
You can download an example post process script for HB encoding
here. It's a little outdated but the required mods should be fairly obvious.
I'll be glad to help as needed as you get further into this.
Another approach comes to mind:
VAP uses AtomicParsley to insert MPEG4 metadata so it already composes a string of command line options for AP. It could dump that string to a text file (invoked by a new VAP CL arg) in the output folder. Then the postprocess script could run AP directly using those options, thus resulting in metadata insertion exactly the same as what VAP now does. Since VAP already distributes the AP executable, the user would not even have to download it.