|
3 | 3 | # Check if environment is setup to run the tests
|
4 | 4 | if os.environ.get('AVTRANSCODER_TEST_AUDIO_WAVE_FILE') is None or \
|
5 | 5 | 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: |
7 | 8 | from nose.plugins.skip import SkipTest
|
8 | 9 | raise SkipTest("Need to define environment variables "
|
9 |
| - "AVTRANSCODER_TEST_VIDEO_AVI_FILE and " |
10 | 10 | "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") |
12 | 14 |
|
13 | 15 | from nose.tools import *
|
14 | 16 |
|
@@ -156,3 +158,37 @@ def testRewrapMOVVideoStream():
|
156 | 158 |
|
157 | 159 | # check video properties
|
158 | 160 | 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