From 5be9ad6a8c914eb00d5def78656965d7ec6577ad Mon Sep 17 00:00:00 2001 From: wgw Date: Sat, 15 Mar 2008 03:47:23 -0500 Subject: [PATCH] common audio codec handling. AFAICT ac3 is supported by S2. Changing default acodec/copy selection to a common process. --- plugins/admin/templates/settings.tmpl | 4 ++-- plugins/video/transcode.py | 23 +++++++---------------- 2 files changed, 9 insertions(+), 18 deletions(-) diff --git a/plugins/admin/templates/settings.tmpl b/plugins/admin/templates/settings.tmpl index d47d9a0..ef29458 100644 --- a/plugins/admin/templates/settings.tmpl +++ b/plugins/admin/templates/settings.tmpl @@ -973,7 +973,7 @@ it is 44100 or 48000. Otherwise 48000 is used.

audio_ch

-

Default Setting: 2 for S2 TiVo, blank for S3/HD TiVo
+

Default Setting: blank (same as source)
Valid Entries: any number compatible with ffmpeg and the audio codec selected
@@ -993,7 +993,7 @@ unless the default audio_codec is changed.

audio_codec

-

Default Setting: mp2 for S2 TiVo, ac3 for S3/HD TiVo
+

Default Setting: ac3
Valid Entries: mp2, ac3
diff --git a/plugins/video/transcode.py b/plugins/video/transcode.py index 20a9e81..46fd862 100644 --- a/plugins/video/transcode.py +++ b/plugins/video/transcode.py @@ -62,24 +62,17 @@ def transcode(inFile, outFile, tsn=''): def select_audiocodec(inFile, tsn = ''): # Default, compatible with all TiVo's - codec = 'mp2' + codec = 'ac3' if config.getAudioCodec(tsn) == None: type, width, height, fps, millisecs, kbps, akbps, acodec, afreq = video_info(inFile) - if akbps == None and acodec in ('ac3', 'liba52', 'mp2'): - cmd_string = '-y -vcodec mpeg2video -r 29.97 -b 1000k -acodec copy -t 00:00:01 -f vob -' - if video_check(inFile, cmd_string): - type, width, height, fps, millisecs, kbps, akbps, acodec, afreq = video_info(videotest) - if config.isHDtivo(tsn): - # Is HD Tivo, use ac3 - codec = 'ac3' - if acodec in ('ac3', 'liba52') and not akbps == None and \ - int(akbps) <= config.getMaxAudioBR(tsn): + if acodec in ('ac3', 'liba52', 'mp2'): + if akbps == None: + cmd_string = '-y -vcodec mpeg2video -r 29.97 -b 1000k -acodec copy -t 00:00:01 -f vob -' + if video_check(inFile, cmd_string): + type, width, height, fps, millisecs, kbps, akbps, acodec, afreq = video_info(videotest) + if not akbps == None and int(akbps) <= config.getMaxAudioBR(tsn): # compatible codec and bitrate, do not reencode audio codec = 'copy' - if acodec == 'mp2' and not akbps == None and \ - int(akbps) <= config.getMaxAudioBR(tsn): - # compatible codec and bitrate, do not reencode audio - codec = 'copy' else: codec = config.getAudioCodec(tsn) return '-acodec '+codec @@ -97,8 +90,6 @@ def select_audiofr(inFile, tsn): def select_audioch(tsn): if config.getAudioCH(tsn) != None: return '-ac '+config.getAudioCH(tsn) - if not config.isHDtivo(tsn): - return '-ac 2' return '' def select_videofps(tsn): -- 2.11.4.GIT