@@ -52,7 +52,7 @@ def testTranscodeMovVariableNbSamplesPerFrame():
52
52
def testTranscodeMovExtractChannels ():
53
53
"""
54
54
Transcode the audio stream of a MOV file which contains a video stream.
55
- Extract channel one and third of the audio stream (5.1).
55
+ Extract channel one and third of the audio stream (5.1), and create two output streams .
56
56
The encoding profile will be found from from input.
57
57
"""
58
58
inputFileName = os .environ ['AVTRANSCODER_TEST_AUDIO_MOV_FILE' ]
@@ -78,3 +78,35 @@ def testTranscodeMovExtractChannels():
78
78
dst_inputFile = av .InputFile ( outputFileName )
79
79
for dst_audioStream in dst_inputFile .getProperties ().getAudioProperties ():
80
80
assert_equals ( 1 , dst_audioStream .getNbChannels () )
81
+
82
+
83
+ def testTranscodeMovExtractChannelsToOneOutput ():
84
+ """
85
+ Transcode the audio stream of a MOV file which contains a video stream.
86
+ Extract channel one, third and fifth of the audio stream (5.1), and create one output streams.
87
+ The encoding profile will be found from from input.
88
+ """
89
+ inputFileName = os .environ ['AVTRANSCODER_TEST_AUDIO_MOV_FILE' ]
90
+ outputFileName = "testTranscodeMovExtractChannelsToOneOutput.mov"
91
+
92
+ ouputFile = av .OutputFile ( outputFileName )
93
+ transcoder = av .Transcoder ( ouputFile )
94
+
95
+ inputFile = av .InputFile ( inputFileName )
96
+ src_audioStream = inputFile .getProperties ().getAudioProperties ()[0 ]
97
+ audioStreamIndex = src_audioStream .getStreamIndex ()
98
+ audiochannelIndexArray = (0 , 3 , 5 )
99
+ transcoder .addStream ( av .InputStreamDesc (inputFileName , audioStreamIndex , audiochannelIndexArray ) )
100
+
101
+ progress = av .ConsoleProgress ()
102
+ processStat = transcoder .process ( progress )
103
+
104
+ # check process stat returned
105
+ audioStat = processStat .getAudioStat (0 )
106
+ assert_equals (src_audioStream .getDuration (), audioStat .getDuration ())
107
+
108
+ # check dst audio streams
109
+ dst_inputFile = av .InputFile ( outputFileName )
110
+ dst_audioProperties = dst_inputFile .getProperties ().getAudioProperties ()
111
+ assert_equals ( 1 , len (dst_audioProperties ) )
112
+ assert_equals ( 3 , dst_audioProperties [0 ].getNbChannels () )
0 commit comments