Author |
Message |
fireyice01
|
Posted: Sun Jul 16, 2006 3:11 am |
|
Joined: Thu Oct 06, 2005 9:31 pm
Posts: 9
|
I don't know if this has been covered, but I couldn't find anything on it.
What I am looking to do is have my myth box record shows, and then transcode them to mpeg4, move them to a directory where I save all my videos (myth stores to one dir, and then non myth videos to another). the second dir isn't actually even a local dir, but the purpose of this is to allow myth to record and store the file locally, and then convert it to something that can be played on any of my computers (windows, macs, linux, possibly an ipod) and then once it's been successfully converted, set it to expire the next day/week/whatever, so that I have the show available to watch on the tivo still (in the videos section, located on a fileserver remotely, instead of recordings section located on the local drive) and also be able to delete my recordings as I watch them so that the recordings drive doesn't fill up too fast .
I hope that made sense. Basically I want the tivo to
1) record the show
2) convert the show to xvid/divx and move it to a remote folder (mounted locally) preferably with the "pretty" name
3) set the show to expire in like 1 day/week, so it will be the first to go if the tivo needs more space
4) this might be asking a bit much, but if there were some way to actually see that it had been archived when going through the recordingls list, that would be awesome as well, but is less pertinent than the rest.
Thanks in advance for any and all help
|
|
Top |
|
 |
marc.aronson
|
Posted: Sun Jul 16, 2006 3:58 am |
|
Joined: Tue Jan 18, 2005 2:07 am
Posts: 1532
Location:
California
|
I have a script that transcodes mpeg2 files to mpeg4. It accepts two parameters:
1. Input: Path to the input file. You would point this at a file in /myth/tv or /myth/pretty.
2. Output: Path to the output file. You would point that at the folder where you want to put the mp4 encoded copy.
It leaves the input file in tact, so if you run this script on a file in /myth/tv or /myth/pretty, the original file remains available from the standard myth front end. Seems like you could either write a wrapper script that runs periodically to convert newly recorded shows, or perhaps use the "job queue" management capability built in myth to invoke the script everytime a new recording is created. I've never used the job queue stuff before, but I believe it can do this.
I'm away from my myth box until late July, but if this sounds useful let me know and I'll post a copy of the script when I return. Also let me know how many megabytes/hour you'd like to target, and I'll tweak the script to achieve that level. You can get excellant results at 600MB/hour; reasonable results at 400MB/hour.
In terms of expiration, you should be able to achieve that by simply allowing auto expiration of the recorded programs and also selecting the "record new epsiode if max epside count would be exceeded" option.
Marc
|
|
Top |
|
 |
diavolo
|
Posted: Tue Sep 05, 2006 7:51 pm |
|
Joined: Wed Feb 01, 2006 12:32 pm
Posts: 1
|
This sounds pretty useful. Can you post the script?
Thanks,
Jesse
|
|
Top |
|
 |
djlosch
|
Posted: Fri Sep 08, 2006 12:05 pm |
|
Joined: Fri Sep 08, 2006 11:47 am
Posts: 2
|
once you have managed the auto transcoding, managing expiration is rather easy. here's a rough concept of a cron.hourly script
check df. if hard drive space > some_percent exit.
store the current date/time in Unix timestamp format
store the ls -l in an array
for each file in the array, compare the stored unix timestamp versus the timestamp on the file
if the (unix_timestamp - file_timestamp) > (60*60*24*7) then rm the file. {the 60*60... is just unix format for 1 week}
the end.
i personally would want a transcoding script that has a VERY high rate of success in not adding the commercials. in my default myth installation (the hyams method on ubuntu breezy), a simple ffmpeg 1 liner works, but it copies over commercials. I haven't yet looked into this much though, but probably will soon.
|
|
Top |
|
 |
spalVl
|
Posted: Fri Sep 08, 2006 12:27 pm |
|
Joined: Mon Aug 29, 2005 4:04 pm
Posts: 729
Location:
Philadelphia, PA US
|
Quote: personally would want a transcoding script that has a VERY high rate of success in not adding the commercials.
May want to look at below guide. It uses a modified myth2ipod script to export to XviD format, but shouldn't be to hard to change to another format. Since uses nuvexport cut lists can be easily used. When setting up the recording schedule or later at viewing transcoding menu can choose to use Myth2XviD scripts at end of recording as well.
http://www.knoppmythwiki.org/index.php? ... iDEncoding
|
|
Top |
|
 |
uzik
|
Posted: Sun Oct 22, 2006 3:01 pm |
|
Joined: Tue Apr 19, 2005 10:30 am
Posts: 50
|
I created a shell script to recode the recorded programs to mpg4
encoded avi files. It runs about 500 meg per hour for high quality
output at 480 by 480. You could change the options to mencoder to
reduce that greatly. XVid be better but I haven't tried that yet.
The mencoder man page will explain the options, but be prepared,
there are hundreds of options.
You set this up as an external script and you can tell myth to run it after
recording on a show by show basis, or automatically as the default
for all new shows.
Run mythtv-setup from the command line and under the general
tab setup running an external script. There's a check box to turn
allow it and and a command line that need to be setup. In the command
line enter this:
/usr/bin/tomp4 %DIR%/%FILE% "%TITLE - %SUBTITLE%"
NOTE the double quotes. If your file name has a space in it
you need them. Mine filenames have spaces.
This script also filters out illegal characters (like colons and question
marks). These characters cant be used in filenames on windows.
Copy the script below to a file named /usr/bin/tomp4
make it an executable script by entering:
chmod uog+rx /usr/bin/tomp4
chmod uog-w /usr/bin/tomp4
This script:
#!/bin/sh
# convert recordings to mpeg4 encoded avi's for viewing on computer
# remove any illegal characters from the file name
OUTPUT=`echo $2 |sed -e "s/\///" -e"s/://" -e"s/<//" -e"s/>//" -e"s/?//"`
# run mencoder to do conversion
cd /myth/tv
unlink frameno.avi 2> /dev/null
mencoder $1 -oac mp3lame -lameopts abr:br=128 -ovc lavc -lavcopts vcodec=mpeg4:vhq:v4mv:vqmin=2:vbitrate=920:vpass=1:aspect=4
/3 -ofps 23.976 -o "/dev/null"
mencoder $1 -oac mp3lame -lameopts abr:br=128 -ovc lavc -lavcopts vcodec=mpeg4:vhq:v4mv:vqmin=2:vbitrate=920:vpass=2:aspect=4
/3 -ofps 23.976 -o "$OUTPUT"
unlink divx2pass.log 2> /dev/null
|
|
Top |
|
 |