Video convert sample results are missing?

Hello.

Please help me about the vaidity of the Jetson MM API sample software result.

My environment is below.
HW: Jetson Xavier NX
OS: Jetpack 4.6

I’m trying to video convert from NV12 to ABGR32 using “jetson_multimedia_api/samples/07_video_convert”.
The output is different from what I expected.
Below are the executed commands, input, expected and actual output values.


[bt601 limited -> BGRA]
  - command: ./video_convert ./128.raw 1920 1080 NV12 ./output/128_601lim_BGRA.raw 1920 1080 ABGR32
  - input: bt601 limited(Y=128, U=128, V=128)
  - actually output: BGRA(B=142, G=142, R=142)
  - expected output: BGRA(B=130, G=130, R=130)


[bt601 full -> BGRA]
  - command: ./video_convert ./16.raw  1920 1080 NV12_ER ./output/16_601full_BGRA.raw 1920 1080 ABGR32
  - input: bt601 full(Y=16, U=128, V=128)
  - actually output: BGRA(B=0, G=0, R=0)
  - expected output: BGRA(B=16, G=16, R=16)

  - command: ./video_convert ./128.raw 1920 1080 NV12_ER ./output/128_601full_BGRA.raw 1920 1080 ABGR32
  - input: bt601 full(Y=128, U=128, V=128)
  - actually output: BGRA(B=142, G=142, R=142)
  - expected output: BGRA(B=128, G=128, R=128)

  - command: ./video_convert ./235.raw 1920 1080 NV12_ER ./output/235_601full_BGRA.raw 1920 1080 ABGR32
  - input: bt601 full(Y=235, U=128, V=128)
  - actually output: BGRA(B=255, G=255, R=255)
  - expected output: BGRA(B=235, G=235, R=235)


[bt709 limited -> BGRA]
  - command: ./video_convert ./128.raw 1920 1080 NV12_709 ./output/128_709lim_BGRA.raw 1920 1080 ABGR32
  - input: bt709 limited(Y=128, U=128, V=128)
  - actually output: BGRA(B=142, G=142, R=142)
  - expected output: BGRA(B=130, G=130, R=130)


[bt709 full -> BGRA]
  - command: ./video_convert ./16.raw  1920 1080 NV12_709_ER ./output/16_709full_BGRA.raw 1920 1080 ABGR32
  - input: bt709 full(Y=16, U=128, V=128)
  - actually output: BGRA(B=31, G=31, R=31)
  - expected output: BGRA(B=16, G=16, R=16)

  - command: ./video_convert ./128.raw 1920 1080 NV12_709_ER ./output/128_709full_BGRA.raw 1920 1080 ABGR32
  - input: bt709 full(Y=128, U=128, V=128)
  - actually output: BGRA(B=140, G=140, R=140)
  - expected output: BGRA(B=128, G=128, R=128)

  - command: ./video_convert ./235.raw 1920 1080 NV12_709_ER ./output/235_709full_BGRA.raw 1920 1080 ABGR32
  - input: bt709 full(Y=235, U=128, V=128)
  - actually output: BGRA(B=238, G=238, R=238)
  - expected output: BGRA(B=235, G=235, R=235)

Hi,
It looks like you expect the range of RGBA in [16, 235] but it is always in [0, 255]. Is this correct?

Thank you for reply.

It looks like you expect the range of RGBA in [16, 235] but it is always in [0, 255]. Is this correct?

Yes, it is one of my issue.
I have 3 issues.

  1. I set bt601 full range conversion(NV12_ER), but outputs are looks like limited range conversion results.
  2. I set bt709 full range conversion(NV12_709_ER), but outputs are incomprehensible results.
  3. I input Y=128 data, but conversion results BGR data are not match, both full and limited range setting.

Hi,
Are you able to grade to Jetpack 4.6.1 and give it a try?

Thank you for reply.

Are you able to grade to Jetpack 4.6.1 and give it a try?

I check JetPack 4.6.1.
The results are better than JetPack 4.6.
But bt601 full results are not match what ( expected.

  • OK(match output and expected result): bt601 limited, bt709 limited, bt709 full
  • NG(not match output and expected result): bt601 full
[bt601 full -> BGRA]
  - command: ./video_convert ./16.raw  1920 1080 NV12_ER ./output/16_601full_BGRA.raw 1920 1080 ABGR32
  - input: bt601 full(Y=16, U=128, V=128)
  - actually output: BGRA(B=0, G=0, R=0)
  - expected output: BGRA(B=16, G=16, R=16)

  - command: ./video_convert ./128.raw 1920 1080 NV12_ER ./output/128_601full_BGRA.raw 1920 1080 ABGR32
  - input: bt601 full(Y=128, U=128, V=128)
  - actually output: BGRA(B=130, G=130, R=130)
  - expected output: BGRA(B=128, G=128, R=128)

  - command: ./video_convert ./235.raw 1920 1080 NV12_ER ./output/235_601full_BGRA.raw 1920 1080 ABGR32
  - input: bt601 full(Y=235, U=128, V=128)
  - actually output: BGRA(B=255, G=255, R=255)
  - expected output: BGRA(B=235, G=235, R=235)

Hi,
Could you share the files(16.raw, 128.raw, 235.raw) in bt601 full? Or how we can generate the test files.

To generate the raw files, please type below at Linux command line.

[16.raw]
for ((i=0;i<2073600;i++)); do echo ‘10’; done > 0x10.txt
for ((i=0;i<1036800;i++)); do echo ‘80’; done > 0x80.txt
cat 0x10.txt 0x80.txt | xxd -r -p >16.raw

[128.raw]
cat 0x80.txt 0x80.txt 0x80.txt| xxd -r -p >128.raw

[235.raw]
for ((i=0;i<2073600;i++)); do echo ‘eb’; done > 0xeb.txt
cat 0xeb.txt 0x80.txt| xxd -r -p >235.raw

1 Like

Hi,
Please try attached prebuilt lib:

/usr/lib/aarch64-linux-gnu/tegra/libnvbuf_utils.so

r32_7_TEST_libnvbuf_utils.zip (18.7 KB)

Sorry for the late answer, and thank you for provide the library.
I can get expected result to use the library for all test cases.

When will this library be reflected in the product?

Hi,
For Jetpack 4, the prebuilt lib can be applied to releases after 4.6.1.

For Jetpack 5, we switch to NvBufSurface and will check this.

Thank you for your answer. I’m waiting for the release.

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