Changeset 6009411f575aa843b8e92316e376fe90d1479f15
- Timestamp:
- 02/25/08 18:53:46
(11 months ago)
- Author:
- KRKeegan <-NOSPAM-kevin@krkeegan.com>
- git-committer:
- KRKeegan <-NOSPAM-kevin@krkeegan.com> 1203987226 -0800
- git-parent:
[9776082563bed7f4e5c92ed1cb75c7427fe97dfd]
- git-author:
- KRKeegan <-NOSPAM-kevin@krkeegan.com> 1203987226 -0800
- Message:
Convert transcode.py to respect config.py reset
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r6b0c52d |
r6009411 |
|
| 4 | 4 | info_cache = lrucache.LRUCache(1000) |
|---|
| 5 | 5 | |
|---|
| 6 | | debug = config.getDebug() |
|---|
| 7 | | BUFF_SIZE = config.getBuffSize() |
|---|
| 8 | | FFMPEG = config.get('Server', 'ffmpeg') |
|---|
| | 6 | def ffmpeg_path(): |
|---|
| | 7 | return config.get('Server', 'ffmpeg') |
|---|
| | 8 | |
|---|
| 9 | 9 | videotest = os.path.join(os.path.dirname(__file__), 'videotest.mpg') |
|---|
| 10 | 10 | |
|---|
| 11 | 11 | def debug_write(data): |
|---|
| 12 | | if debug: |
|---|
| | 12 | if config.getDebug(): |
|---|
| 13 | 13 | debug_out = [] |
|---|
| 14 | 14 | for x in data: |
|---|
| … | … | |
| 50 | 50 | settings['video_br'] = config.getVideoBR(tsn) |
|---|
| 51 | 51 | settings['max_video_br'] = config.getMaxVideoBR() |
|---|
| 52 | | settings['buff_size'] = BUFF_SIZE |
|---|
| | 52 | settings['buff_size'] = config.getBuffSize() |
|---|
| 53 | 53 | settings['aspect_ratio'] = ' '.join(select_aspect(inFile, tsn)) |
|---|
| 54 | 54 | |
|---|
| 55 | 55 | cmd_string = config.getFFMPEGTemplate(tsn) % settings |
|---|
| 56 | 56 | |
|---|
| 57 | | cmd = [FFMPEG, '-i', inFile] + cmd_string.split() |
|---|
| | 57 | cmd = [ffmpeg_path(), '-i', inFile] + cmd_string.split() |
|---|
| 58 | 58 | print cmd |
|---|
| 59 | 59 | debug_write(['transcode: ffmpeg command is ', ' '.join(cmd), '\n']) |
|---|
| … | … | |
| 295 | 295 | return True, True, True, True, True, True, True, True, True |
|---|
| 296 | 296 | |
|---|
| 297 | | cmd = [FFMPEG, '-i', inFile ] |
|---|
| | 297 | cmd = [ffmpeg_path(), '-i', inFile ] |
|---|
| 298 | 298 | ffmpeg = subprocess.Popen(cmd, stderr=subprocess.PIPE, stdout=subprocess.PIPE, stdin=subprocess.PIPE) |
|---|
| 299 | 299 | |
|---|
| … | … | |
| 404 | 404 | |
|---|
| 405 | 405 | def video_check(inFile, cmd_string): |
|---|
| 406 | | cmd = [FFMPEG, '-i', inFile] + cmd_string.split() |
|---|
| | 406 | cmd = [ffmpeg_path(), '-i', inFile] + cmd_string.split() |
|---|
| 407 | 407 | ffmpeg = subprocess.Popen(cmd, stdout=subprocess.PIPE) |
|---|
| 408 | 408 | try: |
|---|