[FFmpeg-trac] #9432(avfilter:new): [regression] jpeg autorotate breaks vaapi 422 jpeg decode
FFmpeg
trac at avcodec.org
Tue Sep 21 07:51:54 EEST 2021
#9432: [regression] jpeg autorotate breaks vaapi 422 jpeg decode
-------------------------------------+-------------------------------------
Reporter: U. Artie | Owner: (none)
Eoff |
Type: defect | Status: new
Priority: normal | Component: avfilter
Version: git-master | Resolution:
Keywords: vaapi | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Comment (by U. Artie Eoff):
Replying to [comment:3 James]:
> Replying to [comment:2 U. Artie Eoff]:
> > hmm... 420 jpeg might be broken, too, with vaapi if file has exif
orientation.
> Yes, pretty much any jpeg sample with orientation exif and any h264
stream with Display Orientation SEI will be affected. What i did was make
ffmpeg look at codec exported display matrix instead of only container
exported.
>
> Does the following fix it for you?
>
> {{{
> diff --git a/fftools/ffmpeg_filter.c b/fftools/ffmpeg_filter.c
> index da0d4faf54..cf52cc03ba 100644
> --- a/fftools/ffmpeg_filter.c
> +++ b/fftools/ffmpeg_filter.c
> @@ -699,6 +699,7 @@ static int configure_input_video_filter(FilterGraph
*fg, InputFilter *ifilter,
> {
> AVFilterContext *last_filter;
> const AVFilter *buffer_filt = avfilter_get_by_name("buffer");
> + const AVPixFmtDescriptor *desc;
> InputStream *ist = ifilter->ist;
> InputFile *f = input_files[ist->file_index];
> AVRational tb = ist->framerate.num ? av_inv_q(ist->framerate) :
> @@ -756,7 +757,8 @@ static int configure_input_video_filter(FilterGraph
*fg, InputFilter *ifilter,
> av_freep(&par);
> last_filter = ifilter->filter;
>
> - if (ist->autorotate) {
> + desc = av_pix_fmt_desc_get(ifilter->format);
> + if (ist->autorotate && desc && !(desc->flags &
AV_PIX_FMT_FLAG_HWACCEL)) {
> int32_t *displaymatrix = ifilter->displaymatrix;
> double theta;
>
> }}}
Yes, this patch fixes it (i.e. by avoiding hwaccel formats).
--
Ticket URL: <https://trac.ffmpeg.org/ticket/9432#comment:4>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list