It's just a matter of putting the right settings in. "Lossless" is just a name for a particular set of settings. If you get the settings right, then you don't need the name.
If you're doing this without the name, then you'll probably need to read the documentation for your encoder, to see what actual settings it needs. Do that, and you'll have your result, albeit the long way around.