Blank frames when capturing interlaced video

Hi,
We are trying to capture PAL (576i) video from ADV7482. We already was able to capture progressive video (720p and 576p) without any problems. However, when capturing 576i (or even 1080i) video, 3 out of 4 frames are blank. Half of the non-blank frame is also blank, as in the below pictures for the first 4 frames captured:

First frame:

Next 3 frames:

I guess in the first frame only the top field is captured (since interlaced video is not handled in VI and CSI drivers) but could not find the reason why the next three frames are all blank.

Any hints on resolving this issue?

Do I need to make any changes in the device-tree or kernel?

Currently our code base is based on Jetpack 4.4. Does upgrading to the latest version affects this issue?

hello yolov333,

may I know what’s your capture command-line? please share the command for reference,
besides, there’s interlace-mode options, could you please enable that for confirmation,
thanks

Hello JerryChang,

I have tried these commands and no difference in the results:

v4l2-ctl --device /dev/video0 --set-fmt-video=width=720,height=576 --stream-mmap --stream-to=video.raw --stream-count=100

v4l2-ctl --device /dev/video0 --set-fmt-video=width=720,height=576,field=interlaced --stream-mmap --stream-to=video.raw --stream-count=100

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=720, height=576, format=YVYU' ! nvvidconv ! 'video/x-raw(memory:NVMM), format=NV12' ! nv3dsink -e sync=0

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=720, height=576, format=YVYU', interlace-mode=interlaced ! nvvidconv ! 'video/x-raw(memory:NVMM), format=NV12' ! nv3dsink -e sync=0

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=720, height=576, format=YVYU', interlace-mode=alternate ! nvvidconv ! 'video/x-raw(memory:NVMM), format=NV12' ! nv3dsink -e sync=0

Also the following modes in the device tree made no difference in the results (one without interlace options and one with half the height and interlace options):

mode0 { /* ADV7482_MODE_720x576_50FPS */
		num_lanes = "2";
		tegra_sinterface = "serial_a";
		phy_mode = "DPHY";
		discontinuous_clk = "no";
		dpcm_enable = "false";
		cil_settletime = "0";

		active_w = "720";
		active_h = "576";
		pixel_t = "yuv_yvyu16";
		readout_orientation = "90";
		line_length = "1472";
		inherent_gain = "1";
		pix_clk_hz = "27000000";

		gain_factor = "16";
		framerate_factor = "1000000";
		exposure_factor = "1000000";
		min_gain_val = "16"; 
		max_gain_val = "170"; 
		step_gain_val = "1";
		default_gain = "16"; 
		min_hdr_ratio = "1";
		max_hdr_ratio = "1";
		min_framerate = "50000000"; /* 50.0 fps */
		max_framerate = "50000000"; /* 50.0 fps */
		step_framerate = "1";
		default_framerate = "50000000"; /* 50.0 fps */
		min_exp_time = "13"; /* us */
		max_exp_time = "683709"; /* us */
		step_exp_time = "1";
		default_exp_time = "2495"; /* us */

		embedded_metadata_height = "0";
};

mode1 { /* ADV7482_MODE_720x288_50FPS */
        num_lanes = "2";
        tegra_sinterface = "serial_a";
        phy_mode = "DPHY";
        discontinuous_clk = "no";
        dpcm_enable = "false";
        cil_settletime = "0";
        
        active_w = "720";
        active_h = "288";
        pixel_t = "yuv_yvyu16";
        readout_orientation = "90";
        line_length = "1472";
        inherent_gain = "1";
        pix_clk_hz = "27000000";
        
        gain_factor = "16";
        framerate_factor = "1000000";
        exposure_factor = "1000000";
        min_gain_val = "16"; 
        max_gain_val = "170";
        step_gain_val = "1";
        default_gain = "16"; 
        min_hdr_ratio = "1";
        max_hdr_ratio = "1";
        min_framerate = "50000000"; /* 50.0 fps */
        max_framerate = "50000000"; /* 50.0 fps */
        step_framerate = "1";
        default_framerate = "50000000"; /* 50.0 fps */
        min_exp_time = "13"; /* us */
        max_exp_time = "683709"; /* us */
        step_exp_time = "1";
        default_exp_time = "2495"; /* us */
        
        embedded_metadata_height = "0";
        is_interlaced = "1";
        interlaced_type = "1";
};

@JerryChang
Could you please give me a hint?

Hi,
We don’t support source in interlace mode. Please check if the source can run in progressive mode.

Hi @DaneLLL

Thank you for your reply. I know that source in interlace mode is not supported, and unfortunately the source cannot run in progressive mode. I just wonder what is the reason for the blank frames. Actually I expected to capture odd or even fields separately but, here I am capturing three empty frames and a single field.

If you confirm that the problem will be solved by supporting interlace mode, I will try to change vi2_fops.c and csi2_fops.c and perhaps other files to add support for interlace mode.

Hi,
Interlace mode is not supported. You may pretend the source to be 720x288 progressive mode. and check if you can successfully capture 720x288 YVYU frame data in v4l2-ctl command. Generally if v4l2-ctl command works, it shall work fine in gstreamer v4l2src plugin.

And then you would need to find out a way to combine two 720x288 frame data into single 720x576 frame data.

1 Like

Hi,
Thank you @DaneLLL for your hint. Now I am able to capture 720x288 in progressive mode without any blank frames.

Now the problem is that to combine two 720x288 frames into a single 720x576 frame, I need to know that which one is top and which one is bottom. Is there a way to identify which field the frame belongs to? Does Tegra TX1 identifies it?

Hi,
It is uncertain since each frame is regarded as a progressive frame. Are you able to tell it from frame number? Such as frame 0 is top field, frame 1 is bottom field, frame 2 is top field, frame 3 is bottom field, …

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.