Changeset 221

Show
Ignore:
Timestamp:
07/31/06 23:41:24 (2 years ago)
Author:
miya
Message:

Filer::FFmpeg: Added encoding option.
Modified to set title, author and comment to the output file.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plagger/trunk/lib/Plagger/Plugin/Filter/FFmpeg.pm

    r213 r221  
    66use File::Spec; 
    77use FFmpeg::Command; 
     8use Encode; 
    89 
    910sub register { 
     
    2122 
    2223    my $ext = $self->conf->{ext} || 'mp4'; 
     24    my $encoding = $self->conf->{encoding} || 'cp932'; 
    2325 
    2426    my $file = eval { $e->enclosure->filename }; 
     
    3436    my $output_file = File::Spec->catfile($self->conf->{dir}, "$file.$ext"); 
    3537    $ff->output_options({ 
    36         file   => $output_file, 
    37         device => $self->conf->{device} || 'ipod', 
     38        file    => $output_file, 
     39        device  => $self->conf->{device} || 'ipod', 
     40        title   => encode($encoding, $e->title), 
     41        author  => encode($encoding, $e->author), 
     42        comment => encode($encoding, $e->summary), 
    3843        %{ $self->conf->{options} || {} }, 
    3944    }); 
     
    7984      command: /usr/local/bin/ffmpeg 
    8085      options: 
     86        encoding:            cp932 
    8187        format:              psp 
    8288        video_codec:         h264 
    8389        bitrate:             600 
    84         size:                320x240 
     90        frame_size:          320x240 
    8591        audio_codec:         aac 
    8692        audio_sampling_rate: 48000 
     
    120126=over 
    121127 
    122 =item file 
     128=item encoding 
    123129 
    124 a file name of output file
     130Character encoding of title, author and comment.Default value is cp932
    125131 
    126132=item format 
     
    136142Output video bitrate. 
    137143 
    138 =item size 
     144=item frame_size 
    139145 
    140146Output video screen size.