Skip to content
Permalink
Browse files

ffmpeg: Set default output format to hwaccel's native format

I think this is usually what the user wants - if they are using
an hwaccel, they probably want full hardware transcoding to
work.
  • Loading branch information
philipl committed Jun 17, 2017
1 parent 1edbf5e commit 453c4d8dd9cb0e9ed2ac594d05420a34f46116c6
Showing with 3 additions and 1 deletion.
  1. +3 −1 ffmpeg_opt.c
@@ -708,6 +708,7 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
char *discard_str = NULL;
const AVClass *cc = avcodec_get_class();
const AVOption *discard_opt = av_opt_find(&cc, "skip_frame", NULL, 0, 0);
enum AVPixelFormat default_pix_fmt = AV_PIX_FMT_NONE;

if (!ist)
exit_program(1);
@@ -805,6 +806,7 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
for (i = 0; hwaccels[i].name; i++) {
if (!strcmp(hwaccels[i].name, hwaccel)) {
ist->hwaccel_id = hwaccels[i].id;
default_pix_fmt = hwaccels[i].pix_fmt;
break;
}
}
@@ -837,7 +839,7 @@ static void add_input_streams(OptionsContext *o, AVFormatContext *ic)
"format: %s", hwaccel_output_format);
}
} else {
ist->hwaccel_output_format = AV_PIX_FMT_NONE;
ist->hwaccel_output_format = default_pix_fmt;
}

ist->hwaccel_pix_fmt = AV_PIX_FMT_NONE;

0 comments on commit 453c4d8

Please sign in to comment.