-
Notifications
You must be signed in to change notification settings - Fork 50
Expand file tree
/
Copy pathtestUtil.py
More file actions
87 lines (68 loc) · 3.05 KB
/
Copy pathtestUtil.py
File metadata and controls
87 lines (68 loc) · 3.05 KB
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
from nose.tools import *
from pyAvTranscoder import avtranscoder as av
def testSupportedPixelFormats():
"""
Check supported pixel formats of mpeg2video codec.
Check access to the list of all supported pixel formats.
"""
# Check supported pixel formats of mpeg2video codec
videoCodecName = "mpeg2video"
mpeg2videoSupportedPixelFormats = av.getSupportedPixelFormats(videoCodecName)
assert_equals(len(mpeg2videoSupportedPixelFormats), 2)
assert_in("yuv420p", mpeg2videoSupportedPixelFormats)
assert_in("yuv422p", mpeg2videoSupportedPixelFormats)
# Check if there is more pixel formats available
allSupportedPixelFormats = av.getSupportedPixelFormats()
assert_less(len(mpeg2videoSupportedPixelFormats), len(allSupportedPixelFormats))
def testSupportedSampleFormats():
"""
Check supported sample formats of pcm_s24le codec.
Check access to the list of all supported sample formats.
"""
# Check supported sample formats of pcm_s24le codec
audioCodecName = "pcm_s24le"
pcmSupportedSampleFormats = av.getSupportedSampleFormats(audioCodecName)
assert_equals(len(pcmSupportedSampleFormats), 1)
assert_in("s32", pcmSupportedSampleFormats)
# Check if there is more sample formats available
allSupportedSampleFormats = av.getSupportedSampleFormats()
assert_less(len(pcmSupportedSampleFormats), len(allSupportedSampleFormats))
def testAccessToAPixelFormat():
"""
Check if we can access an AVPixelFormat from a name, and retrieve the name from this constant value.
"""
strPixelFormat = "yuv420p"
avPixelFormat = av.getAVPixelFormat(strPixelFormat)
assert_equals(av.getPixelFormatName(avPixelFormat), strPixelFormat)
def testAccessToASampleFormat():
"""
Check if we can access an AVSampleFormat from a name, and retrieve the name from this constant value.
"""
strSampleFormat = "s32"
avSampleFormat = av.getAVSampleFormat(strSampleFormat)
assert_equals(av.getSampleFormatName(avSampleFormat), strSampleFormat)
def testAccessToAvailableFormatsNames():
"""
Check if we can access the list of available formats.
@note Tested with ffmpeg-2.4.2
"""
availableFormats = av.getAvailableFormatsNames()
assert_greater_equal(len(availableFormats), 135)
availableVideoFormats = av.getAvailableVideoFormatsNames()
assert_greater_equal(len(availableVideoFormats), 71)
availableAudioFormats = av.getAvailableAudioFormatsNames()
assert_greater_equal(len(availableAudioFormats), 99)
def testAccessToAvailableVideoCodecsNames():
"""
Check if we can access the list of available video codecs.
@note Tested with ffmpeg-2.4.2
"""
availableVideoCodecs = av.getAvailableVideoCodecsNames()
assert_greater_equal(len(availableVideoCodecs), 204)
def testAccessToAvailableAudioCodecsNames():
"""
Check if we can access the list of available audio codecs.
@note Tested with ffmpeg-2.4.2
"""
availableAudioCodecs = av.getAvailableAudioCodecsNames()
assert_greater_equal(len(availableAudioCodecs), 152)