[FFmpeg-trac] #7523(undetermined:new): VAAPI: Fail to Decode an H264 LP Multi-Slice Encoded Video
FFmpeg
trac at avcodec.org
Mon Oct 29 22:50:21 EET 2018
#7523: VAAPI: Fail to Decode an H264 LP Multi-Slice Encoded Video
-------------------------------------+-------------------------------------
Reporter: uartie | Owner:
Type: defect | Status: new
Priority: normal | Component:
Version: git-master | undetermined
Keywords: vaapi | Resolution:
Blocking: | Blocked By:
Analyzed by developer: 0 | Reproduced by developer: 0
-------------------------------------+-------------------------------------
Comment (by jkqxz):
The driver seems to have only used part of (or overwritten some of?) the
slice header when run in low-power mode.
Given a 64x64 input, with the normal encoder:
{{{
$ LIBVA_DRIVER_NAME=iHD ./ffmpeg_g -y -hwaccel vaapi -hwaccel_device
/dev/dri/renderD128 -hwaccel_output_format vaapi -i 64x64.mp4 -an -c:v
h264_vaapi -frames:v 1 -slices 4 -low_power 0 -bsf:v trace_headers -f null
-
...
[AVBSFContext @ 0x55608b799740] Slice Header
[AVBSFContext @ 0x55608b799740] 0 forbidden_zero_bit
0 = 0
[AVBSFContext @ 0x55608b799740] 1 nal_ref_idc
11 = 3
[AVBSFContext @ 0x55608b799740] 3 nal_unit_type
00101 = 5
[AVBSFContext @ 0x55608b799740] 8 first_mb_in_slice
1 = 0
[AVBSFContext @ 0x55608b799740] 9 slice_type
0001000 = 7
[AVBSFContext @ 0x55608b799740] 16 pic_parameter_set_id
1 = 0
[AVBSFContext @ 0x55608b799740] 17 frame_num
00000000 = 0
[AVBSFContext @ 0x55608b799740] 25 idr_pic_id
010 = 1
[AVBSFContext @ 0x55608b799740] 28 pic_order_cnt_lsb
0000 = 0
[AVBSFContext @ 0x55608b799740] 32 no_output_of_prior_pics_flag
0 = 0
[AVBSFContext @ 0x55608b799740] 33 long_term_reference_flag
0 = 0
[AVBSFContext @ 0x55608b799740] 34 slice_qp_delta
1 = 0
[AVBSFContext @ 0x55608b799740] 35 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] 36 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] 37 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] 38 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] 39 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] Slice Header
[AVBSFContext @ 0x55608b799740] 0 forbidden_zero_bit
0 = 0
[AVBSFContext @ 0x55608b799740] 1 nal_ref_idc
11 = 3
[AVBSFContext @ 0x55608b799740] 3 nal_unit_type
00101 = 5
[AVBSFContext @ 0x55608b799740] 8 first_mb_in_slice
00101 = 4
[AVBSFContext @ 0x55608b799740] 13 slice_type
0001000 = 7
[AVBSFContext @ 0x55608b799740] 20 pic_parameter_set_id
1 = 0
[AVBSFContext @ 0x55608b799740] 21 frame_num
00000000 = 0
[AVBSFContext @ 0x55608b799740] 29 idr_pic_id
010 = 1
[AVBSFContext @ 0x55608b799740] 32 pic_order_cnt_lsb
0000 = 0
[AVBSFContext @ 0x55608b799740] 36 no_output_of_prior_pics_flag
0 = 0
[AVBSFContext @ 0x55608b799740] 37 long_term_reference_flag
0 = 0
[AVBSFContext @ 0x55608b799740] 38 slice_qp_delta
1 = 0
[AVBSFContext @ 0x55608b799740] 39 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] Slice Header
[AVBSFContext @ 0x55608b799740] 0 forbidden_zero_bit
0 = 0
[AVBSFContext @ 0x55608b799740] 1 nal_ref_idc
11 = 3
[AVBSFContext @ 0x55608b799740] 3 nal_unit_type
00101 = 5
[AVBSFContext @ 0x55608b799740] 8 first_mb_in_slice
0001001 = 8
[AVBSFContext @ 0x55608b799740] 15 slice_type
0001000 = 7
[AVBSFContext @ 0x55608b799740] 22 pic_parameter_set_id
1 = 0
[AVBSFContext @ 0x55608b799740] 23 frame_num
00000000 = 0
[AVBSFContext @ 0x55608b799740] 31 idr_pic_id
010 = 1
[AVBSFContext @ 0x55608b799740] 34 pic_order_cnt_lsb
0000 = 0
[AVBSFContext @ 0x55608b799740] 38 no_output_of_prior_pics_flag
0 = 0
[AVBSFContext @ 0x55608b799740] 39 long_term_reference_flag
0 = 0
[AVBSFContext @ 0x55608b799740] 40 slice_qp_delta
1 = 0
[AVBSFContext @ 0x55608b799740] 41 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] 42 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] 43 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] 44 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] 45 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] 46 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] 47 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] Slice Header
[AVBSFContext @ 0x55608b799740] 0 forbidden_zero_bit
0 = 0
[AVBSFContext @ 0x55608b799740] 1 nal_ref_idc
11 = 3
[AVBSFContext @ 0x55608b799740] 3 nal_unit_type
00101 = 5
[AVBSFContext @ 0x55608b799740] 8 first_mb_in_slice
0001101 = 12
[AVBSFContext @ 0x55608b799740] 15 slice_type
0001000 = 7
[AVBSFContext @ 0x55608b799740] 22 pic_parameter_set_id
1 = 0
[AVBSFContext @ 0x55608b799740] 23 frame_num
00000000 = 0
[AVBSFContext @ 0x55608b799740] 31 idr_pic_id
010 = 1
[AVBSFContext @ 0x55608b799740] 34 pic_order_cnt_lsb
0000 = 0
[AVBSFContext @ 0x55608b799740] 38 no_output_of_prior_pics_flag
0 = 0
[AVBSFContext @ 0x55608b799740] 39 long_term_reference_flag
0 = 0
[AVBSFContext @ 0x55608b799740] 40 slice_qp_delta
1 = 0
[AVBSFContext @ 0x55608b799740] 41 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] 42 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] 43 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] 44 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] 45 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] 46 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x55608b799740] 47 cabac_alignment_one_bit
1 = 1
...
}}}
With the low-power encoder, the second slice header (which is written
identically to the above case) has been messed up somehow:
{{{
$ LIBVA_DRIVER_NAME=iHD ./ffmpeg_g -y -hwaccel vaapi -hwaccel_device
/dev/dri/renderD128 -hwaccel_output_format vaapi -i 64x64.mp4 -an -c:v
h264_vaapi -frames:v 1 -slices 4 -low_power 1 -bsf:v trace_headers -f null
-
...
[AVBSFContext @ 0x556e060a0740] Slice Header
[AVBSFContext @ 0x556e060a0740] 0 forbidden_zero_bit
0 = 0
[AVBSFContext @ 0x556e060a0740] 1 nal_ref_idc
11 = 3
[AVBSFContext @ 0x556e060a0740] 3 nal_unit_type
00101 = 5
[AVBSFContext @ 0x556e060a0740] 8 first_mb_in_slice
1 = 0
[AVBSFContext @ 0x556e060a0740] 9 slice_type
0001000 = 7
[AVBSFContext @ 0x556e060a0740] 16 pic_parameter_set_id
1 = 0
[AVBSFContext @ 0x556e060a0740] 17 frame_num
00000000 = 0
[AVBSFContext @ 0x556e060a0740] 25 idr_pic_id
010 = 1
[AVBSFContext @ 0x556e060a0740] 28 pic_order_cnt_lsb
0000 = 0
[AVBSFContext @ 0x556e060a0740] 32 no_output_of_prior_pics_flag
0 = 0
[AVBSFContext @ 0x556e060a0740] 33 long_term_reference_flag
0 = 0
[AVBSFContext @ 0x556e060a0740] 34 slice_qp_delta
1 = 0
[AVBSFContext @ 0x556e060a0740] 35 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x556e060a0740] 36 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x556e060a0740] 37 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x556e060a0740] 38 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x556e060a0740] 39 cabac_alignment_one_bit
1 = 1
[AVBSFContext @ 0x556e060a0740] Slice Header
[AVBSFContext @ 0x556e060a0740] 0 forbidden_zero_bit
0 = 0
[AVBSFContext @ 0x556e060a0740] 1 nal_ref_idc
00 = 0
[AVBSFContext @ 0x556e060a0740] 3 nal_unit_type
00001 = 1
[AVBSFContext @ 0x556e060a0740] 8 first_mb_in_slice
00101 = 4
[AVBSFContext @ 0x556e060a0740] 13 slice_type
1 = 0
[AVBSFContext @ 0x556e060a0740] 14 pic_parameter_set_id
1 = 0
[AVBSFContext @ 0x556e060a0740] 15 frame_num
00101100 = 44
[AVBSFContext @ 0x556e060a0740] 23 pic_order_cnt_lsb
0100 = 4
[AVBSFContext @ 0x556e060a0740] 27
num_ref_idx_active_override_flag 0 = 0
[AVBSFContext @ 0x556e060a0740] 28
ref_pic_list_modification_flag_l0 1 = 1
[AVBSFContext @ 0x556e060a0740] 29 modification_of_pic_nums_idc
0000000001000000011 = 514
[AVBSFContext @ 0x556e060a0740] modification_of_pic_nums_idc out of range:
514, but must be in [0,3].
[AVBSFContext @ 0x556e060a0740] Failed to read unit 4 (type 1).
...
}}}
--
Ticket URL: <https://trac.ffmpeg.org/ticket/7523#comment:2>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list