@@ -43,9 +43,39 @@ def testTranscodeMovVariableNbSamplesPerFrame():
43
43
44
44
# get dst file of transcode
45
45
dst_inputFile = av .InputFile ( outputFileName )
46
- dst_inputFile .analyse ( progress , av .eAnalyseLevelHeader )
47
46
dst_properties = dst_inputFile .getProperties ()
48
47
dst_audioStream = dst_properties .getAudioProperties ()[0 ]
49
48
50
49
assert_equals ( "pcm_s24le" , dst_audioStream .getCodecName () )
51
50
assert_equals ( "PCM signed 24-bit little-endian" , dst_audioStream .getCodecLongName () )
51
+
52
+
53
+ def testTranscodeMovExtractChannels ():
54
+ """
55
+ Transcode the audio stream of a MOV file which contains a video stream.
56
+ Extract channel one and third of the audio stream (5.1).
57
+ The encoding profile will be found from from input.
58
+ """
59
+ inputFileName = os .environ ['AVTRANSCODER_TEST_AUDIO_MOV_FILE' ]
60
+ outputFileName = "testTranscodeMovExtractChannels.mov"
61
+
62
+ ouputFile = av .OutputFile ( outputFileName )
63
+ transcoder = av .Transcoder ( ouputFile )
64
+
65
+ inputFile = av .InputFile ( inputFileName )
66
+ src_audioStream = inputFile .getProperties ().getAudioProperties ()[0 ]
67
+ audioStreamIndex = src_audioStream .getStreamIndex ()
68
+ transcoder .add ( inputFileName , audioStreamIndex , 0 )
69
+ transcoder .add ( inputFileName , audioStreamIndex , 3 )
70
+
71
+ progress = av .ConsoleProgress ()
72
+ processStat = transcoder .process ( progress )
73
+
74
+ # check process stat returned
75
+ audioStat = processStat .getAudioStat (0 )
76
+ assert_equals (src_audioStream .getDuration (), audioStat .getDuration ())
77
+
78
+ # check dst audio streams
79
+ dst_inputFile = av .InputFile ( outputFileName )
80
+ for dst_audioStream in dst_inputFile .getProperties ().getAudioProperties ():
81
+ assert_equals ( 1 , dst_audioStream .getNbChannels () )
0 commit comments