[FFmpeg-trac] #9481(undetermined:new): VA-API + QSV H264 => MPEG2 transcode PSNR dropped by 25%

FFmpeg trac at avcodec.org
Thu Oct 28 15:33:21 EEST 2021

#9481: VA-API + QSV H264 => MPEG2 transcode PSNR dropped by 25%
             Reporter:  eero-t       |                     Type:  defect
               Status:  new          |                 Priority:  normal
            Component:               |                  Version:
  undetermined                       |  unspecified
             Keywords:               |               Blocked By:
             Blocking:               |  Reproduced by developer:  0
Analyzed by developer:  0            |
 Between following FFmpeg commits:
 * 2021-09-22 a487635b85: avcodec/dynamic_hdr10_plus: check size before
 using it
 * 2021-09-23 6e26015a6b: avformat/astenc: Simplify writing padding

 PSNR for following transcode operation:
 $ ffmpeg -hwaccel vaapi -vaapi_device /dev/dri/renderD128
 -hwaccel_output_format vaapi -i 720x480p_30.00_4mb_h264_cabac_180s.264
 -c:v mpeg2_vaapi -b:v 2000K -compression_level 4 -an -vframes 4800 -y

 Has dropped by 25%, as measured by:
 $ ffmpeg -i 720x480p_30.00_4mb_h264_cabac_180s.264 -i 0039_SD03MP2_1.0.mpg
 -an -vframes 2399 -filter_complex psnr -f null -

 (I'm using fewer frames in PSNR check than for transcode, because there
 were odd results if all frames are used for PSNR calculation.)

 Between same commits, PSNR for similar transcode done using QSV:
 {{{ffmpeg -hwaccel qsv -qsv_device /dev/dri/renderD128 -c:v h264_qsv -i
 720x480p_30.00_4mb_h264_cabac_180s.264 -c:v mpeg2_qsv -b:v 2000K
 -compression_level 4 -an -vframes 4800 -y 0039_SD03MP2_1.0.mpg}}}

 also dropped to same value, but the drop for QSV transcode PSNR was
 smaller because it had dropped from the original VA-API PSNR value by 7%
 already earlier, between these FFmpeg commits:
 * 2021-03-14 1af4885014: avcodec: add a mention about get_encode_buffer in
 the old encode API doxy
 * 2021-03-15 63344337f9: libavformat/hls: Reset options after
 open_url_keepalive() fails

 (I did not pay attention to that earlier/smaller QSV PSNR drop because
 there was at the same time marginal (<1%) perf increase, and updates in
 underlying drm-tip kernel & MediaSDK components.)

 See also #9377.

 Now results of both VA-API and QSV transcode operations give same (low)
 PSNR as using MediaSDK tool to do same transcode has been giving:
 {{{sample_multi_transcode -i::h264 720x480p_30.00_4mb_h264_cabac_180s.264
 -o::mpeg2 0039_SD03MP2_1.0.mpg -b 2000 -u 4 -n 4800 -async 4 -hw}}}
Ticket URL: <https://trac.ffmpeg.org/ticket/9481>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker

More information about the FFmpeg-trac mailing list