[FFmpeg-user] Interlaced h264_vaapi?

Richard F lists at keynet-technology.com
Thu May 6 14:08:08 EEST 2021


I'm looking to get interlaced output from the h264_vaapi encoder, so far 
without success. The equivalent command produces interlaced output from 
libx264. h264_vaapi is reporting that it's producing interlaced output, 
but mediainfo and ffmpeg always say progressive. Is it possible ?

The source is interlaced 1080i TV.

I can't find the meaning of "Invalid RefPicListX[] entry" on log output 
or its significance, it's always output. This is using the i965 Intel 
driver on an Ivy Bridge CPU.

I have tried adding '-field_order tt', which changes log output with 
x264, but doesn't make output interlaced in either case. +ildct appears 
to be the trigger to get x264 to produce interlaced output, but perhaps 
no effect on vaapi ?

VAAPI: progressive output

ffmpeg -y -loglevel info -nostats -hwaccel vaapi -vaapi_device 
/dev/dri/renderD128 -hwaccel_output_format vaapi -ss 0 -to 120 -i 
"/mnt/lvm0/TV/BBC_News/2021-04-24.22.00.2-0.rec/00001.ts" -c:v:0 
h264_vaapi -flags +loop+ilme+ildct -f mpegts test.ts

ffmpeg version N-102476-g45658da737 Copyright (c) 2000-2021 the FFmpeg 
developers
   built with gcc 7 (SUSE Linux)
   configuration: --disable-debug --disable-doc --disable-ffplay 
--disable-ffprobe --disable-htmlpages --enable-gpl --enable-ladspa 
--enable-libaom --enable-libass --enable-libbluray --enable-libbs2b 
--enable-libcdio --enable-libcelt --enable-libdc1394 --enable-libdrm 
--enable-libfdk_aac --enable-libfontconfig --enable-libfreetype 
--enable-libfribidi --enable-libgsm --enable-libjack --enable-libmp3lame 
--enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr 
--enable-libtheora --enable-libtwolame --enable-libv4l2 
--enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp 
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg 
--enable-nonfree --enable-vaapi --enable-vdpau 
--extra-cflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall 
-D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables 
-fasynchronous-unwind-tables -fstack-clash-protection -g' --logfile=log 
--optflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall 
-D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables 
-fasynchronous-unwind-tables -fstack-clash-protection -g'
   libavutil      57.  0.100 / 57.  0.100
   libavcodec     59.  0.100 / 59.  0.100
   libavformat    59.  0.101 / 59.  0.101
   libavdevice    59.  0.100 / 59.  0.100
   libavfilter     8.  0.101 /  8.  0.101
   libswscale      6.  0.100 /  6.  0.100
   libswresample   4.  0.100 /  4.  0.100
   libpostproc    56.  0.100 / 56.  0.100
failed to open /usr/lib64/dri/hybrid_drv_video.so
[h264 @ 0x375f8c0] mmco: unref short failure
     Last message repeated 1 times
[mpegts @ 0x3759000] start time for stream 2 is not set in 
estimate_timings_from_pts
Input #0, mpegts, from 
'/mnt/lvm0/TV/BBC_News/2021-04-24.22.00.2-0.rec/00001.ts':
   Duration: 00:04:00.24, start: 71407.949544, bitrate: 3446 kb/s
   Program 1
     Metadata:
       service_name    : Service01
       service_provider: FFmpeg
   Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), 
yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 
tbr, 90k tbn
   Stream #0:1[0x101](eng): Audio: aac_latm (LC) ([17][0][0][0] / 
0x0011), 48000 Hz, stereo, fltp
   Stream #0:2[0x102](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> h264 (h264_vaapi))
   Stream #0:1 -> #0:1 (aac_latm (native) -> mp2 (native))
Press [q] to stop, [?] for help
[h264 @ 0x39c8cc0] mmco: unref short failure
WARNING: Invalid RefPicListX[] entry!!! It is not included in DPB
[h264 @ 0x3846840] mmco: unref short failure
[h264_vaapi @ 0x37d55c0] No quality level set; using default (20).
Output #0, mpegts, to 'test.ts':
   Metadata:
     encoder         : Lavf59.0.101
   Stream #0:0: Video: h264 (High), vaapi(tv, bt709, top coded first 
(swapped)), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 90k tbn
     Metadata:
       encoder         : Lavc59.0.100 h264_vaapi
   Stream #0:1(eng): Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
     Metadata:
       encoder         : Lavc59.0.100 mp2
frame= 3000 fps=120 q=-0.0 Lsize=  105103kB time=00:02:01.16 
bitrate=7106.3kbits/s speed=4.85x
video:96318kB audio:5594kB subtitle:0kB other streams:0kB global 
headers:0kB muxing overhead: 3.131535%

libx264: does produce interlaced output

ffmpeg -y -loglevel info -nostats -ss 0 -to 120 -i 
"/mnt/lvm0/TV/BBC_News/2021-04-24.22.00.2-0.rec/00001.ts" -c:v:0 libx264 
-flags +loop+ilme+ildct -f mpegts test.ts

ffmpeg version N-102476-g45658da737 Copyright (c) 2000-2021 the FFmpeg 
developers
   built with gcc 7 (SUSE Linux)
   configuration: --disable-debug --disable-doc --disable-ffplay 
--disable-ffprobe --disable-htmlpages --enable-gpl --enable-ladspa 
--enable-libaom --enable-libass --enable-libbluray --enable-libbs2b 
--enable-libcdio --enable-libcelt --enable-libdc1394 --enable-libdrm 
--enable-libfdk_aac --enable-libfontconfig --enable-libfreetype 
--enable-libfribidi --enable-libgsm --enable-libjack --enable-libmp3lame 
--enable-libopenjpeg --enable-libopus --enable-libpulse --enable-libsoxr 
--enable-libtheora --enable-libtwolame --enable-libv4l2 
--enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp 
--enable-libx264 --enable-libx265 --enable-libxml2 --enable-libzimg 
--enable-nonfree --enable-vaapi --enable-vdpau 
--extra-cflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall 
-D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables 
-fasynchronous-unwind-tables -fstack-clash-protection -g' --logfile=log 
--optflags='-fmessage-length=0 -grecord-gcc-switches -O2 -Wall 
-D_FORTIFY_SOURCE=2 -fstack-protector-strong -funwind-tables 
-fasynchronous-unwind-tables -fstack-clash-protection -g'
   libavutil      57.  0.100 / 57.  0.100
   libavcodec     59.  0.100 / 59.  0.100
   libavformat    59.  0.101 / 59.  0.101
   libavdevice    59.  0.100 / 59.  0.100
   libavfilter     8.  0.101 /  8.  0.101
   libswscale      6.  0.100 /  6.  0.100
   libswresample   4.  0.100 /  4.  0.100
   libpostproc    56.  0.100 / 56.  0.100
[h264 @ 0x2217f80] mmco: unref short failure
     Last message repeated 1 times
[mpegts @ 0x22116c0] start time for stream 2 is not set in 
estimate_timings_from_pts
Input #0, mpegts, from 
'/mnt/lvm0/TV/BBC_News/2021-04-24.22.00.2-0.rec/00001.ts':
   Duration: 00:04:00.24, start: 71407.949544, bitrate: 3446 kb/s
   Program 1
     Metadata:
       service_name    : Service01
       service_provider: FFmpeg
   Stream #0:0[0x100]: Video: h264 (High) ([27][0][0][0] / 0x001B), 
yuv420p(tv, bt709, top first), 1920x1080 [SAR 1:1 DAR 16:9], 25 fps, 25 
tbr, 90k tbn
   Stream #0:1[0x101](eng): Audio: aac_latm (LC) ([17][0][0][0] / 
0x0011), 48000 Hz, stereo, fltp
   Stream #0:2[0x102](eng): Subtitle: dvb_subtitle ([6][0][0][0] / 0x0006)
Stream mapping:
   Stream #0:0 -> #0:0 (h264 (native) -> h264 (libx264))
   Stream #0:1 -> #0:1 (aac_latm (native) -> mp2 (native))
Press [q] to stop, [?] for help
[h264 @ 0x2575980] mmco: unref short failure
[h264 @ 0x2626640] mmco: unref short failure
[libx264 @ 0x24e3000] interlace + weightp is not implemented
[libx264 @ 0x24e3000] using SAR=1/1
[libx264 @ 0x24e3000] using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
[libx264 @ 0x24e3000] profile High, level 4.0, 4:2:0, 8-bit
Output #0, mpegts, to 'test.ts':
   Metadata:
     encoder         : Lavf59.0.101
   Stream #0:0: Video: h264, yuv420p(tv, bt709, top coded first 
(swapped)), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 fps, 90k tbn
     Metadata:
       encoder         : Lavc59.0.100 libx264
     Side data:
       cpb: bitrate max/min/avg: 0/0/0 buffer size: 0 vbv_delay: N/A
   Stream #0:1(eng): Audio: mp2, 48000 Hz, stereo, s16, 384 kb/s
     Metadata:
       encoder         : Lavc59.0.100 mp2
/mnt/lvm0/TV/BBC_News/2021-04-24.22.00.2-0.rec/00001.ts: corrupt decoded 
frame in stream 0
     Last message repeated 40 times
frame= 3000 fps= 17 q=-1.0 Lsize=   40011kB time=00:02:01.12 
bitrate=2706.1kbits/s speed=0.683x
video:32599kB audio:5594kB subtitle:0kB other streams:0kB global 
headers:0kB muxing overhead: 4.759382%
[libx264 @ 0x24e3000] frame I:20    Avg QP:17.62  size:119304
[libx264 @ 0x24e3000] frame P:920   Avg QP:19.29  size: 22123
[libx264 @ 0x24e3000] frame B:2060  Avg QP:25.63  size:  5166
[libx264 @ 0x24e3000] consecutive B-frames:  4.1% 12.3%  2.1% 81.5%
[libx264 @ 0x24e3000] mb I  I16..4: 23.4% 57.4% 19.2%
[libx264 @ 0x24e3000] mb P  I16..4:  4.1%  5.4%  0.9%  P16..4: 26.0%  
7.2%  3.8%  0.0%  0.0%    skip:52.7%
[libx264 @ 0x24e3000] mb B  I16..4:  0.3%  0.3%  0.0%  B16..8: 23.4%  
1.6%  0.2%  direct: 0.8%  skip:73.2%  L0:42.7% L1:52.5% BI: 4.8%
[libx264 @ 0x24e3000] field mbs: intra: 25.6% inter:21.1% skip:5.9%
[libx264 @ 0x24e3000] 8x8 transform intra:52.3% inter:81.6%
[libx264 @ 0x24e3000] coded y,uvDC,uvAC intra: 41.0% 41.5% 10.9% inter: 
6.8% 7.3% 0.2%
[libx264 @ 0x24e3000] i16 v,h,dc,p: 33% 27% 10% 29%
[libx264 @ 0x24e3000] i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 20% 33%  3%  
3%  4%  4%  4%  4%
[libx264 @ 0x24e3000] i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 35% 25% 14%  4%  
4%  5%  5%  4%  4%
[libx264 @ 0x24e3000] i8c dc,h,v,p: 63% 18% 16%  4%
[libx264 @ 0x24e3000] ref P L0: 67.4% 20.5%  9.9%  1.0%  0.6% 0.5%
[libx264 @ 0x24e3000] ref B L0: 78.0% 18.3%  2.7%  0.7%  0.1% 0.1%
[libx264 @ 0x24e3000] ref B L1: 85.8% 13.7%  0.3%  0.3%
[libx264 @ 0x24e3000] kb/s:2225.45






More information about the ffmpeg-user mailing list