@@ -92,3 +92,31 @@ def testInputFileAnalyseFirstGop():
92
92
encodedPictureSize = image [1 ]
93
93
assert_in (pictureType , ['I' , 'P' , 'B' ])
94
94
assert_greater (encodedPictureSize , 0 )
95
+ assert_not_equals (videoProperties .getDuration (), 0 )
96
+ assert_not_equals (videoProperties .getBitRate (), 0 )
97
+ assert_not_equals (videoProperties .getNbFrames (), 0 )
98
+
99
+
100
+ def testInputFileAnalyseFull ():
101
+ """
102
+ Analyse the full video stream of an InputFile, and check if the correct attributes are filled.
103
+ """
104
+ inputFileName = os .environ ['AVTRANSCODER_TEST_VIDEO_RAW_FILE' ]
105
+ inputFile = av .InputFile ( inputFileName )
106
+
107
+ # Analyse full stream
108
+ progress = av .ConsoleProgress ()
109
+ inputFile .analyse (progress , av .eAnalyseLevelFull )
110
+
111
+ # Check properties after full analysis
112
+ videoProperties = inputFile .getProperties ().getVideoProperties ()[0 ]
113
+ assert_greater (videoProperties .getGopSize (), 0 )
114
+ assert_not_equals (videoProperties .getGopStructure (), ())
115
+ for image in videoProperties .getGopStructure ():
116
+ pictureType = image [0 ]
117
+ encodedPictureSize = image [1 ]
118
+ assert_in (pictureType , ['I' , 'P' , 'B' ])
119
+ assert_greater (encodedPictureSize , 0 )
120
+ assert_not_equals (videoProperties .getDuration (), 0 )
121
+ assert_not_equals (videoProperties .getBitRate (), 0 )
122
+ assert_not_equals (videoProperties .getNbFrames (), 0 )
0 commit comments