[FFmpeg-trac] #10898(ffmpeg:new): gop_size (GopPicSize) defaults to 65535 in hevc_qsv encoding - regression / change of default behavior

FFmpeg trac at avcodec.org
Sat Mar 9 20:59:56 EET 2024


#10898: gop_size (GopPicSize) defaults to 65535 in hevc_qsv encoding - regression /
change of default behavior
--------------------------------+----------------------------------
             Reporter:  fedy    |                     Type:  defect
               Status:  new     |                 Priority:  normal
            Component:  ffmpeg  |                  Version:  6.0
             Keywords:          |               Blocked By:
             Blocking:          |  Reproduced by developer:  0
Analyzed by developer:  0       |
--------------------------------+----------------------------------
 Summary of the bug:
 Seems like the default behavior of the QuickSync hevc_qsv encoder (or
 maybe ffmpeg as a whole) regarding gop_size have changed. On ffmpeg 6.0.1,
 if not specified, it defaults to 65535 which results in unseekable encodes
 (single I frame / IDR frame). My previous test encodes (that were probably
 still using ffmpeg version 5) show it used to be 248 for a 25fps video
 which is much more reasonable.

 How to reproduce:
 {{{
 % ffmpeg -hide_banner -loglevel verbose -hwaccel qsv
 -hwaccel_output_format qsv -c:v h264_qsv -i input.mp4 -map 0 -map
 -0:d:m:handler_name:TimeCodeHandler -c copy -copy_unknown -c:v hevc_qsv
 -global_quality 18 -preset slow -vf scale_qsv=format=p010le -write_tmcd
 auto output.mp4

 ffmpeg version 6.0.1
 built on ... (Fedora 38 / RPM Fusion)
 }}}

 Other notes:
 This behavior isn't completely new - found a reddit thread mentioning the
 behavior change about a year ago:
 https://www.reddit.com/r/ffmpeg/comments/zjwm4r/trouble_with_ffmpeg_using_quicksync_encoded_files/

 Looking at the output from:

 {{{
 ffmpeg -h encoder=hevc_qsv
 }}}

 I notice several options of type <int> where the declared range is -1 to
 65535. Looks kind of weird: maybe these are 32bit signed values
 everywhere, just combining a 16-bit unsigned value range (0-65535) and a
 -1 "default/auto" and everything is fine, but if at any place they are
 interpreted as 16bit then -1 and 65535 overlap (they are represented as
 same 16bit bit pattern). Couldn't this be the reason behind the weird
 65535 default?

 Probably unrelated:
 I also can't seem to make the following options work:
 {{{
 -extbrc 1 -adaptive_i 1 -adaptive_b 1
 }}}
 ... they show up as:
 {{{
 [hevc_qsv @ 0x55edcbee4340] BitrateLimit: unknown; MBBRC: unknown; ExtBRC:
 OFF
 [hevc_qsv @ 0x55edcbee4340] Trellis: auto
 [hevc_qsv @ 0x55edcbee4340] RepeatPPS: OFF; NumMbPerSlice: 0; LookAheadDS:
 unknown
 [hevc_qsv @ 0x55edcbee4340] AdaptiveI: unknown; AdaptiveB: unknown;
 BRefType:pyramid
 }}}
 ... in ffmpeg output

 My test platform is: Intel Pentium Silver J5005 (Gemini Lake)
-- 
Ticket URL: <https://trac.ffmpeg.org/ticket/10898>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker


More information about the FFmpeg-trac mailing list