The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

iPod::Squish - Convert songs on an iPod in place using FFmpeg::Command.

SYNOPSIS

        use iPod::Squish;

        my $squisher = iPod::Squish->new(
                volume => "/Volumes/iPod Name"
                target_bitrate => 128,
        );

        $squisher->run;

DESCRIPTION

This module uses FFmpeg::Command to perform automatic conversion of songs on an iPod after they've been synced.

Since most headphones are too crappy to notice converting songs to a lower bitrate is often convenient to save size.

Only files with a bitrate over target_bitrate will be converted.

Currently only MP3 files will be converted and the output format is MP3 as well. AAC support would be nice, see "TODO".

ATTRIBUTES

volume

The mount point of the iPod you want to reencode.

target_bitrate

The bitrate to encode to.

Only songs whose bitrate is higher than this will be encoded.

jobs

The number of parallel ffmpeg instances to run. Defaults to 2. Useful for multi processor or multi core machines.

ffmpeg_output_options

Additional output options for FFmpeg::Command.

METHODS

run

Do the conversion by recursing through the iPod's music directory and running process_file for each file (possibly in parallel, see jobs).

process_file $file

Attempt to convert the file, and if conversion succeeds replace the original with the new version.

The file will only be converted if its an MP3.

reencode_file $file

Does the actual encoding/move of the file.

LOGGING

This module uses MooseX::LogDispatch, which in turn uses Log::Dispatch::Config. This allows you to control logging to your heart's content. The default is to just print the messages to STDERR.

TODO

VBR

I'm not quite sure how to specify varible bitrate for ffmpeg. Should look into that.

launchd integration

Perhaps make a script to add a launchd service for a given ipod based on the dir watching service, so that an iPod is squished automatically. This combined with an on-mount watcher and an index of already converted files should allow a fairly seamless workflow, even if you don't want to wait after syncing.

m4a

Support m4a type AAC files (I don't think ffmpeg allows this, but I'm not quite sure). Encoding to AAC definitely is supported.

format consolidation

Check if an iPod will swallow files in a format different than the name/library entry implies.

If not, try to use rewrite library entries, as long as this doesn't affect synchronization.

Perhaps look at Mac::iPod::DB for details.

SEE ALSO

FFmpeg::Command, Audio::File, Mac::iPod::DB,

VERSION CONTROL

This module is maintained using Darcs. You can get the latest version from http://nothingmuch.woobling.org/code, and use darcs send to commit changes.

AUTHOR

Yuval Kogman <nothingmuch@woobling.org>

COPYRIGHT

        Copyright (c) 2008 Yuval Kogman. All rights reserved
        This program is free software; you can redistribute
        it and/or modify it under the same terms as Perl itself.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 260:

You forgot a '=back' before '=head1'