1. A method comprising: receiving a resource-independent input graph specifying one or more functions to be performed on a media input; determining, for each one of the one or more functions, from a plurality of resources, at least one available resource capable of executing the each one of the one or more functions; generating multiple instances of an execution graph, each of the multiple instances specifying a determined available resource for each of the one or more functions; selecting one of the multiple instances of the execution graph based on an estimated cost of executing each of the multiple instances; and compiling the selected instance of the execution graph for execution using the specified available resources of the selected instance.