Skip to content

Commit f1b6360

Browse files
author
Clement Champetier
committed
pyTest: added a test to check rewrap of a raw video stream
1 parent 5e6e05a commit f1b6360

File tree

1 file changed

+39
-3
lines changed

1 file changed

+39
-3
lines changed

test/pyTest/testTranscoderRewrap.py

Lines changed: 39 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,14 @@
33
# Check if environment is setup to run the tests
44
if os.environ.get('AVTRANSCODER_TEST_AUDIO_WAVE_FILE') is None or \
55
os.environ.get('AVTRANSCODER_TEST_VIDEO_AVI_FILE') is None or \
6-
os.environ.get('AVTRANSCODER_TEST_VIDEO_MOV_FILE') is None:
6+
os.environ.get('AVTRANSCODER_TEST_VIDEO_MOV_FILE') is None or \
7+
os.environ.get('AVTRANSCODER_TEST_VIDEO_RAW_FILE') is None:
78
from nose.plugins.skip import SkipTest
89
raise SkipTest("Need to define environment variables "
9-
"AVTRANSCODER_TEST_VIDEO_AVI_FILE and "
1010
"AVTRANSCODER_TEST_AUDIO_WAVE_FILE and "
11-
"AVTRANSCODER_TEST_VIDEO_MOV_FILE")
11+
"AVTRANSCODER_TEST_VIDEO_AVI_FILE and "
12+
"AVTRANSCODER_TEST_VIDEO_MOV_FILE and "
13+
"AVTRANSCODER_TEST_VIDEO_RAW_FILE")
1214

1315
from nose.tools import *
1416

@@ -156,3 +158,37 @@ def testRewrapMOVVideoStream():
156158

157159
# check video properties
158160
checkStream(src_videoStream, dst_videoStream)
161+
162+
163+
def testRewrapRawVideoStream():
164+
"""
165+
Rewrap one raw video stream (no format).
166+
"""
167+
# get src file of wrap
168+
inputFileName = os.environ['AVTRANSCODER_TEST_VIDEO_RAW_FILE']
169+
src_inputFile = av.InputFile(inputFileName)
170+
src_properties = src_inputFile.getProperties()
171+
src_videoStream = src_properties.getVideoProperties()[0]
172+
173+
formatList = src_properties.getFormatName().split(",")
174+
outputFileName = "testRewrapRawVideoStream." + formatList[0]
175+
ouputFile = av.OutputFile(outputFileName)
176+
177+
transcoder = av.Transcoder(ouputFile)
178+
transcoder.add(inputFileName, 0)
179+
progress = av.NoDisplayProgress()
180+
processStat = transcoder.process(progress)
181+
182+
# check process stat returned
183+
checkVideoStat(src_videoStream, processStat.getVideoStat(0))
184+
185+
# get dst file of wrap
186+
dst_inputFile = av.InputFile(outputFileName)
187+
dst_properties = dst_inputFile.getProperties()
188+
dst_videoStream = dst_properties.getVideoProperties()[0]
189+
190+
# check format
191+
checkFormat(src_properties, dst_properties)
192+
193+
# check video properties
194+
checkStream(src_videoStream, dst_videoStream)

0 commit comments

Comments
 (0)