View Full Version : Need transcoding advice
spocko
03-18-2009, 02:14 PM
I'm getting a little overwhelmed reading about codecs and such, so I'd like to ask some practical advice from the experts here.
Here's what I want to do:
I want to pull recordings from my Tivo HD for playback on a Windows PC and for moving back to the Tivo via pyTivo. To conserve space and bandwidth, I want to transcode the original recordings into something smaller while preserving most of the original quality (including HD). I would prefer to do this transcoding within kmttg, so I think that limits the encoders to ffmpeg and handbrake. I have a slow CPU, so that eliminates h.264 as a good option for me.
My questions are:
- What container and codecs make sense given the above criteria? I'm thinking that mpeg4 ASP might be the best video codec for me. For the audio codec, intuitively it seems to make sense to preserve the original AC3, but perhaps I'm missing something.
- Based on the answer to the above question, what's the best way to encode into that format? Handbrake or ffmpeg? Any special options? What codecs/tools do I need for playback on the PC?
Thanks!
moyekj
03-18-2009, 02:52 PM
Do you have series 2 or series 3 Tivos that you want to transfer back to? The good thing about H.264 + AC3 audio is that you can get pretty good space savings versus original mpeg2 and then using pyTivo you can transfer them back in native form (i.e. they don't have to be transcoded back to mpeg2 again) if transferring to series 3 Tivos. Of course you can also stream them natively to series 3 Tivos using streambaby.
If you choose to encode to a format that cannot be natively played by Tivo then it must be transcoded back to mpeg2 again and you lose a lot of quality that way as well as not saving much on space.
NOTE: If using kmttg you are not restricted to ffmpeg or handbrake only. The built in profiles use ffmpeg & handbrake but you can easily add your own. Basically any command line encoder will work - you just have to create an encoding profile (.enc file) that calls the executable you want. So, for example, mencoder or x264 would be easy to setup as well.
spocko
03-18-2009, 03:31 PM
Thanks moyekj! The Tivo in question is a Tivo HD. You make some very good points and a strong argument for H.264 + AC3. My desktop machine is too slow for H.264 playback, but that doesn't matter since the Tivo will be my playback device when I'm at home. My laptop, which is fast enough for H.264, will be my playback device on the road. So I think H.264 + AC3 is the answer for me.
A few more questions:
- What are the tradeoffs, if any, between ffmpeg and handbrake? It looks like they can both encode H.264 + AC3.
- Would ffdshow be the decoder of choice for playback of h.264 + AC3 on a PC?
Thanks moyekj! The Tivo in question is a Tivo HD. You make some very good points and a strong argument for H.264 + AC3. My desktop machine is too slow for H.264 playback, but that doesn't matter since the Tivo will be my playback device when I'm at home. My laptop, which is fast enough for H.264, will be my playback device on the road. So I think H.264 + AC3 is the answer for me.
A few more questions:
- What are the tradeoffs, if any, between ffmpeg and handbrake? It looks like they can both encode H.264 + AC3.
- Would ffdshow be the decoder of choice for playback of h.264 + AC3 on a PC?
short answers:
If your desktop is too slow for h.264 playback, encoding on it will take CENTURIES. (encoding is significantly more work). Unfortunately, even much faster encoders (like xvid/mpeg-4) will still tax your system a lot. You may end up having to trade off encoding time for hard drive space. Play around.
Handbrake and ffmpeg and mencoder all use the same encoder for h.264 (libx264, part of the videolan project). ffmpeg and handbrake use the same code to 'read' your source video too (ffmpeg's libavcodec). So really the only differences you may notice is in 'choice of default options' and 'scaling/cropping' code. So try and see which one you like better (on windows I'd recommend ffmpeg since handbrake is a backport of code written for the mac).
moyekj
03-18-2009, 04:23 PM
Yes the big downside to H.264 encoding is it takes a very long time, especially if encoding from HD sources. My advice is while experimenting start with a very short clip, for example a 1 minute HD recording from the most popular channel you record from on your Tivo as a starting point. That way you can experiment with different encoders and/or settings without having to wait forever to see the result, and of course you can dry run the whole process to see if you are satisfied.
Once you find encoding that you are happy with then it's pretty easy to automate encoding of a bunch of files at once and just leave the PC running for weeks. Even with latest hardware and processors it will easily take several hours of encoding per hour of HD mpeg2 and there will always be a few source mpeg2 files where you inevitably run into trouble encoding, so it's advisable to run the mpeg2 sources through VideoRedo QuickStream fix or some other mpeg2 cleanup tool before attempting to encode. Even then there may be cases it doesn't work or encoding results in A/V sync problems.
Another approach which I don't know if you've considered is just to get lots of storage space attached to your PC(s) and then just offload shows from your Tivos and keep them as mpeg2. That's the easy way out and ensures best possible quality. Downside is for good HD mpeg2 recordings it will take longer than real time to transfer/stream them back to your Tivos.
There's always a price you may no matter which approach you choose. :)
spocko
03-18-2009, 05:28 PM
Thanks guys, this all makes sense.
What other mpeg2 cleanup tools are available besides VideoRedo?
moyekj
03-18-2009, 07:21 PM
I Googled around for a while in the past looking for a good mpeg2 fixer but never really found one that really helped until VideoRedo Quickstream Fix and it's nice one can run it in batch mode so I could include it in kmttg. Even then in some cases I just have to resort to cutting out "bad" segments from an mpeg2 file to fix things. I don't think there's 1 tool to solve all issues but hopefully someone else knows of a good utility other than VRD QSfix.
If you are recording programs with commercials in order to help save more space it's added bonus to remove the commercials and if you want that done properly you will need a good mpeg2 editor anyway so VRD is well worth the money (the cheaper version without DVD authoring).
spocko
03-19-2009, 04:30 AM
One more question: When I encode to H.264+AC3 using a ff_h264 profile in kmttg, the resulting mp4 file plays back with no audio in both WMP11 and media player classic. I have several AC3 codecs installed, and AC3 audio plays back fine from other container types. If I use the same ff_h264 profile but transcode the audio to AAC, it plays back fine. I have read elsewhere that the mp4 container doesn't support AC3 audio. Is it a mistake that ff_h264 profiles use mp4? What container do pyTivo and streambaby expect for native H.264+AC3?
moyekj
03-19-2009, 10:28 AM
One more question: When I encode to H.264+AC3 using a ff_h264 profile in kmttg, the resulting mp4 file plays back with no audio in both WMP11 and media player classic. I have several AC3 codecs installed, and AC3 audio plays back fine from other container types. If I use the same ff_h264 profile but transcode the audio to AAC, it plays back fine. I have read elsewhere that the mp4 container doesn't support AC3 audio. Is it a mistake that ff_h264 profiles use mp4? What container do pyTivo and streambaby expect for native H.264+AC3? AC3 in mp4 container I think is only recently added to specifications and many video players do not know what to do with that yet. However, Videolan VLC can handle it just fine and most importantly, Tivo can handle it fine as well.
There are plenty of other built in profiles in kmttg that use AAC for audio instead which makes them playable in most players. But while Tivo can handle multi-channel AAC audio decoding I think it only spits out stereo, so if target is for playback on Tivo, AC3 is the better choice and as I mentioned VLC can handle playback on your PC.
alexander123
03-20-2009, 12:30 AM
Can anyone recommend a solution for batch encoding a folder. (is that what kmttg does?)
I want to use Tivo Desktop to auto xfer some shows, and have something on my pc auto convert to H.264+AC3 to save space. Some of the longer HD movies take a LOT of space on my tivo. Would love to be able to re-encode them, and then xfer them back or maybe stream them.
I am also in the process of loading up some of my HD videos to the Tivo.
My first attempted was digitizing my my wedding video from VHS, and dropping the MPEG2 onto the tivo using Tivo Desktop! Would love to be able to get my HD home movies on there without having to encode them as MPEG2.
Can anyone recommend a solution for batch encoding a folder. (is that what kmttg does?)
I want to use Tivo Desktop to auto xfer some shows, and have something on my pc auto convert to H.264+AC3 to save space. Some of the longer HD movies take a LOT of space on my tivo. Would love to be able to re-encode them, and then xfer them back or maybe stream them.
I am also in the process of loading up some of my HD videos to the Tivo.
My first attempted was digitizing my my wedding video from VHS, and dropping the MPEG2 onto the tivo using Tivo Desktop! Would love to be able to get my HD home movies on there without having to encode them as MPEG2.
Is there a reason you're not just using kmttg to do the whole transfer/decode/encode as mp4 ? It does work on some internal folders, but no reason to use tivo desktop to transfer, then another tool to decode, etc.. kmttg pulls it all off your tivo for you.
As for your wedding videos, you don't HAVE to re-encode them as mpeg-2. Some tools (like pytivo) will take any movie you have in almost any format and send it to your tivo, re-encoding it on-the-fly.
Hi, I'm new to TiVo and TiVo is new to Australia so I suspect you may see a few stupid questions around here.
We've only just had Home Networking enabled (don't ask!) and searching around hasn't revealed the answer to my question.
I am encoding my TiVo files for PC playback using VideRedo to strip the ads and Handbrake to convert the resulting mpg's to mkv's.
Is there any way to preserve subtitles?
edit - Just started reading about t2sami. Should have searched for "Closed Caption" not "Subtitles".
I was just about to post suggesting t2sami then saw your edit.
Have you considered using TVAP (link in signature) to automate or semi-automate your process? A TVAPpostProcess.cmd file to run HandBrake via its command line interface is a common usage. If you setup TVAP to QSF (recommended for all inputs) then AdScan without autocuts, it will automatically do those processes as soon as the tivo file finishes transferring. Then TVAP waits for you to edit your cuts in the .vprj file. After you do that, TVAP continues automatically with creating the final edited mpeg2 file, then runs the TVAPpostProcess.bat file to do your HandBrake encoding.
For an example of a TVAPpostProcess.cmd file using HandBrake see recent posts by msmart in the TVAP thread (link in signature).
txporter
03-25-2009, 01:58 PM
Hi, I'm new to TiVo and TiVo is new to Australia so I suspect you may see a few stupid questions around here.
We've only just had Home Networking enabled (don't ask!) and searching around hasn't revealed the answer to my question.
I am encoding my TiVo files for PC playback using VideRedo to strip the ads and Handbrake to convert the resulting mpg's to mkv's.
Is there any way to preserve subtitles?
edit - Just started reading about t2sami. Should have searched for "Closed Caption" not "Subtitles".
You might want to consider using XVID4PSP for your conversion rather than Handbrake. Handbrake does great with subtitles files, but has no support for closed captions. You can extract the CC with either ccExtract or T2SAMI (I think) and then burn them in with XVID4PSP as you convert from mpg to mp4.
Err...just noticed that you are trying to end up with mkv files rather than mp4. I believe you can probably use a similar workflow, but I have not worked with a mkv container at all. I believe that mkv can actually support softsubs.
Jason
P.S. Also just released that I was writing that from the POV of American CC. No idea if CC are handled the same way in Australia. :o
vBulletin® v3.6.8, Copyright ©2000-2012, Jelsoft Enterprises Ltd.