@@ -8,23 +8,22 @@ def testRewrapAudioStream():
8
8
"""
9
9
Rewrap one audio stream.
10
10
"""
11
+ # get src file of wrap
11
12
inputFileName = os .environ ['AVTRANSCODER_TEST_AUDIO_FILE' ]
12
- outputFileName = "testRewrapAudioStream.wav"
13
+ src_inputFile = av .InputFile ( inputFileName )
14
+ progress = av .NoDisplayProgress ()
15
+ src_inputFile .analyse ( progress )
16
+ src_properties = src_inputFile .getProperties ()
17
+ src_audioStream = src_properties .getAudioProperties ()[0 ]
13
18
19
+ formatList = src_properties .getFormatName ().split ("," )
20
+ outputFileName = "testRewrapAudioStream." + formatList [0 ]
14
21
ouputFile = av .OutputFile ( outputFileName )
15
- transcoder = av .Transcoder ( ouputFile )
16
22
23
+ transcoder = av .Transcoder ( ouputFile )
17
24
transcoder .add ( inputFileName , 0 , "" )
18
-
19
- progress = av .NoDisplayProgress ()
20
25
transcoder .process ( progress )
21
26
22
- # get src file of wrap
23
- src_inputFile = av .InputFile ( inputFileName )
24
- src_inputFile .analyse ( progress )
25
- src_properties = src_inputFile .getProperties ()
26
- src_audioStream = src_properties .getAudioProperties ()[0 ]
27
-
28
27
# get dst file of wrap
29
28
dst_inputFile = av .InputFile ( outputFileName )
30
29
dst_inputFile .analyse ( progress , av .eAnalyseLevelHeader )
@@ -65,23 +64,22 @@ def testRewrapVideoStream():
65
64
"""
66
65
Rewrap one video stream.
67
66
"""
67
+ # get src file of wrap
68
68
inputFileName = os .environ ['AVTRANSCODER_TEST_VIDEO_FILE' ]
69
- outputFileName = "testRewrapVideoStream.avi"
69
+ src_inputFile = av .InputFile ( inputFileName )
70
+ progress = av .NoDisplayProgress ()
71
+ src_inputFile .analyse ( progress )
72
+ src_properties = src_inputFile .getProperties ()
73
+ src_videoStream = src_properties .getVideoProperties ()[0 ]
70
74
75
+ formatList = src_properties .getFormatName ().split ("," )
76
+ outputFileName = "testRewrapVideoStream." + formatList [0 ]
71
77
ouputFile = av .OutputFile ( outputFileName )
72
- transcoder = av .Transcoder ( ouputFile )
73
78
79
+ transcoder = av .Transcoder ( ouputFile )
74
80
transcoder .add ( inputFileName , 0 , "" )
75
-
76
- progress = av .NoDisplayProgress ()
77
81
transcoder .process ( progress )
78
82
79
- # get src file of wrap
80
- src_inputFile = av .InputFile ( inputFileName )
81
- src_inputFile .analyse ( progress )
82
- src_properties = src_inputFile .getProperties ()
83
- src_videoStream = src_properties .getVideoProperties ()[0 ]
84
-
85
83
# get dst file of wrap
86
84
dst_inputFile = av .InputFile ( outputFileName )
87
85
dst_inputFile .analyse ( progress )
0 commit comments