UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer hud789
Observer
424 Views
Registered: ‎04-24-2019

Does Gstreamer in ZCU106 VCU TRD change the video brightness even for raw HDMI playing?

Jump to solution

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/37945398/Zynq+UltraScale+MPSoC+VCU+TRD+2018.3+-+HDMI+Video+Capture+and+HDMI+Display+With+Audio

I am working on one vcu_trd (link above) on zcu106 board. The TRD is just capture ad dispay raw HDMI video. I don't use the audio part but still didn't remove it from the TRD yet. 

Following commands are used to have the raw HDMI video in and out.

vcu_gst_app /media/card/config/4kp60/Display/Single_4kp60_HEVC_HIGH.cfg

gst-launch-1.0 v4l2src device=/dev/video0 io-mode=4 ! video/x-raw, width=3840, height=2160, framerate=60/1, format=NV12 ! queue max-size-bytes=0 ! kmssink bus-id="a0070000.v_mix"

I just assumed that this TRD will do a raw HDMI passthrou. 

I added my IP in video path in the HDMI TX module. The IP just adds up all the RGB value of the pixels in each frame. However, when I tested with a known video, the sum of the pixel value is somehow 6.8-7.0% lower than expected. If I replace the video coming from HDMI RX module with a pattern generator added in HDMI TX module, which dosen't rely on the GStreamer pipelline, then the sum is correct.

It seems along the video path of the TRD, the pixel values have been scaled lower. There is a scaler in HDMI Rx module, I removed it and it makes no difference. Can anyone confirm this and explain why?

It is really puzzled me and made me scratch my head.

 

Many thanks.

 

 

 

 

0 Kudos
1 Solution

Accepted Solutions
Scholar watari
Scholar
166 Views
Registered: ‎06-16-2013

Re: Does Gstreamer in ZCU106 VCU TRD change the video brightness even for raw HDMI playing?

Jump to solution

Hi @hud789 

 

Unfortunately, I'm not familiar with "ATOMOS Shogun Inferno".

But, according to the following pdf page 19, this source device outputs signal as Rec.709.

 

http://downloads.atomos.com/shogun-inferno/Shogun_Inferno_User_Manual.pdf

 

Generally, it can only output video signal as limited range.

In this case, you might have to use 3D LUT to convert limited range to full range, if necessary.

 

Also, this URL is useful for you to understand the meaning and backgroub of limited range and full range.

 

https://gstreamer.freedesktop.org/data/events/gstreamer-conference/2015/Hans%20Verkuil%20-%20Colorspaces%20and%20HDMI.pdf

 

Best regards,

0 Kudos
13 Replies
Scholar watari
Scholar
408 Views
Registered: ‎06-16-2013

Re: Does Gstreamer in ZCU106 VCU TRD change the video brightness even for raw HDMI playing?

Jump to solution

Hi @hud789 

 

It's limitted range issue.

Would you make sure the setting of HDMI souce device and hdmi_info in /sys/devices/platform/amba_pl@0/<your hdmi rx ss name> ?

 

You need to change a range from limitted range to full range.

 

Best regards,

 

0 Kudos
Observer hud789
Observer
374 Views
Registered: ‎04-24-2019

Re: Does Gstreamer in ZCU106 VCU TRD change the video brightness even for raw HDMI playing?

Jump to solution
Watari,
Thanks. I do have a file a0000000.v_hdmi_rx_ss under the folder you pointed out. But the file is with size zero. Can you tell me in detail how to add or change the settings for the range?
0 Kudos
Observer hud789
Observer
367 Views
Registered: ‎04-24-2019

Re: Does Gstreamer in ZCU106 VCU TRD change the video brightness even for raw HDMI playing?

Jump to solution

Add a picture for the files under /sys/devices/platform/amba_pl@0

hdmi rx setting.PNG
0 Kudos
Observer hud789
Observer
327 Views
Registered: ‎04-24-2019

Re: Does Gstreamer in ZCU106 VCU TRD change the video brightness even for raw HDMI playing?

Jump to solution

@watari 

Sorry I didn't pay attention, it is a folder. The hdmi_info file in the folder is below. The context of the file is generated on the fly. Don't think I can modify it. 

more hdmi_info

Stream Info
-------------
Color Format: YUV_422
Color Depth: 12
Pixels Per Clock: 2
Mode: Progressive
Frame Rate: 60Hz
Resolution: 3840x2160@60Hz
Pixel Clock: 594000000

Stream Timing
----------------

HSYNC Timing: hav=3840, hfp=176, hsw=88(hsp=1), hbp=296, htot=4400
VSYNC Timing: vav=2160, vfp=08, vsw=10(vsp=1), vbp=072, vtot=2250


Rx Info
--------
Mode: HDMI
VIC : 97
Scrambled: 1

Audio
------
Format : Unknown
Channels : 2
ACR CTS : 281250
ACR N : 5824


Link quality
------------
Link quality channel 0 : excellent (0)
Link quality channel 1 : excellent (0)
Link quality channel 2 : excellent (0)

0 Kudos
Scholar watari
Scholar
284 Views
Registered: ‎06-16-2013

Re: Does Gstreamer in ZCU106 VCU TRD change the video brightness even for raw HDMI playing?

Jump to solution

Hi @hud789 

 

It seems color depth issue.

I guess the latest VCU driver doesn't support YUV422 with 12bit color depth.

So, you need to change color depth from 12bit to 10bit or 8bit.

Also, if you choose like over 8bit, pay attention about an endian and mapping, too.

 

Best regards,

0 Kudos
Observer hud789
Observer
263 Views
Registered: ‎04-24-2019

Re: Does Gstreamer in ZCU106 VCU TRD change the video brightness even for raw HDMI playing?

Jump to solution

@watari 

I am not sure it is color depth issue or related to big/small endian. 

First, the pass through video of YUV 12 bit looks normal on HDMI output. It just the values are not as expected. 

Second, we also tried HDMI video from a laptop which had RGB8 format, and I had the same issue. 

0 Kudos
Scholar watari
Scholar
253 Views
Registered: ‎06-16-2013

Re: Does Gstreamer in ZCU106 VCU TRD change the video brightness even for raw HDMI playing?

Jump to solution

Hi @hud789 

 

WOuld you share the following information ?

 

1. What kind of HDMI source device do you use ? Share product name.

2. What OS and graphics card (ex. nVIDIA GeForce ...) do you use ? I'd like to make sure capability and find the route cause.

 

I suspect wrong communication between HDMI source and HDMI sink devices or using HDMI souce as Bluray Disc which is recorded by 4K@60Hz and YUV422 12bit color depth.

 

Rx Info
--------
Mode: HDMI
VIC : 97
Scrambled: 1

 

> Second, we also tried HDMI video from a laptop which had RGB8 format, and I had the same issue.

 

Would you share message of hdmi_info when you try HDMI video from a laptop as RGB888 format ?

 

Best regards,

0 Kudos
Observer hud789
Observer
230 Views
Registered: ‎04-24-2019

Re: Does Gstreamer in ZCU106 VCU TRD change the video brightness even for raw HDMI playing?

Jump to solution

@watari 

Thanks a lot. So all the test of VCU_TRD is with NIVADA SHIELD?

The HDMI source we used is an ATOMOS Shogun Inferno 

http://downloads.atomos.com/shogun-inferno/Shogun_Inferno_User_Manual.pdf

It plays 4K60P mov video file.

I converted the image to a mov video by doing 

ffmpeg -loop 1 -i image_4k.jpg -c:v dnxhd -vf fps=60000/1000 -profile:v dnxhr_hq -vframes 150 image_4k.mov

I think the conversion should keep the same color range but I am not expert on this. Actually we have verified the conversion by grabing a frame in VLC and did analysis in Matlab.

I played the same video on the laptop with VLC player anf output as 4K 30P. The hdmi_info is as follow

root@zcu106_vcu_trd:/sys/devices/platform/amba_pl@0/a0000000.v_hdmi_rx_ss# more hdmi_info

Stream Info
-------------
Color Format: RGB
Color Depth: 8
Pixels Per Clock: 2
Mode: Progressive
Frame Rate: 30Hz
Resolution: 3840x2160@30Hz
Pixel Clock: 297000000

Stream Timing
----------------

HSYNC Timing: hav=3840, hfp=176, hsw=88(hsp=1), hbp=296, htot=4400
VSYNC Timing: vav=2160, vfp=08, vsw=10(vsp=1), vbp=072, vtot=2250


Rx Info
--------
Mode: HDMI
VIC : 95
Scrambled: 0

Audio
------
Format : L-PCM
Channels : 2
ACR CTS : 0
ACR N : 0


Link quality
------------
Link quality channel 0 : excellent (0)
Link quality channel 1 : excellent (0)
Link quality channel 2 : excellent (0)

 

0 Kudos
Scholar watari
Scholar
218 Views
Registered: ‎06-16-2013

Re: Does Gstreamer in ZCU106 VCU TRD change the video brightness even for raw HDMI playing?

Jump to solution

Hi @hud789 

 

Would you execute the following command to confirm your source, first ?

 

$ avprove  image_4k.mov

 

If you find unexpected color format (ex. YUV 4:2:2 12bit), you must make sure setting of HDMI source device.

Because this device can output several color format.

 

[Note]

avprobe is a part of ffmpeg.

 

Best regards,

0 Kudos
Highlighted
Observer hud789
Observer
205 Views
Registered: ‎04-24-2019

Re: Does Gstreamer in ZCU106 VCU TRD change the video brightness even for raw HDMI playing?

Jump to solution

@watari 

I used a windows version ffmpeg and I have ffprobe under bin folder. Is this sufficient?

E:\ffmpeg-20190511-68bac50-win64-static\bin>ffprobe flower4k.mov
ffprobe version N-93828-g68bac50604 Copyright (c) 2007-2019 the FFmpeg developer
s
built with gcc 8.3.1 (GCC) 20190414
configuration: --enable-gpl --enable-version3 --enable-sdl2 --enable-fontconfi
g --enable-gnutls --enable-iconv --enable-libass --enable-libdav1d --enable-libb
luray --enable-libfreetype --enable-libmp3lame --enable-libopencore-amrnb --enab
le-libopencore-amrwb --enable-libopenjpeg --enable-libopus --enable-libshine --e
nable-libsnappy --enable-libsoxr --enable-libtheora --enable-libtwolame --enable
-libvpx --enable-libwavpack --enable-libwebp --enable-libx264 --enable-libx265 -
-enable-libxml2 --enable-libzimg --enable-lzma --enable-zlib --enable-gmp --enab
le-libvidstab --enable-libvorbis --enable-libvo-amrwbenc --enable-libmysofa --en
able-libspeex --enable-libxvid --enable-libaom --enable-libmfx --enable-amf --en
able-ffnvcodec --enable-cuvid --enable-d3d11va --enable-nvenc --enable-nvdec --e
nable-dxva2 --enable-avisynth --enable-libopenmpt
libavutil 56. 26.101 / 56. 26.101
libavcodec 58. 52.101 / 58. 52.101
libavformat 58. 27.103 / 58. 27.103
libavdevice 58. 7.100 / 58. 7.100
libavfilter 7. 50.100 / 7. 50.100
libswscale 5. 4.100 / 5. 4.100
libswresample 3. 4.100 / 3. 4.100
libpostproc 55. 4.100 / 55. 4.100
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'flower4k.mov':
Metadata:
major_brand : qt
minor_version : 512
compatible_brands: qt
encoder : Lavf58.27.103
Duration: 00:00:02.50, start: 0.000000, bitrate: 1747849 kb/s
Stream #0:0(eng): Video: dnxhd (DNXHR HQ) (AVdh / 0x68645641), yuv422p(tv, b
t709/unknown/unknown), 3840x2160, 1747845 kb/s, SAR 1:1 DAR 16:9, 60 fps, 60 tbr
, 15360 tbn, 15360 tbc (default)
Metadata:
handler_name : VideoHandler
encoder : Lavc58.52.101 dnxhd

0 Kudos
Scholar watari
Scholar
193 Views
Registered: ‎06-16-2013

Re: Does Gstreamer in ZCU106 VCU TRD change the video brightness even for raw HDMI playing?

Jump to solution

Hi @hud789 

 

I'm probably sure that it's limited range issue.

Would you make sure output range of HDMI on HDMI source device and change it from limited range to full range ?

 

Best regards,

0 Kudos
Observer hud789
Observer
179 Views
Registered: ‎04-24-2019

Re: Does Gstreamer in ZCU106 VCU TRD change the video brightness even for raw HDMI playing?

Jump to solution

@watari 

Thanks. Can you elaborate how to do 

"make sure output range of HDMI on HDMI source device and change it from limited range to full range"

 

0 Kudos
Scholar watari
Scholar
167 Views
Registered: ‎06-16-2013

Re: Does Gstreamer in ZCU106 VCU TRD change the video brightness even for raw HDMI playing?

Jump to solution

Hi @hud789 

 

Unfortunately, I'm not familiar with "ATOMOS Shogun Inferno".

But, according to the following pdf page 19, this source device outputs signal as Rec.709.

 

http://downloads.atomos.com/shogun-inferno/Shogun_Inferno_User_Manual.pdf

 

Generally, it can only output video signal as limited range.

In this case, you might have to use 3D LUT to convert limited range to full range, if necessary.

 

Also, this URL is useful for you to understand the meaning and backgroub of limited range and full range.

 

https://gstreamer.freedesktop.org/data/events/gstreamer-conference/2015/Hans%20Verkuil%20-%20Colorspaces%20and%20HDMI.pdf

 

Best regards,

0 Kudos