vaapipostproc: deinterlace produces video jerking
Submitted by Lim Siew Hoon
Link to original bug (#766862)
Description
Created attachment 328488
test_video_h264_info.txt
Gstreamer framework 1.7.90 version
Gstreamer-vaapi: 1.7.90 version.
command:
gst-launch-1.0 filesrc location=/home/root/H264_Main_Interlaced_Sound_ToTheLimit.mp4 ! qtdemux ! vaapidecode ! vaapipostproc deinterlace-mode=1 deinterlace-method=1 ! vaapisink fullscreen=true
Combination:
deinterlace-mode=1 and deinterlace-method=0
deinterlace-mode=1 and deinterlace-method=1
deinterlace-mode=1 and deinterlace-method=2
deinterlace-mode=0 and deinterlace-method=0
deinterlace-mode=0 and deinterlace-method=1
deinterlace-mode=0 and deinterlace-method=2
H264 interlace video with vaapipostproc with above combination will causing the video jerking. The issue also able to reproduce in 1.8.1 version too.
flags = 0x0 and ttf=0x1
Original version: gst_vaapipostproc_process function
/* Second field */
append_output_buffer_metadata (postproc, outbuf, inbuf, 0);
meta = gst_buffer_get_vaapi_video_meta (outbuf);
outbuf_flags = flags;
outbuf_flags |= deint ? (tff ?
GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD :
GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD) :
GST_VAAPI_PICTURE_STRUCTURE_FRAME;
gst_vaapi_video_meta_set_render_flags (meta, outbuf_flags);
Modify version:
/* Second field */
append_output_buffer_metadata (postproc, outbuf, inbuf, 0);
meta = gst_buffer_get_vaapi_video_meta (outbuf);
outbuf_flags = flags;
outbuf_flags |= deint ? (tff ?
GST_VAAPI_PICTURE_STRUCTURE_TOP_FIELD :
GST_VAAPI_PICTURE_STRUCTURE_BOTTOM_FIELD) :
GST_VAAPI_PICTURE_STRUCTURE_FRAME;
gst_vaapi_video_meta_set_render_flags (meta, outbuf_flags);
After I make the arrangement in outbuf_flags same as the fieldbuf_flags logic checking, the video jerking issue go away.
Attachment 328488, "test_video_h264_info.txt":
test_video_h264_info.txt
Version: 1.7.90