Skip to content

Commit 55fb7e5

Browse files
author
Clement Champetier
committed
pyTest: updated how to check output duration when testEProcessMethods
* Need to check if duration of all output streams are almost equals to the expected value. But we cannot ensure to have the exact value for all streams (it may not be possible depending on the fps/rate of input streams). * And the result vary depending on the ffmpeg version.
1 parent 5f10588 commit 55fb7e5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/pyTest/testEProcessMethod.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ def testEProcessMethodShortest():
4141
dst_inputFile = av.InputFile( outputFileName )
4242
dst_properties = dst_inputFile.getProperties()
4343

44-
assert_equals( dst_properties.getDuration(), src_properties_shortest.getDuration() )
44+
for dst_stream_properties in dst_properties.getStreamProperties():
45+
assert_almost_equals( dst_stream_properties.getDuration(), src_properties_shortest.getDuration(), delta=0.05 )
4546

4647

4748
def testEProcessMethodLongest():
@@ -70,7 +71,8 @@ def testEProcessMethodLongest():
7071
dst_inputFile = av.InputFile( outputFileName )
7172
dst_properties = dst_inputFile.getProperties()
7273

73-
assert_equals( dst_properties.getDuration(), src_properties_longest.getDuration() )
74+
for dst_stream_properties in dst_properties.getStreamProperties():
75+
assert_almost_equals( dst_stream_properties.getDuration(), src_properties_longest.getDuration(), delta=0.05 )
7476

7577

7678
def testEProcessMethodBasedOnStream():
@@ -130,5 +132,6 @@ def testEProcessMethodBasedOnDuration():
130132
dst_inputFile = av.InputFile( outputFileName )
131133
dst_properties = dst_inputFile.getProperties()
132134

133-
assert_equals( dst_properties.getDuration(), outputDuration )
135+
for dst_stream_properties in dst_properties.getStreamProperties():
136+
assert_almost_equals( dst_stream_properties.getDuration(), outputDuration, delta=0.05 )
134137

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