-
Notifications
You must be signed in to change notification settings - Fork 1
/
tcval.py
executable file
·1918 lines (1730 loc) · 82.1 KB
/
tcval.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#!/usr/bin/env python3
import argparse
import copy
import csv
import errno
import isodate
import json
import os
import shutil
import socket
import string
import subprocess
import sys
import time
import urllib.request
import zipfile
from collections import Counter
from datetime import datetime
from decimal import *
from enum import Enum
from json import JSONEncoder
from lxml import etree
from pathlib import Path
class CmafInitConstraints(str, Enum):
SINGLE: str = 'single'
MULTIPLE: str = 'multiple'
class CmafChunksPerFragment(str, Enum):
SINGLE: str = 'one chunk per fragment'
MULTIPLE: str = 'multiple chunks per fragment, multiple samples per chunk'
MULTIPLE_CHUNKS_ARE_SAMPLES: str = 'multiple chunks per fragment, each chunk is one sample'
class TestResult(str, Enum):
PASS: str = 'pass'
FAIL: str = 'fail'
NOT_TESTABLE: str = 'not testable'
NOT_TESTED: str = 'not tested'
NOT_APPLICABLE: str = 'not applicable'
UNKNOWN: str = 'unknown'
class VideoResolution:
horizontal = 0
vertical = 0
def __init__(self, horizontal=None, vertical=None):
if horizontal is not None:
self.horizontal = horizontal
if vertical is not None:
self.vertical = vertical
def json(self):
return {
'horizontal': self.horizontal,
'vertical': self.vertical
}
# Use same JSON export for all TestContent json export functions
json_def = json_analysis = json_ref = json_full = json
# Arrays representing:
# - expected value (read from input test content matrix),
# - value determined from stream analysis,
# - test status (pass/fail)
class TestContent:
test_stream_id = ''
test_file_path = ''
mezzanine_version = ['', '', TestResult.NOT_TESTED]
mezzanine_format = ['', '', TestResult.NOT_TESTED]
conformance_test_result = ''
codec_name = ['', '', TestResult.NOT_TESTED]
codec_profile = ['', '', TestResult.NOT_TESTED]
codec_level = ['', '', TestResult.NOT_TESTED]
codec_tier = ['', '', TestResult.NOT_TESTED]
file_brand = ['', '', TestResult.NOT_TESTED]
sample_entry_type = ['', '', TestResult.NOT_TESTED]
parameter_sets_in_cmaf_header_present = ['', '', TestResult.NOT_TESTED]
parameter_sets_in_band_present = ['', '', TestResult.NOT_TESTED]
picture_timing_sei_present = ['', '', TestResult.NOT_TESTED]
vui_timing_present = ['', '', TestResult.NOT_TESTED]
cmaf_fragment_duration = [0, 0, TestResult.NOT_TESTED]
cmaf_initialisation_constraints = ['', '', TestResult.NOT_TESTABLE] # Not testable with current test content
chunks_per_fragment = [0, 0, TestResult.NOT_TESTED]
b_frames_present = ['', '', TestResult.NOT_TESTED]
resolution = [VideoResolution(), VideoResolution(), TestResult.NOT_TESTED]
frame_rate = [0.0, 0.0, TestResult.NOT_TESTED]
bitrate = [0, 0, TestResult.NOT_TESTED]
duration = [0, 0, TestResult.NOT_TESTED]
mpd_sample_duration_delta = [0.0, 0.0, TestResult.NOT_TESTED]
def __init__(self, test_stream_id=None, test_file_path=None, mezzanine_version=None, mezzanine_format=None,
conformance_test_result=None, codec_name=None, codec_profile=None, codec_level=None, codec_tier=None,
file_brand=None, sample_entry_type=None, parameter_sets_in_cmaf_header_present=None,
parameter_sets_in_band_present=None, picture_timing_sei_present=None, vui_timing_present=None,
cmaf_fragment_duration=None, cmaf_initialisation_constraints=None, chunks_per_fragment=None,
b_frames_present=None, resolution=None, frame_rate=None, bitrate=None, duration=None,
mpd_sample_duration_delta=None):
if test_stream_id is not None:
self.test_stream_id = test_stream_id
if test_file_path is not None:
self.test_file_path = test_file_path
if mezzanine_version is not None:
self.mezzanine_version = [mezzanine_version, '', TestResult.NOT_TESTED]
if mezzanine_format is not None:
self.mezzanine_format = [mezzanine_format, '', TestResult.NOT_TESTED]
if conformance_test_result is not None:
self.conformance_test_result = conformance_test_result
if codec_name is not None:
self.codec_name = [codec_name, '', TestResult.NOT_TESTED]
if codec_profile is not None:
self.codec_profile = [codec_profile, '', TestResult.NOT_TESTED]
if codec_level is not None:
self.codec_level = [codec_level, '', TestResult.NOT_TESTED]
if codec_tier is not None:
self.codec_tier = [codec_tier, '', TestResult.NOT_TESTED]
if file_brand is not None:
self.file_brand = [file_brand, '', TestResult.NOT_TESTED]
if sample_entry_type is not None:
self.sample_entry_type = [sample_entry_type, '', TestResult.NOT_TESTED]
if parameter_sets_in_cmaf_header_present is not None:
self.parameter_sets_in_cmaf_header_present = [parameter_sets_in_cmaf_header_present, '', TestResult.NOT_TESTED]
if parameter_sets_in_band_present is not None:
self.parameter_sets_in_band_present = [parameter_sets_in_band_present, '', TestResult.NOT_TESTED]
if picture_timing_sei_present is not None:
self.picture_timing_sei_present = [picture_timing_sei_present, '', TestResult.NOT_TESTED]
if vui_timing_present is not None:
self.vui_timing_present = [vui_timing_present, '', TestResult.NOT_TESTED]
if cmaf_fragment_duration is not None:
self.cmaf_fragment_duration = [cmaf_fragment_duration, 0, TestResult.NOT_TESTED]
if cmaf_initialisation_constraints is not None:
self.cmaf_initialisation_constraints = [cmaf_initialisation_constraints, '', TestResult.NOT_TESTABLE]
if chunks_per_fragment is not None:
self.chunks_per_fragment = [chunks_per_fragment, 0, TestResult.NOT_TESTED]
if b_frames_present is not None:
self.b_frames_present = [b_frames_present, '', TestResult.NOT_TESTED]
if resolution is not None:
self.resolution = [resolution, VideoResolution(), TestResult.NOT_TESTED]
if frame_rate is not None:
self.frame_rate = [frame_rate, 0.0, TestResult.NOT_TESTED]
if bitrate is not None:
self.bitrate = [bitrate, 0, TestResult.NOT_TESTED]
if duration is not None:
self.duration = [duration, 0, TestResult.NOT_TESTED]
if mpd_sample_duration_delta is not None:
self.mpd_sample_duration_delta = [mpd_sample_duration_delta, 0.0, TestResult.NOT_TESTED]
def json_def(self):
return {
'test_stream_id': self.test_stream_id,
'test_file_path': self.test_file_path,
'mezzanine_version': self.mezzanine_version[0],
'mezzanine_format': self.mezzanine_format[0],
'conformance_test_result': '', # Only applicable for results
'codec_profile': self.codec_profile[0],
'codec_level': self.codec_level[0],
'codec_tier': self.codec_tier[0],
'file_brand': self.file_brand[0],
'sample_entry_type': self.sample_entry_type[0],
'parameter_sets_in_cmaf_header_present': self.parameter_sets_in_cmaf_header_present[0],
'parameter_sets_in_band_present': self.parameter_sets_in_band_present[0],
'picture_timing_sei_present': self.picture_timing_sei_present[0],
'vui_timing_present': self.vui_timing_present[0],
'cmaf_fragment_duration': self.cmaf_fragment_duration[0],
'cmaf_initialisation_constraints': self.cmaf_initialisation_constraints[0],
'chunks_per_fragment': self.chunks_per_fragment[0],
'b_frames_present': self.b_frames_present[0],
'resolution': self.resolution[0],
'frame_rate': self.frame_rate[0],
'bitrate': self.bitrate[0],
'duration': self.duration[0],
'mpd_sample_duration_delta': self.mpd_sample_duration_delta[0]
}
def json_analysis(self):
return {
'test_stream_id': self.test_stream_id,
'test_file_path': self.test_file_path,
'mezzanine_version': self.mezzanine_version[1],
'mezzanine_format': self.mezzanine_format[1],
'conformance_test_result': '', # Only applicable for results
'codec_profile': self.codec_profile[1],
'codec_level': self.codec_level[1],
'codec_tier': self.codec_tier[1],
'file_brand': self.file_brand[1],
'sample_entry_type': self.sample_entry_type[1],
'parameter_sets_in_cmaf_header_present': self.parameter_sets_in_cmaf_header_present[1],
'parameter_sets_in_band_present': self.parameter_sets_in_band_present[1],
'picture_timing_sei_present': self.picture_timing_sei_present[1],
'vui_timing_present': self.vui_timing_present[1],
'cmaf_fragment_duration': self.cmaf_fragment_duration[1],
'cmaf_initialisation_constraints': self.cmaf_initialisation_constraints[1],
'chunks_per_fragment': self.chunks_per_fragment[1],
'b_frames_present': self.b_frames_present[1],
'resolution': self.resolution[1],
'frame_rate': self.frame_rate[1],
'bitrate': self.bitrate[1],
'duration': self.duration[1],
'mpd_sample_duration_delta': self.mpd_sample_duration_delta[1]
}
def json_res(self):
return {
'test_stream_id': self.test_stream_id,
'test_file_path': self.test_file_path,
'mezzanine_version': self.mezzanine_version[2],
'mezzanine_format': self.mezzanine_format[2],
'conformance_test_result': self.conformance_test_result,
'codec_profile': self.codec_profile[2],
'codec_level': self.codec_level[2],
'codec_tier': self.codec_tier[2],
'file_brand': self.file_brand[2],
'sample_entry_type': self.sample_entry_type[2],
'parameter_sets_in_cmaf_header_present': self.parameter_sets_in_cmaf_header_present[2],
'parameter_sets_in_band_present': self.parameter_sets_in_band_present[2],
'picture_timing_sei_present': self.picture_timing_sei_present[2],
'vui_timing_present': self.vui_timing_present[2],
'cmaf_fragment_duration': self.cmaf_fragment_duration[2],
'cmaf_initialisation_constraints': self.cmaf_initialisation_constraints[2],
'chunks_per_fragment': self.chunks_per_fragment[2],
'b_frames_present': self.b_frames_present[2],
'resolution': self.resolution[2],
'frame_rate': self.frame_rate[2],
'bitrate': self.bitrate[2],
'duration': self.duration[2],
'mpd_sample_duration_delta': self.mpd_sample_duration_delta[2]
}
def json_full(self):
return {
'TestStreamValidation': {
'test_stream_id': self.test_stream_id,
'test_file_path': self.test_file_path,
'mezzanine_version': {
'expected': self.mezzanine_version[0],
'detected': self.mezzanine_version[1],
'test_result': self.mezzanine_version[2].value
},
'mezzanine_format': {
'expected': self.mezzanine_format[0],
'detected': self.mezzanine_format[1],
'test_result': self.mezzanine_format[2].value
},
'conformance_test_result': self.conformance_test_result,
'codec_profile': {
'expected': self.codec_profile[0],
'detected': self.codec_profile[1],
'test_result': self.codec_profile[2].value
},
'codec_level': {
'expected': self.codec_level[0],
'detected': self.codec_level[1],
'test_result': self.codec_level[2].value
},
'codec_tier': {
'expected': self.codec_tier[0],
'detected': self.codec_tier[1],
'test_result': self.codec_tier[2].value
},
'file_brand': {
'expected': self.file_brand[0],
'detected': self.file_brand[1],
'test_result': self.file_brand[2].value
},
'sample_entry_type': {
'expected': self.sample_entry_type[0],
'detected': self.sample_entry_type[1],
'test_result': self.sample_entry_type[2].value
},
'parameter_sets_in_cmaf_header_present': {
'expected': self.parameter_sets_in_cmaf_header_present[0],
'detected': self.parameter_sets_in_cmaf_header_present[1],
'test_result': self.parameter_sets_in_cmaf_header_present[2].value
},
'parameter_sets_in_band_present': {
'expected': self.parameter_sets_in_band_present[0],
'detected': self.parameter_sets_in_band_present[1],
'test_result': self.parameter_sets_in_band_present[2].value
},
'picture_timing_sei_present': {
'expected': self.picture_timing_sei_present[0],
'detected': self.picture_timing_sei_present[1],
'test_result': self.picture_timing_sei_present[2].value
},
'vui_timing_present': {
'expected': self.vui_timing_present[0],
'detected': self.vui_timing_present[1],
'test_result': self.vui_timing_present[2].value
},
'cmaf_fragment_duration': {
'expected': self.cmaf_fragment_duration[0],
'detected': self.cmaf_fragment_duration[1],
'test_result': self.cmaf_fragment_duration[2].value
},
'cmaf_initialisation_constraints': {
'expected': self.cmaf_initialisation_constraints[0],
'detected': self.cmaf_initialisation_constraints[1],
'test_result': self.cmaf_initialisation_constraints[2].value
},
'chunks_per_fragment': {
'expected': self.chunks_per_fragment[0],
'detected': self.chunks_per_fragment[1],
'test_result': self.chunks_per_fragment[2].value
},
'b_frames_present': {
'expected': self.b_frames_present[0],
'detected': self.b_frames_present[1],
'test_result': self.b_frames_present[2].value
},
'resolution': {
'expected': self.resolution[0],
'detected': self.resolution[1],
'test_result': self.resolution[2].value
},
'frame_rate': {
'expected': self.frame_rate[0],
'detected': self.frame_rate[1],
'test_result': self.frame_rate[2].value
},
'bitrate': {
'expected': self.bitrate[0],
'detected': self.bitrate[1],
'test_result': self.bitrate[2].value
},
'duration': {
'expected': self.duration[0],
'detected': self.duration[1],
'test_result': self.duration[2].value
},
'mpd_sample_duration_delta': {
'expected': self.mpd_sample_duration_delta[0],
'detected': self.mpd_sample_duration_delta[1],
'test_result': self.mpd_sample_duration_delta[2].value
}
}
}
class TestContentDefEncoder(JSONEncoder):
def default(self, o):
if "json_def" in dir(o):
return o.json_def()
return JSONEncoder.default(self, o)
class TestContentAnalysisEncoder(JSONEncoder):
def default(self, o):
if "json_analysis" in dir(o):
return o.json_analysis()
return JSONEncoder.default(self, o)
class TestContentResEncoder(JSONEncoder):
def default(self, o):
if "json_res" in dir(o):
return o.json_res()
return JSONEncoder.default(self, o)
class TestContentFullEncoder(JSONEncoder):
def default(self, o):
if "json_full" in dir(o):
return o.json_full()
return JSONEncoder.default(self, o)
class SwitchingSetTestContent:
switching_set_id = ''
test_stream_ids = [[''], [''], [TestResult.NOT_TESTED]]
test_file_paths = [[''], [''], [TestResult.NOT_TESTED]]
mezzanine_version = ['', '', TestResult.NOT_TESTED]
conformance_test_result = ''
cmaf_initialisation_constraints = ['', '', TestResult.NOT_TESTED]
def __init__(self, switching_set_id=None, test_stream_ids=None, test_file_paths=None, mezzanine_version=None,
conformance_test_result=None, cmaf_initialisation_constraints=None):
if switching_set_id is not None:
self.switching_set_id = switching_set_id
if test_stream_ids is not None:
self.test_stream_ids = [test_stream_ids, [''] * len(test_stream_ids), [TestResult.NOT_TESTED] * len(test_stream_ids)]
if test_file_paths is not None:
self.test_file_paths = [test_file_paths, [''] * len(test_file_paths), [TestResult.NOT_TESTED] * len(test_file_paths)]
if mezzanine_version is not None:
self.mezzanine_version = [mezzanine_version, '', TestResult.NOT_TESTED]
if conformance_test_result is not None:
self.conformance_test_result = conformance_test_result
if cmaf_initialisation_constraints is not None:
self.cmaf_initialisation_constraints = [cmaf_initialisation_constraints, '', TestResult.NOT_TESTED]
def json_def(self):
return {
'switching_set_id': self.switching_set_id,
'test_stream_ids': self.test_stream_ids[0],
'test_file_paths': self.test_file_paths[0],
'mezzanine_version': self.mezzanine_version[0],
'conformance_test_result': '', # Only applicable for results
'cmaf_initialisation_constraints': self.cmaf_initialisation_constraints[0]
}
def json_analysis(self):
return {
'switching_set_id': self.switching_set_id,
'test_stream_ids': self.test_stream_ids[1],
'test_file_paths': self.test_file_paths[1],
'mezzanine_version': self.mezzanine_version[1],
'conformance_test_result': '', # Only applicable for results
'cmaf_initialisation_constraints': self.cmaf_initialisation_constraints[1]
}
def json_res(self):
return {
'switching_set_id': self.switching_set_id,
'test_stream_ids': self.test_stream_ids[2],
'test_file_paths': self.test_file_paths[2],
'mezzanine_version': self.mezzanine_version[2],
'conformance_test_result': self.conformance_test_result,
'cmaf_initialisation_constraints': self.cmaf_initialisation_constraints[2]
}
def json_full(self):
return {
'SwitchingSetValidation': {
'switching_set_id': self.switching_set_id,
'test_stream_ids': {
'expected': self.test_stream_ids[0],
'detected': self.test_stream_ids[1],
'test_result': self.test_stream_ids[2]
},
'test_file_paths': {
'expected': self.test_file_paths[0],
'detected': self.test_file_paths[1],
'test_result': self.test_file_paths[2]
},
'mezzanine_version': {
'expected': self.mezzanine_version[0],
'detected': self.mezzanine_version[1],
'test_result': self.mezzanine_version[2].value
},
'conformance_test_result': self.conformance_test_result,
'cmaf_initialisation_constraints': {
'expected': self.cmaf_initialisation_constraints[0],
'detected': self.cmaf_initialisation_constraints[1],
'test_result': self.cmaf_initialisation_constraints[2].value
}
}
}
# Constants
sep = '/'
TS_START = 'Test stream'
SS_START = '8.5 Switching Set Playback'
TS_DEFINITION_ROW_OFFSET = 3 # Number of rows from 'Test stream' root to actual definition data
TS_LOCATION_FRAME_RATES_50 = '12.5_25_50'
TS_LOCATION_FRAME_RATES_59_94 = '14.985_29.97_59.94'
TS_LOCATION_FRAME_RATES_60 = '15_30_60'
TS_LOCATION_SETS_POST = '_sets'
TS_MPD_NAME = 'stream.mpd'
TS_INIT_SEGMENT_NAME = 'init.mp4'
TS_FIRST_SEGMENT_NAME = '0.m4s'
TS_METADATA_POSTFIX = '_info.xml'
SS_NAME = 'ss1' # For now there is only 1 switching set
# Default codec test content matrix CSV file URLs
MATRIX_AVC = 'https://docs.google.com/spreadsheets/d/1hxbqBdJEEdVIDEkpjZ8f5kvbat_9VGxwFP77AXA_0Ao/export?format=csv'
MATRIX_AVC_FILENAME = 'matrix_avc.csv'
# Dicts
h264_profile = {'66': 'Baseline', '77': 'Main', '88': 'Extended', '100': 'High', '110': 'High 10'}
h264_slice_type = {'0': 'P slice', '1': 'B slice', '2': 'I slice',
'3': 'SP slice', '4': 'SI slice',
'5': 'P slice', '6': 'B slice', '7': 'I slice',
'8': 'SP slice', '9': 'SI slice'}
h265_profile = {'1': 'Main', '2': 'Main 10'}
h265_tier = {'0': 'Main', '1': 'High'}
# For codec_name ffmpeg uses the ISO/IEC MPEG naming convention except for AVC
codec_names = {'h264': 'avc'} # Convert codec_name using ITU-T naming convention to ISO/IEC MPEG naming convention
cmaf_brand_codecs = {'cfhd': 'avc', 'chdf': 'avc',
'chh1': 'hevc', 'cud1': 'hevc', 'clg1': 'hevc', 'chd1': 'hevc', 'cdm1': 'hevc', 'cdm4': 'hevc',
'av01': 'av1', 'cvvc': 'vvc'} # As defined in CTA-5001-E
frame_rate_group = {12.5: 0.25, 14.985: 0.25, 15: 0.25,
25: 0.5, 29.97: 0.5, 30: 0.5,
50: 1, 59.94: 1, 60: 1, 100: 2, 119.88: 2, 120: 2}
frame_rate_value_50 = {0.25: 12.5, 0.5: 25, 1: 50, 2: 100}
frame_rate_value_59_94 = {0.25: 14.985, 0.5: 29.97, 1: 59.94, 2: 119.88}
frame_rate_value_60 = {0.25: 15, 0.5: 30, 1: 60, 2: 120}
# Test results
TS_RESULTS_TOTAL_PASS = 0
TS_RESULTS_TOTAL_FAIL = 0
TS_RESULTS_TOTAL_NOT_TESTABLE = 0
TS_RESULTS_TOTAL_NOT_TESTED = 0
TS_RESULTS_TOTAL_NOT_APPLICABLE = 0
TS_CONFORMANCE_TOTAL_PASS = 0
TS_CONFORMANCE_TOTAL_FAIL = 0
TS_CONFORMANCE_TOTAL_UNKNOWN = 0
# DASH conformance tool
CONFORMANCE_TOOL_DOCKER_CONTAINER_ID = ''
# HTTP server configuration
DETECTED_IP = '127.0.0.1'
PORT = 9090
HTTPD_PATH = ''
# Default parameter values
mezzanine_version = 1
def check_and_analyse_v(test_content, tc_vectors_folder, frame_rate_family, debug_folder):
global TS_RESULTS_TOTAL_PASS
global TS_RESULTS_TOTAL_FAIL
global TS_RESULTS_TOTAL_NOT_TESTABLE
global TS_RESULTS_TOTAL_NOT_TESTED
global TS_RESULTS_TOTAL_NOT_APPLICABLE
global TS_CONFORMANCE_TOTAL_PASS
global TS_CONFORMANCE_TOTAL_FAIL
global TS_CONFORMANCE_TOTAL_UNKNOWN
if frame_rate_family not in [TS_LOCATION_FRAME_RATES_50, TS_LOCATION_FRAME_RATES_59_94, TS_LOCATION_FRAME_RATES_60]:
return
for tc in test_content:
test_stream_dir = Path(str(tc_vectors_folder)+sep+tc.file_brand[0]+TS_LOCATION_SETS_POST+sep
+ frame_rate_family+sep+'t'+tc.test_stream_id+sep)
if os.path.isdir(test_stream_dir):
print("Found test stream folder \""+str(test_stream_dir)+"\"...")
date_dirs = next(os.walk(str(test_stream_dir)))[1]
if len(date_dirs) > 0:
date_dirs.sort()
most_recent_date = date_dirs[len(date_dirs)-1]
else:
tc.test_file_path = 'release (YYYY-MM-DD) folder missing'
print('No test streams releases found for '+'t'+tc.test_stream_id+'.')
print()
continue
test_stream_date_dir = Path(str(test_stream_dir)+sep+most_recent_date+sep)
if os.path.isdir(test_stream_date_dir):
print(str(test_stream_date_dir)+' OK')
else:
tc.test_file_path = 'release (YYYY-MM-DD) folder missing'
print('Test stream folder \"'+str(test_stream_date_dir)+'\" does not exist.')
print()
continue
test_stream_path = Path(str(test_stream_date_dir)+sep+TS_MPD_NAME)
if os.path.isfile(test_stream_path):
print(str(test_stream_path)+' OK')
tc.test_file_path = str(test_stream_path)
else:
tc.test_file_path = TS_MPD_NAME+' file missing'
print(str(test_stream_path)+' does not exist.')
print()
continue
test_stream_path = Path(str(test_stream_date_dir)+sep+'1'+sep+TS_INIT_SEGMENT_NAME)
if os.path.isfile(test_stream_path):
print(str(test_stream_path)+' OK')
else:
tc.test_file_path = TS_INIT_SEGMENT_NAME+' file missing'
print(str(test_stream_path)+' does not exist.')
print()
continue
test_stream_path = Path(str(test_stream_date_dir)+sep+'1'+sep+TS_FIRST_SEGMENT_NAME)
if os.path.isfile(test_stream_path):
print(str(test_stream_path)+" OK")
tc.test_file_path = str(test_stream_date_dir)
else:
tc.test_file_path = TS_FIRST_SEGMENT_NAME+' file missing'
print(str(test_stream_path)+' does not exist.')
print()
continue
# Necessary files are present, run analysis
analyse_stream(tc, frame_rate_family, debug_folder)
else:
tc.test_file_path = 'folder missing'
print('Test stream folder \"'+str(test_stream_dir)+'\" does not exist.')
print()
# Count results
if tc.conformance_test_result != '':
if tc.conformance_test_result['verdict'] == 'PASS':
TS_CONFORMANCE_TOTAL_PASS += 1
elif tc.conformance_test_result['verdict'] == 'FAIL':
TS_CONFORMANCE_TOTAL_FAIL += 1
else:
TS_CONFORMANCE_TOTAL_UNKNOWN += 1
else:
TS_CONFORMANCE_TOTAL_UNKNOWN += 1
for a, v in tc.__dict__.items():
if len(v) == 3:
if v[2] == TestResult.PASS:
TS_RESULTS_TOTAL_PASS += 1
elif v[2] == TestResult.FAIL:
TS_RESULTS_TOTAL_FAIL += 1
elif v[2] == TestResult.NOT_TESTED:
TS_RESULTS_TOTAL_NOT_TESTED += 1
elif v[2] == TestResult.NOT_TESTABLE:
TS_RESULTS_TOTAL_NOT_TESTABLE += 1
elif v[2] == TestResult.NOT_APPLICABLE:
TS_RESULTS_TOTAL_NOT_APPLICABLE += 1
# Save metadata to JSON file
tc_res_filepath = Path(str(tc_matrix.stem)+'_'+frame_rate_family+'_test_results_'+time_of_analysis+'.json')
tc_res_file = open(str(tc_res_filepath), "w")
for tc in test_content:
json.dump(tc, tc_res_file, indent=4, cls=TestContentFullEncoder)
tc_res_file.write('\n')
tc_res_file.close()
print("### SUMMARY OF TEST RESULTS:")
print("# ")
print("# DASH conformance check using https://github.com/Dash-Industry-Forum/DASH-IF-Conformance")
print("# CLI: php Process_cli.php --cmaf --ctawave --segments <MPD location>")
print("# - Total Conformance Pass: " + str(TS_CONFORMANCE_TOTAL_PASS))
print("# - Total Conformance Fail: " + str(TS_CONFORMANCE_TOTAL_FAIL))
print("# - Total Conformance Unknown: " + str(TS_CONFORMANCE_TOTAL_UNKNOWN))
print("# ")
print("# WAVE test content definition conformance check:")
print("# - Total Pass: "+str(TS_RESULTS_TOTAL_PASS))
print("# - Total Fail: "+str(TS_RESULTS_TOTAL_FAIL))
print("# - Total Not Tested: "+str(TS_RESULTS_TOTAL_NOT_TESTED))
print("# - Total Not Testable: "+str(TS_RESULTS_TOTAL_NOT_TESTABLE))
print("# - Total Not Applicable: "+str(TS_RESULTS_TOTAL_NOT_APPLICABLE))
print()
print("Test results stored in: "+str(tc_res_filepath))
print()
def check_and_analyse_ss(ss_test_content, tc_vectors_folder, frame_rate_family, tc_codec):
global TS_RESULTS_TOTAL_PASS
global TS_RESULTS_TOTAL_FAIL
global TS_RESULTS_TOTAL_NOT_TESTABLE
global TS_RESULTS_TOTAL_NOT_TESTED
global TS_RESULTS_TOTAL_NOT_APPLICABLE
global TS_CONFORMANCE_TOTAL_PASS
global TS_CONFORMANCE_TOTAL_FAIL
global TS_CONFORMANCE_TOTAL_UNKNOWN
if frame_rate_family not in [TS_LOCATION_FRAME_RATES_50, TS_LOCATION_FRAME_RATES_59_94, TS_LOCATION_FRAME_RATES_60]:
return
# Print switching set id
print('## Testing ' + ss_test_content.switching_set_id)
# Extract necessary data from MPD
print('Extracting metadata from MPD...')
mpd_info = etree.parse(str(Path(str(tc_vectors_folder) + sep + tc_codec + '_' + frame_rate_family + '_' + SS_NAME + '_' + TS_MPD_NAME)))
mpd_info_root = mpd_info.getroot()
mpd_representations = [element.get("id") for element in mpd_info_root.iter('{*}Representation')]
mpd_representations = sorted(mpd_representations, key=lambda x: x.split('/')[2])
print()
if len(mpd_representations) > len(ss_test_content.test_stream_ids[0]):
ss_test_content.test_stream_ids[2] = TestResult.FAIL \
+ ' (too many representations: ' + str(len(mpd_representations)) \
+ ' where ' + str(len(ss_test_content.test_stream_ids[0])) + ' expected)'
# Check mezzanine version
try:
ss_test_content.mezzanine_version[1] = float(mpd_info_root[0][1].text.split(' ')[2])
ss_test_content.mezzanine_version[2] = TestResult.PASS \
if (ss_test_content.mezzanine_version[0] == ss_test_content.mezzanine_version[1]) \
else TestResult.FAIL
except ValueError:
ss_test_content.mezzanine_version[1] = 'not found where expected in MPD ('+mpd_info_root[0][1].text+')'
ss_test_content.mezzanine_version[2] = TestResult.UNKNOWN
raise
# TODO: Check switching set init constraints
for i, tc_id in enumerate(ss_test_content.test_stream_ids[0]):
if tc_id == '':
ss_test_content.test_stream_ids[2][i] = TestResult.UNKNOWN
elif 't'+tc_id in mpd_representations[i].split('/'):
idx = mpd_representations[i].split('/').index('t'+tc_id)
ss_test_content.test_stream_ids[1][i] = mpd_representations[i].split('/')[idx][1:]
ss_test_content.test_stream_ids[2][i] = TestResult.PASS
else:
ss_test_content.test_stream_ids[2][i] = TestResult.FAIL
test_stream_dir = Path(str(tc_vectors_folder) + sep + mpd_representations[i] + sep)
ss_test_content.test_file_paths[0][i] = str(test_stream_dir)
print("Expected test stream folder based on MPD: ")
print(str(test_stream_dir))
if os.path.isdir(test_stream_dir):
print("Found test stream folder \"" + str(test_stream_dir) + "\"...")
date_dirs = next(os.walk(str(test_stream_dir)))[1]
if len(date_dirs) > 0:
date_dirs.sort()
most_recent_date = date_dirs[len(date_dirs) - 1]
else:
ss_test_content.test_file_paths[1][i] = 'release (YYYY-MM-DD) folder missing'
ss_test_content.test_file_paths[2][i] = TestResult.FAIL
print('No test streams releases found for ' + 't' + tc_id + '.')
print()
continue
test_stream_date_dir = Path(str(test_stream_dir) + sep + most_recent_date + sep)
if os.path.isdir(test_stream_date_dir):
print(str(test_stream_date_dir) + ' OK')
else:
ss_test_content.test_file_paths[1][i] = 'release (YYYY-MM-DD) folder missing'
ss_test_content.test_file_paths[2][i] = TestResult.FAIL
print('Test stream folder \"' + str(test_stream_date_dir) + '\" does not exist.')
print()
continue
test_stream_path = Path(str(test_stream_date_dir) + sep + TS_MPD_NAME)
if os.path.isfile(test_stream_path):
print(str(test_stream_path) + ' OK')
ss_test_content.test_file_paths[1][i] = str(test_stream_path)
else:
ss_test_content.test_file_paths[1][i] = TS_MPD_NAME + ' file missing'
ss_test_content.test_file_paths[2][i] = TestResult.FAIL
print(str(test_stream_path) + ' does not exist.')
print()
continue
test_stream_path = Path(str(test_stream_date_dir) + sep + '1' + sep + TS_INIT_SEGMENT_NAME)
if os.path.isfile(test_stream_path):
print(str(test_stream_path) + ' OK')
else:
ss_test_content.test_file_paths[1][i] = TS_INIT_SEGMENT_NAME + ' file missing'
ss_test_content.test_file_paths[2][i] = TestResult.FAIL
print(str(test_stream_path) + ' does not exist.')
print()
continue
test_stream_path = Path(str(test_stream_date_dir) + sep + '1' + sep + TS_FIRST_SEGMENT_NAME)
if os.path.isfile(test_stream_path):
print(str(test_stream_path) + " OK")
print()
ss_test_content.test_file_paths[1][i] = str(test_stream_date_dir)
if ss_test_content.test_file_paths[0][i] == ss_test_content.test_file_paths[1][i]:
ss_test_content.test_file_paths[2][i] = TestResult.PASS
else:
ss_test_content.test_file_paths[2][i] = TestResult.FAIL
print('Incorrect test stream path.')
print()
else:
ss_test_content.test_file_paths[1][i] = TS_FIRST_SEGMENT_NAME + ' file missing'
ss_test_content.test_file_paths[2][i] = TestResult.FAIL
print(str(test_stream_path) + ' does not exist.')
print()
continue
# Copy analysis result for this test vector
# ss_test_content.test_stream_validation_results[i]
else:
ss_test_content.test_file_paths[1][i] = 'folder missing'
ss_test_content.test_file_paths[2][i] = TestResult.FAIL
print('Test stream folder \"' + str(test_stream_dir) + '\" does not exist.')
print()
# TODO: Perform conformance test
# Count results
if ss_test_content.conformance_test_result != '':
if ss_test_content.conformance_test_result['verdict'] == 'PASS':
TS_CONFORMANCE_TOTAL_PASS += 1
elif ss_test_content.conformance_test_result['verdict'] == 'FAIL':
TS_CONFORMANCE_TOTAL_FAIL += 1
else:
TS_CONFORMANCE_TOTAL_UNKNOWN += 1
else:
TS_CONFORMANCE_TOTAL_UNKNOWN += 1
for a, v in ss_test_content.__dict__.items():
if len(v) == 3:
if isinstance(v[0], list):
for i in range(0, len(v[0])):
if v[2][i] == TestResult.PASS:
TS_RESULTS_TOTAL_PASS += 1
elif v[2][i] == TestResult.FAIL:
TS_RESULTS_TOTAL_FAIL += 1
elif v[2][i] == TestResult.NOT_TESTED:
TS_RESULTS_TOTAL_NOT_TESTED += 1
elif v[2][i] == TestResult.NOT_TESTABLE:
TS_RESULTS_TOTAL_NOT_TESTABLE += 1
elif v[2][i] == TestResult.NOT_APPLICABLE:
TS_RESULTS_TOTAL_NOT_APPLICABLE += 1
else:
if v[2] == TestResult.PASS:
TS_RESULTS_TOTAL_PASS += 1
elif v[2] == TestResult.FAIL:
TS_RESULTS_TOTAL_FAIL += 1
elif v[2] == TestResult.NOT_TESTED:
TS_RESULTS_TOTAL_NOT_TESTED += 1
elif v[2] == TestResult.NOT_TESTABLE:
TS_RESULTS_TOTAL_NOT_TESTABLE += 1
elif v[2] == TestResult.NOT_APPLICABLE:
TS_RESULTS_TOTAL_NOT_APPLICABLE += 1
# Save metadata to JSON file
tc_res_filepath = Path(
str(tc_matrix.stem) + '_' + frame_rate_family + '_test_results_' + time_of_analysis + '.json')
tc_res_file = open(str(tc_res_filepath), "a")
json.dump(ss_test_content, tc_res_file, indent=4, cls=TestContentFullEncoder)
tc_res_file.write('\n')
tc_res_file.close()
print("### SUMMARY OF TEST RESULTS:")
print("# ")
print("# DASH conformance check using https://github.com/Dash-Industry-Forum/DASH-IF-Conformance")
print("# CLI: php Process_cli.php --cmaf --ctawave --segments <MPD location>")
print("# - Total Conformance Pass: " + str(TS_CONFORMANCE_TOTAL_PASS))
print("# - Total Conformance Fail: " + str(TS_CONFORMANCE_TOTAL_FAIL))
print("# - Total Conformance Unknown: " + str(TS_CONFORMANCE_TOTAL_UNKNOWN))
print("# ")
print("# WAVE test content definition conformance check:")
print("# - Total Pass: " + str(TS_RESULTS_TOTAL_PASS))
print("# - Total Fail: " + str(TS_RESULTS_TOTAL_FAIL))
print("# - Total Not Tested: " + str(TS_RESULTS_TOTAL_NOT_TESTED))
print("# - Total Not Testable: " + str(TS_RESULTS_TOTAL_NOT_TESTABLE))
print("# - Total Not Applicable: " + str(TS_RESULTS_TOTAL_NOT_APPLICABLE))
print()
print("Test results stored in: " + str(tc_res_filepath))
print()
def analyse_stream(test_content, frame_rate_family, debug_folder):
# Print test content id
print('## Testing t'+test_content.test_stream_id)
if CONFORMANCE_TOOL_DOCKER_CONTAINER_ID != '':
# Run DASH conformance tool
# Examples:
# Using remote server: docker exec -w /var/www/html/Utils/ 164bd9ff5c45 php Process_cli.php --cmaf --ctawave --segments
# https://dash.akamaized.net/WAVE/vectors/development/cfhd_sets/15_30_60/t1/2022-10-17/stream.mpd
# Using local server: docker exec -w /var/www/html/Utils/ 164bd9ff5c45 php Process_cli.php --cmaf --ctawave --segments
# http://127.0.0.1:9090/vectors/development/cfhd_sets/15_30_60/t1/2022-10-17/stream.mpd
# Determine HTTP location of MPD based on file path
# TEMPORARY bypass using Akamai server for segment validation:
conformance_http_location = 'https://dash.akamaized.net/WAVE/vectors/development/'+str(Path(test_content.test_file_path+sep+TS_MPD_NAME))[len(HTTPD_PATH):].replace('\\', '/')
#conformance_http_location = 'http://'+DETECTED_IP+':'+str(PORT)+str(Path(test_content.test_file_path+sep+TS_MPD_NAME))[len(HTTPD_PATH):].replace('\\', '/')
print('Run DASH conformance tool: '+conformance_http_location)
# --segments disabled due to bug https://github.com/Dash-Industry-Forum/DASH-IF-Conformance/issues/604
# which causes the DASH-IF conformance tool to enter into an infinite loop incorrectly requesting the
# same segment (0.m4s) when used specifically with the Python HTTP server
ct_cli = ['docker', 'exec', '-w', '/var/www/html/Utils/', CONFORMANCE_TOOL_DOCKER_CONTAINER_ID,
'php', 'Process_cli.php', '--cmaf', '--ctawave', '--segments', conformance_http_location]
if sys.platform == "win32":
ct_cli.insert(0, 'wsl')
conformance_tool_output = subprocess.check_output(ct_cli)
json_conformance_tool_output = json.loads(conformance_tool_output)
# Anonymize IP in results
json_conformance_tool_output['source'] = \
json_conformance_tool_output['source'].replace(json_conformance_tool_output['source'][:json_conformance_tool_output['source'].find(":",5)],'http://localhost')
test_content.conformance_test_result = json_conformance_tool_output
print("DASH conformance test result: "+json_conformance_tool_output['verdict'])
# Read initial properties using ffprobe: codec name, sample entry / FourCC, resolution
source_videoproperties = subprocess.check_output(
['ffprobe', '-i', str(Path(test_content.test_file_path+sep+'1'+sep+TS_INIT_SEGMENT_NAME)),
'-show_streams', '-select_streams', 'v', '-loglevel', '0', '-print_format', 'json'])
source_videoproperties_json = json.loads(source_videoproperties)
test_content.codec_name[1] = codec_names.get(source_videoproperties_json['streams'][0]['codec_name'], source_videoproperties_json['streams'][0]['codec_name'])
if test_content.codec_name[0] == '':
test_content.codec_name[2] = TestResult.UNKNOWN
else:
test_content.codec_name[2] = TestResult.PASS \
if (test_content.codec_name[0].replace('.', '').lower() == test_content.codec_name[1].replace('.', '').lower()) \
else TestResult.FAIL
print('Codec = '+test_content.codec_name[1])
test_content.sample_entry_type[1] = source_videoproperties_json['streams'][0]['codec_tag_string']
if test_content.sample_entry_type[0] == '':
test_content.sample_entry_type[2] = TestResult.UNKNOWN
else:
test_content.sample_entry_type[2] = TestResult.PASS \
if (test_content.sample_entry_type[0].lower() == test_content.sample_entry_type[1].lower()) \
else TestResult.FAIL
print('Sample Entry Type = '+source_videoproperties_json['streams'][0]['codec_tag_string'])
test_content.resolution[1].horizontal = source_videoproperties_json['streams'][0]['width']
test_content.resolution[1].vertical = source_videoproperties_json['streams'][0]['height']
if test_content.resolution[0].horizontal == 0 or test_content.resolution[0].vertical == 0:
test_content.resolution[2] = TestResult.UNKNOWN
else:
test_content.resolution[2] = TestResult.PASS \
if (test_content.resolution[0].horizontal == test_content.resolution[1].horizontal
and test_content.resolution[0].vertical == test_content.resolution[1].vertical) \
else TestResult.FAIL
print('Resolution = '
+ str(source_videoproperties_json['streams'][0]['width'])
+ 'x' + str(source_videoproperties_json['streams'][0]['height']))
# Read detailed properties using ffmpeg
ffmpeg_cl = ['ffmpeg',
'-i', str(Path(test_content.test_file_path+sep+TS_MPD_NAME)),
'-c', 'copy',
'-bsf:v', 'trace_headers',
'-f', 'null', '-']
print('Running ffmpeg trace_headers on full stream...')
with open(str(Path(str(tc_matrix.stem)+'_trace_headers_init_'+time_of_analysis+'.txt')), "w") as report_file:
subprocess.run(ffmpeg_cl, stderr=report_file)
report_file.close()
# Init variables for temp data from file
file_vui_timing_num_units_in_tick = 0
file_vui_timing_time_scale = 0
file_frame_rate = ''
file_duration = ''
file_codec_profile = ''
file_codec_tier = ''
file_codec_level = ''
file_chunks_per_fragment = 0
h264_detected = False
h265_detected = False
sps_detected = False
sps_processed = False
file_sps_count = 0
file_pps_count = 0
vui_detected = False
sei_detected = False
pic_timing_sei_detected = False
last_nal_unit_type = 0
nal_slice_types = []
# Open ffmpeg trace_headers output for analysis
headers_trace_file = open(str(Path(str(tc_matrix.stem)+'_trace_headers_init_'+time_of_analysis+'.txt')), encoding="utf-8")
headers_trace = headers_trace_file.readlines()
print('Checking ffmpeg trace_headers log...')
nb_lines = len(headers_trace)
for n, line in enumerate(headers_trace):
if h264_detected:
# Tier is not applicable
test_content.codec_tier[2] = TestResult.NOT_APPLICABLE
if sps_detected and not sps_processed:
if line.__contains__(' profile_idc '):
file_codec_profile = line.split(' = ')[1][:-1]
test_content.codec_profile[1] = h264_profile.get(file_codec_profile, '')
if test_content.codec_profile[0] == '':
test_content.codec_profile[2] = TestResult.UNKNOWN
else:
test_content.codec_profile[2] = TestResult.PASS \
if (test_content.codec_profile[0].lower() == test_content.codec_profile[1].lower()) \
else TestResult.FAIL
print('Profile = '+test_content.codec_profile[1])
continue
if line.__contains__(' level_idc '):
file_codec_level = line.split(' = ')[1][:-1]
test_content.codec_level[1] = str(eval(file_codec_level+"/10"))
if test_content.codec_level[0] == '':
test_content.codec_level[2] = TestResult.UNKNOWN
else:
test_content.codec_level[2] = TestResult.PASS \
if (float(test_content.codec_level[0]) == float(test_content.codec_level[1])) \
else TestResult.FAIL
print('Level = '+test_content.codec_level[1])
continue
if not vui_detected and line.__contains__(' vui_parameters_present_flag ') and line.endswith('= 1\n'):
vui_detected = True
print('VUI present')
continue
if vui_detected:
if line.__contains__(' timing_info_present_flag ') and line.endswith('= 1\n'):
test_content.vui_timing_present[1] = True
if test_content.vui_timing_present[0] == '':
test_content.vui_timing_present[2] = TestResult.UNKNOWN
else:
test_content.vui_timing_present[2] = TestResult.PASS \
if (test_content.vui_timing_present[0] is test_content.vui_timing_present[1]) \
else TestResult.FAIL
continue
if line.__contains__(' timing_info_present_flag ') and line.endswith('= 0\n'):
test_content.vui_timing_present[1] = False
if test_content.vui_timing_present[0] == '':
test_content.vui_timing_present[2] = TestResult.UNKNOWN
else:
test_content.vui_timing_present[2] = TestResult.PASS \
if (test_content.vui_timing_present[0] is test_content.vui_timing_present[1]) \
else TestResult.FAIL
sps_processed = True
continue