diff --git a/ffmpeg.c b/ffmpeg.c
index 085bb00fcc139ff9fbec6d59a07551fc33337095..2ee4032b398008c7d77dec0aee24376a1c101950 100644
--- a/ffmpeg.c
+++ b/ffmpeg.c
@@ -2078,7 +2078,7 @@ static int transcode_video(InputStream *ist, AVPacket *pkt, int *got_output, int
     frame_sample_aspect= av_opt_ptr(avcodec_get_frame_class(), decoded_frame, "sample_aspect_ratio");
     for(i=0;i<nb_output_streams;i++) {
         OutputStream *ost = ost = &output_streams[i];
-        if(check_output_constraints(ist, ost)){
+        if(check_output_constraints(ist, ost) && ost->encoding_needed){
             if (!frame_sample_aspect->num)
                 *frame_sample_aspect = ist->st->sample_aspect_ratio;
             decoded_frame->pts = ist->pts;