forked from avTranscoder/avTranscoder
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtestTranscoderAdd.py
More file actions
36 lines (26 loc) · 1018 Bytes
/
Copy pathtestTranscoderAdd.py
File metadata and controls
36 lines (26 loc) · 1018 Bytes
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
import os
# Check if environment is setup to run the tests
if os.environ.get('AVTRANSCODER_TEST_AUDIO_WAVE_FILE') is None:
from nose.plugins.skip import SkipTest
raise SkipTest("Need to define environment variable AVTRANSCODER_TEST_AUDIO_WAVE_FILE")
from nose.tools import *
from pyAvTranscoder import avtranscoder as av
av.preloadCodecsAndFormats()
av.Logger.setLogLevel(av.AV_LOG_QUIET)
def testAddStreamTranscoder():
"""
Add a streamTranscoder to the Transcoder, and process rewrap of an audio stream.
"""
# input
inputFile = av.InputFile( os.environ['AVTRANSCODER_TEST_AUDIO_WAVE_FILE'] )
inputIndex = 0
inputFile.activateStream( inputIndex )
# output
outputFileName = "testAddStreamTranscoder.avi"
ouputFile = av.OutputFile( outputFileName )
streamTranscoder = av.StreamTranscoder( inputFile.getStream( inputIndex ), ouputFile )
transcoder = av.Transcoder( ouputFile )
transcoder.add( streamTranscoder)
# process
progress = av.NoDisplayProgress()
transcoder.process( progress )