View Full Version : ReplayToGo for Mac OS X
I've been working on an application to transfer ReplayTV shows to the new video iPod. Download ReplayTV files with DVArchive, then either drop the files (or a folder of files) on the ReplayToGo icon or automatically run this application through the "Post Download Command" function of DVArchive. It automatically converts Replay shows from MPEG-2 to H.264 and adds the result to iTunes.
It requires Mac OS X 10.4 or higher, DVArchive 3.1, MPEG Streamclip 1.5.1, the MPEG-2 Playback Component, and possibly QuickTime Pro.
This application also includes the ReplayTV 5K Tools for optionally converting Replay files for use in DVD projects. (Edit the ReplayToGo application with Script Editor to change options.)
Any and all feedback is appreciated!
The download link is: http://homepage.mac.com/ptb/ReplayToGo.dmg
kendals 12-27-05, 07:10 AM 2 Quick Q's for you...
1. If you just launch the application, does it always just come up with the "requirements" screen everytime, or only if you are missing something...
2. Can you make this program do more than just H.264? Like maybe convert this to .DV format :-D...
Scott
> If you just launch the application, does it always just come up with the "requirements" screen everytime, or only if you are missing something...
It is designed to be run two ways:
1. Either drop an MPEG file (downloaded via DVArchive) onto the ReplayToGo icon or
2. Run the program from the command line (effectively what is happening with DVArchive with the Post Download Command) with the file to convert as the first argument on the command line.
If you double click it, it will just show the system requirements. I may update it after New Year's and make it present a choose file dialog (I'll post here again when I do that).
2. Can you make this program do more than just H.264? Like maybe convert this to .DV format :-D...
It is possible to rewrite the script to convert to DV, and if you open it with Script Editor, you'll see all of the script. MPEG Streamclip isn't scriptable, so I had to use GUI Scripting and to tell it to "click this button", "close this window", etc. GUI scripting is very tedious, but it can be done.
If anyone wants to extend this script, post changes here and I'll integrate it into the program.
- Peter
Great little app.
I have 1 question, and 1 suggestion.
My question is...
What does your script do in MPEGStreamclip, besides the export? I noticed that it does some sort of cropping. I was just curious about that. It it because, occasionally, videos from the replay have that little static line at the top of the screen?
My suggestion is...
I put videos on my iPod, but often watch them on a TV. The h.264 320x240 is OK, but not great in that case. How about an option to use MPEG4 at a higher resolution. I don't mind sacrificing size for quality. Something like 544x408 would be within the 480x480 max resolution for MPEG4, but show up much better on a TV than the 320x240 h.264 file.
Thanks,
Loren
davester2 12-27-05, 08:14 PM Frankly, I'm wondering what the near future may bring (perhaps even as early as Macworld SF in a couple of weeks). To me, the current weak spot of the video iPod is the low resolution when plugged into a TV. I realize that part of this limitation is dictated to the currently small drive sizes available (30 and 60 gb currently). It'd be nice to have the option of upping the resolution so that it could be used as an even better ReplayTV to go, and I can't help but think that resolution will increase as storage capacities increase over the next year or so.
Well, using MPEG4, you can get 480x480 and if you are ripping something that is in widescreen format, that means that you don't have to reduce the size. The following resolutions will fit on your iPod and look great on your TV.
752x304
720x320
672x336
> What does your script do in MPEGStreamclip, besides the export? I noticed that it does some sort of cropping. I was just curious about that. It it because, occasionally, videos from the replay have that little static line at the top of the screen?
Firstly, I picked MPEG Streamclip because it was the only application that didn't drop the audio when transcoding (i.e. converting muxed-MPEG2 to H.264). FFMpegX, VLC, and QuickTime dropped the audio, as did every other application I could find. I wanted to make ReplayToGo independent of needing the MPEG-2 Playback Component, but only MPEG Streamclip would work and that requires the MPEG-2 plugin.
On my Replay (45xx), the video was surrounded by a black frame on three sides. Since I wanted to have as much as the content as possible, cropped off the black pixels on each side. This can be adjusted however if it is different with different Replay generations. Simply open /Applications/AppleScript/Script Editor, then open the ReplayToGo.app file (it is a simple AppleScript).
> How about an option to use MPEG4 at a higher resolution. I don't mind sacrificing size for quality. Something like 544x408 would be within the 480x480 max resolution for MPEG4, but show up much better on a TV than the 320x240 h.264 file.
I tried this (and FYI the max resolution for a 4:3 aspect ratio is 512x384 while maintaining the 'must be divisible by 16' MPEG-4 rule) and I found that the quality of H.264 at 320x240 at 700 kbps is better than MPEG-4 at 512x384 at 1325 kbps. The MPEG-4 just seemed to smear and pixelate more than H.264.
I hope that eventually, the iPod will decode a higher resolution of H.264.
That being said, it is possible to change the ReplayToGo script to MPEG-4 and a higher resolution, if desired. This is my first attempt at GUI scripting (since MPEG Streamclip isn't scriptable) so it may or may not be easy to do this.
> To me, the current weak spot of the video iPod is the low resolution when plugged into a TV.
I completely agree! Come on Apple, give us an iPod worthy of "This (2005) is the year of Hi-Def".
> I realize that part of this limitation is dictated to the currently small drive sizes available (30 and 60 gb currently).
The current generation of iPods are limited by it's video-decryption chipset. (AFAIK)
> Well, using MPEG4, you can get 480x480 and if you are ripping something that is in widescreen format, that means that you don't have to reduce the size. The following resolutions will fit on your iPod and look great on your TV.
> 752x304
> 720x320
> 672x336
ReplayToGo is designed to move videos from a ReplayTV to and iPod. Since most of the content that comes off the Replay is in a 4:3 aspect ratio, I won't be changing it for widescreen content. It just wouldn't make sense.
I want to encourage everyone to open this script up and modify it for your own needs, however. It is only an AppleScript which anyone should be able to read and modify if you want to. It has a couple of really useful sub-routines that can be changed for use in all kinds of different scripts.
- Peter
edelaney05 12-31-05, 03:03 PM I'm sure this has been covered elsewhere in the forums, so if someone wants to point me to that resource, that'd be be quite helpful.
But, I have used MPEG Streamclip to edit out commercials from ReplayTV shows by finding the nearest keyframe to the commercial break and the clipping to the nearest keyframe after the break.
My question is this the most effecient/effective way to do this? I mean 99% of the time I don't get the best cuts and am off by a few seconds or frames. I know that if i convert to DV, then edit, then convert back to MPEG (or ultimately MP4 for iPod) the video quality will deteriorate pretty quickly (right? wrong?).
To get back on topic, I agree that MP4 at a higher resolution would be ideal for watching iPod Video on a TV. At least some kind of toggle would be nice to select H.264 or MP4. Otherwise, nice work!
-E
> I have used MPEG Streamclip to edit out commercials from ReplayTV shows by finding the nearest keyframe to the commercial break and the clipping to the nearest keyframe after the break.
> My question is this the most effecient/effective way to do this? I mean 99% of the time I don't get the best cuts and am off by a few seconds or frames. I know that if i convert to DV, then edit, then convert back to MPEG (or ultimately MP4 for iPod) the video quality will deteriorate pretty quickly (right? wrong?).
Hint: If you're doing this with MPEG Streamclip, use the up and down arrows (not L or R) to snap to the keyframe boundaries. MPEG Streamclip always cuts at the GOP boundary, and using the up and down keys will show you where it will actually cut.
The way I do this is to open the Replay MPEG file with MPEG Streamclip. Next, find the beginning of the commercial break (use up and down for more accurate cuts) and press "I" to mark the in point. Then scrub to the end of the commercial, the press "O" to mark the out point. Then choose Edit > Cut to cut the commercial. Don't cut the last frame of the file because it will (at least in my experience) not export correctly (read: fail). I choose export to Demux to M2V and AIFF (not DV) which is usually pretty quick. I'm sure other options will work, but one of my targets is DVD so, the process is almost complete.
If you save the M2V file and the AIFF file to the same folder it will automatically match them when re-opening it later in MPEG Streamclip.
ReplayToGo is designed to open both unedited Replay MPEGs and also M2V files edited this way. Just drop the M2V file onto the ReplayToGo icon to convert for the iPod.
> To get back on topic, I agree that MP4 at a higher resolution would be ideal for watching iPod Video on a TV. At least some kind of toggle would be nice to select H.264 or MP4. Otherwise, nice work!
Watch this thread for an announcement of an update to ReplayToGo which hopefully will include this functionality.
On my machine, the script doesn't seem to get to the part where it adds the atoms/tags or adds the file to iTunes. Anyone else experiencing this? let me know what further info you need.
Also, it sometimes screws up the name of the file. When it enters the "Go To Folder" text, it doesnt' finish, and ends up using the last part for the file name, making a file named "uide.mp4" or similar.
I know that once all this stuff is worked out, I will love this script! :)
ScottyM 01-21-06, 03:47 PM Say, thanks for turning me on to Streamclip and for your efforts on ReplayToGo.
My attempt saved the file as an mp4 and opened iTunes... but I don't think the file made it to iTunes. I searched under the filename and for "mp4" and came up empty.
I don't have a video iPod, but the file should still show up in iTunes, right?
Scott
On my machine, the script doesn't seem to get to the part where it adds the atoms/tags or adds the file to iTunes.
ScottyM 01-21-06, 09:52 PM It took a couple tries, but I have now 2 ReplayToGo-generated videos in iTunes. I noticed that it seems to work every other time for me - but now all i need is a video iPod :)
I was reading the posts here about resolution and want to understand the problem better. The videos that I have created came from RTV recordings and look and sound pretty decent in QT or MPEG Streamclip. I assume they'll look the same on the iPod, no?
Was the problem discussed here only relating to how they'll look when ported to a TV?
Also, the specs on the 60 GB iPod say if you have nothing else on the unit it will hold up to 150 hrs of video. Is that what I should expect if I filled up the iPod with programs processed thru ReplayToGo? Assuming no, how much ReplayToGo video might be expected to fill up a 60 gb vidPod?
Scott
I would like to try debugging this, as the auto-tagging with atomicparsley is my key reason for using the script and that's the part that's not happening.
Suppose I want to add a path to a mpg right into the AppleScript and run it from Script Editor. What format does the path have to be in?
madSkeelz 01-23-06, 11:13 PM I'm not certain off-hand, but I believe AppleScript will accept paths using either colons or forward slashes as delimiters. If you use slashes, standard shell abbreviations should work. [i.e., ~ for $HOMEDIR]
The information that ReplayToGo uses to add the atoms/info to the completed file comes from the xml file that DVArchive creates after downloading the MPEG file. I have a ReplayTV 4500-series and a minute or so (at least that's what it appears) after DVArchive downloads a show, an XML file is created next to the ".mpg" file (with the same base file name). ReplayToGo parses that file (using the included XMLTools scripting addition-- it's inside the ReplayToGo.app package) and uses AtomicParsley (also included) to add the tags to the .mp4 file.
Rather than trying to add a particular file [path] directly to the script just drop a downloaded .mpg file onto the ReplayToGo icon (just make sure a companion .xml file is next to it in the same directory). It will begin processing it just as DVArchive does after downloading.
> Also, it sometimes screws up the name of the file. When it enters the "Go To Folder" text, it doesnt' finish, and ends up using the last part for the file name, making a file named "uide.mp4" or similar.
Open ReplayToGo with Script Editor. Look for this section:
tell window "Create New MP4 File"
keystroke (POSIX path of folderPath as Unicode text)
delay 1
end tell
Change "delay 1" to "delay 5". Now it won't close the dialog before finishing the complete path.
> Was the problem discussed here only relating to how they'll look when ported to a TV?
Yes. You won't find higher quality video than what comes out of ReplayToGo when viewed on the iPod. When using the video out cable to watch video on a TV, it will look the same as videos purchased from the iTunes online store.
- Peter
P.S. The next version of ReplayToGo is planned to be rewritten in AppleScript Studio and will offer higher resolutions (in MPEG-4) and hopefully be faster.
Hey, it seems to be working now after the 'delay 5' thing. I wonder if the faulty filename had something to do with the rest of the stuff not working.
Too bad RTV doesn't have season and ep number data. :) That would be perfect for me. Hopefully the date can be used for ordering in iTunes.
Mr PTB, THANKS! My wife just bought me an early b-day present to replace my 3-G iPod. Your app makes it SO easy to get ReplayTV content onto this little fella. It took me all of 10 minutes to set up your little app and another hour or so to get a file re-encoded and onto the iPod.
Fabulous!
stonemtn 10-04-06, 06:45 AM Hi
I'm ocassionally getting an error from MPEG Streamclip: "Can't Make the MP4 File"
Any ideas? It interrupts the script. If I simply go to File>Export>MPEG-4, it works fine. I'm not sure where the difference is. I put the 5 count pause in so I don't receive the "Local Guide" filename.
Any help would be appreciated. I'd like to get this working for me overnight.
Thanks
Stonemtn
arehartc 02-10-07, 12:42 PM I just found this cool little script and am having the same issues as stonemtn - I can drag and drop certain files (non Replay mpgs) no problem. They convert and drop into iTunes. However, if I drag and drop a replay file, everytime I get the same "Can't create MP4 file" error from Clipstream. It appears that it doesn't like the "Local_Guide" folder, as even a manual drop from that folder doesn't work. Any ideas?
|
|