diff --git a/src/video_compress/libavcodec.cpp b/src/video_compress/libavcodec.cpp index 87d0c3aa7..fce375396 100644 --- a/src/video_compress/libavcodec.cpp +++ b/src/video_compress/libavcodec.cpp @@ -1236,7 +1236,7 @@ static bool configure_with(struct state_video_compress_libav *s, struct video_de //get all AVPixelFormats we can convert to and pick the first auto fmts = get_available_pix_fmts(desc, codec, s->requested_subsampling, VIDEO_CODEC_NONE); s->sws_out_pixfmt = s->selected_pixfmt; - s->selected_pixfmt = fmts.front(); + s->selected_pixfmt = fmts.empty() ? AV_PIX_FMT_UYVY422 : fmts.front(); log_msg(LOG_LEVEL_NOTICE, MOD_NAME "Attempting to use swscale to convert from %s to %s.\n", av_get_pix_fmt_name(s->selected_pixfmt), av_get_pix_fmt_name(s->sws_out_pixfmt)); if(!find_decoder(desc, s->selected_pixfmt, &s->decoded_codec, &s->decoder)){ //Should not happen as get_available_pix_fmts should only