From 7bf388a2dd6c9a140c604609a5e26181b1fc7d79 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Sat, 13 Dec 2008 20:50:45 -0500 Subject: [PATCH] Per-TiVo buffer size, per wgw. --- config.py | 19 +++++++++++++++---- plugins/admin/help.txt | 10 +++++----- plugins/video/transcode.py | 6 +++--- 3 files changed, 23 insertions(+), 12 deletions(-) diff --git a/config.py b/config.py index d590348..9a435fb 100644 --- a/config.py +++ b/config.py @@ -281,10 +281,21 @@ def getVideoPCT(): except NoOptionError: return 70 -def getBuffSize(): - try: - return _k(config.get('Server', 'bufsize')) - except NoOptionError: #default 1024k +def getBuffSize(tsn = None): + if tsn and config.has_section('_tivo_' + tsn): + if config.has_option('_tivo_' + tsn, 'bufsize'): + try: + return _k(config.get('_tivo_' + tsn, 'bufsize')) + except NoOptionError: + pass + if config.has_option('Server', 'bufsize'): + try: + return _k(config.get('Server', 'bufsize')) + except NoOptionError: + pass + if isHDtivo(tsn): + return '4096k' + else: return '1024k' def getMaxAudioBR(tsn = None): diff --git a/plugins/admin/help.txt b/plugins/admin/help.txt index 5a4a66b..b37fd45 100644 --- a/plugins/admin/help.txt +++ b/plugins/admin/help.txt @@ -138,7 +138,7 @@ Default Setting: 4096K for SD TiVo's, 8192K for HD TiVo's Valid Entries: Any valid Bit rate. 1024K = 1Mi Required: No Skill: Advanced -Description: This allows you to choose the default server video bit rate used in transcoding. FFmpeg does not strictly follow this bit rate, there is a certain level of tolerance that is allowed. Also a low quality file will always have a low bit rate. The default is likely fine for most users. Higher values may slow down transcoding and will increase the file size. Increased file sizes take up more room on the TiVo and take longer to transfer over the network. See the bufsize setting if you increase this setting to 12Mi or above for transcoding to 1080 resolutions. +Description: This allows you to choose the default server video bit rate used in transcoding. FFmpeg does not strictly follow this bit rate, there is a certain level of tolerance that is allowed. Also a low quality file will always have a low bit rate. The default is likely fine for most users. Higher values may slow down transcoding and will increase the file size. Increased file sizes take up more room on the TiVo and take longer to transfer over the network. Example Settings: 4096K, 8Mi, 12Mi, 16Mi Available In: Server, Tivos @@ -166,14 +166,14 @@ Available In: Server bufsize -Recommended Setting: 4096k -pyTivo Defaults To: 1024k +Recommended Setting: blank +pyTivo Defaults To: 1024k for S2, 4096k for S3 Valid Entries: Any valid byte size Required: No Skill: Very Advanced -Description: Allows you to set the buffer size used by ffmpeg. Increasing this setting will allow higher bitrates during transcoding (see video_br setting), especially when transcoding to HD resolutions. But it may result in pixelation or audio sync issues with some sources. 1024k is fine for the resolutions used by S2 tivos. But you will probably want to increase this setting to 2048k or 4096k if you have an HD tivo. +Description: Allows you to set the buffer size used by ffmpeg. Increasing this setting will allow higher bitrates during transcoding (see video_br setting), especially when transcoding to HD resolutions. But it may result in pixelation or audio sync issues with some sources. 1024k is fine for the resolutions used by S2 tivos. But 2048k or 4096k is preferred for HD tivos. Leave this setting blank unless you are experiencing audio/video sync issues and wish to test a different value. Example Settings: 1024k, 2048k, 4096k -Available In: Server +Available In: Server, Tivos width diff --git a/plugins/video/transcode.py b/plugins/video/transcode.py index 52fc83b..61d580e 100644 --- a/plugins/video/transcode.py +++ b/plugins/video/transcode.py @@ -44,7 +44,7 @@ def transcode(isQuery, inFile, outFile, tsn=''): settings['video_br'] = select_videobr(inFile, tsn) settings['video_fps'] = select_videofps(inFile, tsn) settings['max_video_br'] = select_maxvideobr() - settings['buff_size'] = select_buffsize() + settings['buff_size'] = select_buffsize(tsn) settings['aspect_ratio'] = ' '.join(select_aspect(inFile, tsn)) settings['audio_br'] = select_audiobr(tsn) settings['audio_fr'] = select_audiofr(inFile, tsn) @@ -160,8 +160,8 @@ def select_audiobr(tsn): def select_maxvideobr(): return '-maxrate '+config.getMaxVideoBR() -def select_buffsize(): - return '-bufsize '+config.getBuffSize() +def select_buffsize(tsn): + return '-bufsize '+config.getBuffSize(tsn) def select_ffmpegprams(tsn): if config.getFFmpegPrams(tsn) != None: -- 2.11.4.GIT