On Mon, Sep 27, 2010 at 9:13 AM, Raymond Norton <admin at lctn.org> wrote:
> I am running a mythtv box and cannot get mythexport to work properly.
> However, I am able to run ffmpeg manually and transcode to mp4 for my
> Ipod. I am looking for a script that will launch ffmpeg and process all
> recordings for the day. All recordings are named in the following
> format: 1260_20100927050000.mpg (Year, Month, Day, and Time). I would
> like the script to run against any file created for the current day.
> The ffmpeg command I use is very simple,  (ffmpeg -i
> 1260_20100927050000.mpg 1260_20100927050000.mp4)

I'd just do something simple like this. Create a shell script (named
"do-ipod-compress", for instance) that runs your ffmpeg command:

(the below code should be close. No guarantees, though...I haven't
actually tested it. Also, the below method will just tack on the .mp4
extension. If you want to replace the .mpg extension, you'll need to
do a bit more munging)

#!/bin/bash
ffmpeg -i $1 $1.mp4

Then from cron (or manually), you can run:

find /path/to/files -mtime 24 -type f -name "*.mpg" | xargs do-ipod-compress

That will list all .mpg files in the path that have been modified (or
created) in the past 24 hours, and will pass each list item in turn to
the compress script.