Hello
While I’m uncertain of your workflow, I’d suggest this interface is the ideal place to make the determination as to whether you transcode or not. Depending on what you are looking to do, it may be a better alternative to redefine which template is used (3rd party site, you can focus on the interfaces used) or just, in general, use some additional interfaces as found here (a subset of the former solution).
If this does not help in your solution, can you define further as to what (and where) you are looking to implement your solution?
Thanks,
Matt