Skip to content

Commit dfc2c98

Browse files
author
Clement Champetier
committed
pyTest: fix file analysis of raw format (eAnalyseLevelFirstGop)
1 parent ba6b391 commit dfc2c98

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

test/pyTest/testProperties.py

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,25 +114,26 @@ def testCheckRawVideoProperties():
114114
inputFile = av.InputFile(inputFileName)
115115
properties = inputFile.getProperties()
116116

117+
# Check format
117118
assert_true(properties.isRawFormat())
118119
assert_equals(properties.getNbStreams(), 1)
119120
assert_equals(properties.getNbVideoStreams(), 1)
120121
assert_equals(properties.getDuration(), 0) # file duration is unknown
121122
assert_equals(properties.getBitRate(), 0) # file bitrate is unknown
123+
assert_equals(properties.getFileSize(), 256293L)
122124

123-
expectedFileSize = 256293L
124-
assert_equals(properties.getFileSize(), expectedFileSize)
125-
126-
expectedBitRate = 177200L
127-
expectedNbFrames = 200
128-
expectedDuration = 8
129-
expectedFps = 25
130-
125+
# Check video stream when analyse the header
126+
videoStream = properties.getVideoProperties()[0]
127+
assert_equals(videoStream.getFps(), 25)
128+
assert_equals(videoStream.getNbFrames(), 0) # stream nbFrames is unknown
129+
assert_equals(videoStream.getDuration(), 0) # stream duration is unknown
130+
assert_equals(videoStream.getBitRate(), 0) # stream bitrate is unknown
131+
# Check video stream when analyse the first GOP
132+
inputFile.analyse(av.NoDisplayProgress(), av.eAnalyseLevelFirstGop)
131133
videoStream = properties.getVideoProperties()[0]
132-
assert_equals(videoStream.getNbFrames(), expectedNbFrames)
133-
assert_equals(videoStream.getDuration(), expectedDuration)
134-
assert_equals(videoStream.getBitRate(), expectedBitRate)
135-
assert_equals(videoStream.getFps(), expectedFps)
134+
assert_equals(videoStream.getNbFrames(), 200)
135+
assert_equals(videoStream.getDuration(), 8)
136+
assert_equals(videoStream.getBitRate(), 177200L)
136137

137138

138139
def testCheckAudioProperties():

test/pyTest/testTranscoderRewrap.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ def testRewrapRawVideoStream():
164164
# get src file of wrap
165165
inputFileName = os.environ['AVTRANSCODER_TEST_VIDEO_RAW_FILE']
166166
src_inputFile = av.InputFile(inputFileName)
167+
src_inputFile.analyse(av.NoDisplayProgress(), av.eAnalyseLevelFirstGop)
167168
src_properties = src_inputFile.getProperties()
168169
src_videoStream = src_properties.getVideoProperties()[0]
169170

@@ -180,6 +181,7 @@ def testRewrapRawVideoStream():
180181

181182
# get dst file of wrap
182183
dst_inputFile = av.InputFile(outputFileName)
184+
dst_inputFile.analyse(av.NoDisplayProgress(), av.eAnalyseLevelFirstGop)
183185
dst_properties = dst_inputFile.getProperties()
184186
dst_videoStream = dst_properties.getVideoProperties()[0]
185187

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy