The document presents OTEC, an optimized transcoding task scheduler for cloud and fog environments aimed at improving video encoding efficiency by balancing cost and time. It utilizes a mixed integer linear programming model to allocate resources based on priorities, demonstrating that time-optimized scenarios are 30.5% faster but 24.78% more expensive than cost-optimized ones. The findings emphasize the trade-offs in transcoding processes influenced by administrator and resource priorities.