Some applications require video content to be encoded and uploaded to a remote destination in a fixed time. This paper proposes a novel approach to address this challenge, based on online adaptation of compression parameters to control both encoding and uploading time. In particular, an algorithm to accurately predict the encoding time and bit-rate resulting from using a given quantisation parameter to encode the next frames in the sequence is proposed. This is used to drive decisions during the encoding process, to maintain the cumulative time needed to encode and transmit the video sequence within the constraints. Experimental evaluation shows that when using the proposed method, time constraints can be met with high accuracy under a variety of different target times and bandwidth conditions.