Ymagis / ClairMeta

Clairmeta is a python package for Digital Cinema Package (DCP) probing and checking.
BSD 3-Clause "New" or "Revised" License
84 stars 22 forks source link

Validation error unkowned #170

Closed bioleyl closed 3 years ago

bioleyl commented 3 years ago

I was trying your lib to validate DCP but I got a validation error with no information and I could not see what is wrong with the CPL.

Here is the output

2020-12-03 14:45:33,133 - Clairmeta - INFO - Probing DCP : Adolescentes_TLR-1_F_FR-XX_51_2K_MIK_20200303-01_MIK_IOP_OV
2020-12-03 14:45:35,046 - Clairmeta - INFO - Total time : 1.91 seconds
2020-12-03 14:45:35,187 - Clairmeta - INFO - Checking DCP : Adolescentes_TLR-1_F_FR-XX_51_2K_MIK_20200303-01_MIK_IOP_OV
2020-12-03 14:45:37,358 - Clairmeta - ERROR - Check unknown error
Traceback (most recent call last):
  File "C:\Users\Bioleyl\AppData\Local\Programs\Python\Python39\lib\site-packages\clairmeta\dcp_check_base.py", line 124, in run_check
    check_res = func(*args)
  File "C:\Users\Bioleyl\AppData\Local\Programs\Python\Python39\lib\site-packages\clairmeta\dcp_check_isdcf_dcnc.py", line 64, in check_dcnc_field_date
    date = datetime.strptime(date_str, '%Y%m%d')
  File "C:\Users\Bioleyl\AppData\Local\Programs\Python\Python39\lib\_strptime.py", line 568, in _strptime_datetime
    tt, fraction, gmtoff_fraction = _strptime(data_string, format)
  File "C:\Users\Bioleyl\AppData\Local\Programs\Python\Python39\lib\_strptime.py", line 349, in _strptime
    raise ValueError("time data %r does not match format %r" %
ValueError: time data '' does not match format '%Y%m%d'

2020-12-03 14:45:37,360 - Clairmeta - INFO - DCP : Adolescentes_TLR-1_F_FR-XX_51_2K_MIK_20200303-01_MIK_IOP_OV
2020-12-03 14:45:37,361 - Clairmeta - INFO - Size : 1.55 GiB
2020-12-03 14:45:37,363 - Clairmeta - INFO - Error(s):
  + CPL_3f3661ef-17e4-42cb-ad16-239f33cd11b9.xml (Adolescentes_TLR-1_F_FR-XX_51_2K_MIK_20200303-01_MIK_IOP_OV)
    . Composition Date validation.
      Check unknown error
      Traceback (most recent call last):
        File "C:\Users\Bioleyl\AppData\Local\Programs\Python\Python39\lib\site-packages\clairmeta\dcp_check_base.py", line 124, in run_check
          check_res = func(*args)
        File "C:\Users\Bioleyl\AppData\Local\Programs\Python\Python39\lib\site-packages\clairmeta\dcp_check_isdcf_dcnc.py", line 64, in check_dcnc_field_date
          date = datetime.strptime(date_str, '%Y%m%d')
        File "C:\Users\Bioleyl\AppData\Local\Programs\Python\Python39\lib\_strptime.py", line 568, in _strptime_datetime
          tt, fraction, gmtoff_fraction = _strptime(data_string, format)
        File "C:\Users\Bioleyl\AppData\Local\Programs\Python\Python39\lib\_strptime.py", line 349, in _strptime
          raise ValueError("time data %r does not match format %r" %
      ValueError: time data '' does not match format '%Y%m%d'

2020-12-03 14:45:37,364 - Clairmeta - INFO - Warning(s):
  + CPL_3f3661ef-17e4-42cb-ad16-239f33cd11b9.xml (Adolescentes_TLR-1_F_FR-XX_51_2K_MIK_20200303-01_MIK_IOP_OV)
    . Digital Cinema Naming Convention compliance (9.3).
      ContentTitle should have 12 parts to be fully compliant with ISDCF naming convention version 9.6, 11 part(s) found
      ContentTitle Part 20200303-01 not matching any naming convention field
      Field TerritoryRating not found in ContentTitle
      Field Date not found in ContentTitle
2020-12-03 14:45:37,365 - Clairmeta - INFO - Total check : 102
2020-12-03 14:45:37,365 - Clairmeta - INFO - Total time : 2.17 sec
2020-12-03 14:45:37,366 - Clairmeta - INFO - Validation : Fail

I don't understand where and what is the error

...
2020-12-03 14:45:37,358 - Clairmeta - ERROR - Check unknown error
...
 . Composition Date validation.
      Check unknown error
...

Is there a way to get a more verbose output?

remia commented 3 years ago

Hey @bioleyl,

Unfortunately, it looks like you are facing a bug in ClairMeta and I think it was fixed last month but was not released.

Can you try checking your DCP again using the develop branch of ClairMeta ?

For reference, it should be fixed by https://github.com/Ymagis/ClairMeta/commit/aa434f0e2435023e9bcec673eda1bb191da03589

The reason behind this bug is that we did not account for the ContentTile specifying date in a wrong format (ie. other than YYYYMMDD). I guess that's the case in your DCP ?

remia commented 3 years ago

Looks like the ContentTitle date is malformed indeed 20200303-01, please tell us if the develop branch fix this issue and I'll make sure to release a new version in the coming days.

bioleyl commented 3 years ago

It is much better

You are right @remia it is fixed on the develop branch

2020-12-04 09:54:12,877 - Clairmeta - INFO - Probing DCP : ..\Adolescentes_TLR-1_F_FR-XX_51_2K_MIK_20200303-01_MIK_IOP_OV
2020-12-04 09:54:14,637 - Clairmeta - INFO - Total time : 1.76 seconds
2020-12-04 09:54:14,767 - Clairmeta - INFO - Checking DCP : ..\Adolescentes_TLR-1_F_FR-XX_51_2K_MIK_20200303-01_MIK_IOP_OV
2020-12-04 09:54:16,858 - Clairmeta - INFO - Check report:

Status : Success
Path : ..\Adolescentes_TLR-1_F_FR-XX_51_2K_MIK_20200303-01_MIK_IOP_OV
Size : 1.55 GiB
Total check : 103
Total time : 2.08 sec

Warning(s):
  + CPL_3f3661ef-17e4-42cb-ad16-239f33cd11b9.xml (Adolescentes_TLR-1_F_FR-XX_51_2K_MIK_20200303-01_MIK_IOP_OV)
    . Digital Cinema Naming Convention compliance (9.3).
      ContentTitle should have 12 parts to be fully compliant with ISDCF naming convention version 9.6, 11 part(s) found
      ContentTitle Part 20200303-01 not matching any naming convention field
      Field TerritoryRating not found in ContentTitle
      Field Date not found in ContentTitle

DCP - ..\Adolescentes_TLR-1_F_FR-XX_51_2K_MIK_20200303-01_MIK_IOP_OV\ - Check succeeded
remia commented 3 years ago

Thanks for testing @bioleyl, will update here when this is released.

remia commented 3 years ago

Released in 1.1.0