summaryrefslogtreecommitdiffstats
path: root/abs/core/nuvexport/XviD.pm
diff options
context:
space:
mode:
authorJames Meyer <james.meyer@operamail.com>2013-02-19 21:10:18 (GMT)
committerJames Meyer <james.meyer@operamail.com>2013-02-19 21:10:18 (GMT)
commit2648e999d277eac5c3d331a3609bcc73fafbea71 (patch)
tree40951fb8e7fdbe28a0baa324ae615055203f1e2e /abs/core/nuvexport/XviD.pm
parentc759b5e0c4aa6fc37412b4dee2cf9ad993fd376d (diff)
parent7e6f7ca174e1af67178dc5293a312a4a733eb095 (diff)
downloadlinhes_pkgbuild-2648e999d277eac5c3d331a3609bcc73fafbea71.zip
linhes_pkgbuild-2648e999d277eac5c3d331a3609bcc73fafbea71.tar.gz
linhes_pkgbuild-2648e999d277eac5c3d331a3609bcc73fafbea71.tar.bz2
Merge branch 'testing'
# By James Meyer (1091) and others # Via James Meyer (5) and others * testing: (1148 commits) LinHES-config: during install don't kill off lirc. This keeps the remote active all the way to the finish Change version numbers to 8.0 to match the release number. LinHES-conifg LinHES-system mythdb-initial runit-scripts supplemental-web LinHES-conifig: mv_install.py for the last partition don't go all the way to the end. Gotta leave room for gpt tables. xf86-video-ati: xorg ati driver. LinHES-config: timezip.py add syncing up of parental lvl passwords and starting level with MBE. LinHES-system: correct the logic for breaking out of the wmctrl loop. As written it would break out of the inner loop..but not the 60 iteration loop. e16_theme_settings: remove slide-in prop for new windows. For whatever reason this was preventing mplayer from being positioned correctly for appletrailers. LinHES-config, mythinstall: change case of hd_pvr and serial to all lower refs #902 zilog-firmware: firmware for TX support of the hdpvr and pvr-150 In general I can't recommend anybody using these transmitters but including the firmware just in case someone really wants to linhes-udev-rules: added hdprv_lirc rule. All of these lirc rules are limited to exactly one device. If more then one device is present then only the last device in init will get the symlink runit-scripts: fix logging for igdeamon, add support to remote init script so that the blaster is always the first device in the chain. added support specificly for hd_pvr LinHES-system: add lh_system_restore and lh_system_backup. These scripts are called from the mythmenu. refs #900 iguanair: rebuild with python 2.7 LinHES-system: msg_daemon.py fix init and nasty bug related to timeout. In a nutshell timeout wouldn't work unless a msg without a timeout was called first. linhes-udev-rules: add rules for mce,streamzap,serial lirc devices. mythinstall: recompile for matching libs mythtv: latest .25-fixes and change mythbackup/restore call lh_system_$op to replace mythbackup/mythrestore. mythbackup no longer works correctly with the new windowmanager linhes-scripts: myth2mp3, myth2x264, myth2xvid: use mythutil to get cutlist LinHES-config, supplimental-web: Fix proxy numbering for Ceton infiniTV linhes-system: add additional stuff to the system backup and also introduced an exclude file. The exclude/include files are locate in /home/mythtv/backup_config/ ...
Diffstat (limited to 'abs/core/nuvexport/XviD.pm')
-rwxr-xr-xabs/core/nuvexport/XviD.pm197
1 files changed, 0 insertions, 197 deletions
diff --git a/abs/core/nuvexport/XviD.pm b/abs/core/nuvexport/XviD.pm
deleted file mode 100755
index c4700f5..0000000
--- a/abs/core/nuvexport/XviD.pm
+++ /dev/null
@@ -1,197 +0,0 @@
-#
-# ffmpeg-based XviD export module for nuvexport.
-#
-# @url $URL: svn+ssh://xris@svn.mythtv.org/var/lib/svn/trunk/mythextras/nuvexport/export/ffmpeg/XviD.pm $
-# @date $Date: 2008-02-19 20:47:06 -0800 (Tue, 19 Feb 2008) $
-# @version $Revision: 16175 $
-# @author $Author: xris $
-# @copyright Silicon Mechanics
-#
-
-package export::ffmpeg::XviD;
- use base 'export::ffmpeg';
-
-# Load the myth and nuv utilities, and make sure we're connected to the database
- use nuv_export::shared_utils;
- use nuv_export::cli;
- use nuv_export::ui;
- use mythtv::recordings;
-
-# Load the following extra parameters from the commandline
- add_arg('quantisation|q=i', 'Quantisation');
- add_arg('a_bitrate|a=i', 'Audio bitrate');
- add_arg('v_bitrate|v=i', 'Video bitrate');
- add_arg('multipass!', 'Enable two-pass encoding.');
-
- sub new {
- my $class = shift;
- my $self = {
- 'cli' => qr/\bxvid\b/i,
- 'name' => 'Export to XviD',
- 'enabled' => 1,
- 'errors' => [],
- 'defaults' => {},
- };
- bless($self, $class);
-
- # Initialize the default parameters
- $self->load_defaults();
-
- # Verify any commandline or config file options
- die "Audio bitrate must be > 0\n" unless (!defined $self->val('a_bitrate') || $self->{'a_bitrate'} > 0);
- die "Video bitrate must be > 0\n" unless (!defined $self->val('v_bitrate') || $self->{'v_bitrate'} > 0);
- die "Width must be > 0\n" unless (!defined $self->val('width') || $self->{'width'} =~ /^\s*\D/ || $self->{'width'} > 0);
- die "Height must be > 0\n" unless (!defined $self->val('height') || $self->{'height'} =~ /^\s*\D/ || $self->{'height'} > 0);
-
- # VBR, multipass, etc.
- if ($self->val('multipass')) {
- $self->{'vbr'} = 1;
- }
- elsif ($self->val('quantisation')) {
- die "Quantisation must be a number between 1 and 31 (lower means better quality).\n" if ($self->{'quantisation'} < 1 || $self->{'quantisation'} > 31);
- $self->{'vbr'} = 1;
- }
-
- # Initialize and check for ffmpeg
- $self->init_ffmpeg();
-
- # Can we even encode xvid?
- if (!$self->can_encode('xvid') && !$self->can_encode('libxvid')) {
- push @{$self->{'errors'}}, "Your ffmpeg installation doesn't support encoding to xvid.\n"
- ." (It must be compiled with the --enable-libxvid option)";
- }
- if (!$self->can_encode('mp3') && !$self->can_encode('libmp3lame')) {
- push @{$self->{'errors'}}, "Your ffmpeg installation doesn't support encoding to mp3 audio.";
- }
-
- # Any errors? disable this function
- $self->{'enabled'} = 0 if ($self->{'errors'} && @{$self->{'errors'}} > 0);
- # Return
- return $self;
- }
-
-# Load default settings
- sub load_defaults {
- my $self = shift;
- # Load the parent module's settings
- $self->SUPER::load_defaults();
- # Default bitrates and resolution
- $self->{'defaults'}{'a_bitrate'} = 128;
- $self->{'defaults'}{'v_bitrate'} = 960;
- $self->{'defaults'}{'width'} = 624;
- }
-
-# Gather settings from the user
- sub gather_settings {
- my $self = shift;
- # Load the parent module's settings
- $self->SUPER::gather_settings();
- # Audio Bitrate
- $self->{'a_bitrate'} = query_text('Audio bitrate?',
- 'int',
- $self->val('a_bitrate'));
- # VBR options
- if (!$is_cli) {
- $self->{'vbr'} = query_text('Variable bitrate video?',
- 'yesno',
- $self->val('vbr'));
- if ($self->{'vbr'}) {
- $self->{'multipass'} = query_text('Multi-pass (slower, but better quality)?',
- 'yesno',
- $self->val('multipass'));
- if (!$self->{'multipass'}) {
- while (1) {
- my $quantisation = query_text('VBR quality/quantisation (1-31)?',
- 'float',
- $self->val('quantisation'));
- if ($quantisation < 1) {
- print "Too low; please choose a number between 1 and 31.\n";
- }
- elsif ($quantisation > 31) {
- print "Too high; please choose a number between 1 and 31\n";
- }
- else {
- $self->{'quantisation'} = $quantisation;
- last;
- }
- }
- }
- } else {
- $self->{'multipass'} = 0;
- }
- # Ask the user what video bitrate he/she wants
- $self->{'v_bitrate'} = query_text('Video bitrate?',
- 'int',
- $self->val('v_bitrate'));
- }
- # Query the resolution
- $self->query_resolution();
- }
-
- sub export {
- my $self = shift;
- my $episode = shift;
- # Make sure we have the framerate
- $self->{'out_fps'} = $episode->{'finfo'}{'fps'};
- # Embed the title
- $safe_title = $episode->{'title'};
- if ($episode->{'subtitle'} ne 'Untitled') {
- $safe_title .= ' - '.$episode->{'subtitle'};
- }
- my $safe_title = shell_escape($safe_title);
- # Codec name changes between ffmpeg versions
- my $codec = $self->can_encode('libxvid') ? 'libxvid' : 'xvid';
- # Build the common ffmpeg string
- my $ffmpeg_xtra = ' -vcodec '.$codec
- .$self->param('bit_rate', $self->{'v_bitrate'})
- .($self->{'vbr'}
- ? $self->param('rc_min_rate', 32)
- . $self->param('rc_max_rate', (2 * $self->{'v_bitrate'}))
- . $self->param('bit_rate_tolerance', 32)
- . ' -bufsize 65535'
- : '')
- .' -flags +mv4+loop+cgop'
- .' -trellis 1'
- ### .' -aic 1'
- .' -mbd 1'
- .' -cmp 2 -subcmp 2'
- ### .' -cgop 1'
- .$self->param('b_quant_factor', 150)
- .$self->param('b_quant_offset', 100)
- .$self->param('max_b_frames', 1)
- ;
- # Dual pass?
- if ($self->{'multipass'}) {
- # Add the temporary file to the list
- push @tmpfiles, "/tmp/xvid.$$.log";
- # First pass
- print "First pass...\n";
- $self->{'ffmpeg_xtra'} = $ffmpeg_xtra
- ." -pass 1 -passlogfile '/tmp/xvid.$$.log'"
- .' -f avi';
- $self->SUPER::export($episode, '', 1);
- # Second pass
- print "Final pass...\n";
- $self->{'ffmpeg_xtra'} = $ffmpeg_xtra
- . " -pass 2 -passlogfile '/tmp/xvid.$$.log'";
- }
- # Single Pass
- else {
- $self->{'ffmpeg_xtra'} = $ffmpeg_xtra
- .($self->{'vbr'}
- ? ' -qmax 31 -qmin '.$self->{'quantisation'}
- : '');
- }
- # Don't forget the audio, etc.
- $self->{'ffmpeg_xtra'} .= ' -acodec '
- .($self->can_encode('libmp3lame') ? 'libmp3lame' : 'mp3')
- .' -async 1 '
- .$self->param('ab', $self->{'a_bitrate'})
- .' -f avi';
- # Execute the (final pass) encode
- $self->SUPER::export($episode, '.avi');
- }
-
-1; #return true
-
-# vim:ts=4:sw=4:ai:et:si:sts=4