# Mac Users : TivoTool changes for Widescreen



## PaulWilkinsUK (Mar 20, 2006)

Hi Mac Fans.

I got a bit narked with TiVoTool and the fact that it seems to be outputting 4:3 ratio by default. Quite an easy tweak and you can also change the encoder and resolution to suit AppleTV without the need for a conversion job between TiVoTool and iTunes !

PM Me if you want further details.....


----------



## speedyrite (May 18, 2002)

Mac Fan writes...

Paul, would you please PM me the details of the widescreen tweak? Thanks!


----------



## warrenrb (Jul 21, 2002)

Can't you post it on here, instead of the PM thing?


----------



## speedyrite (May 18, 2002)

OK, will do - when I get it working!


----------



## PaulWilkinsUK (Mar 20, 2006)

speedyrite said:


> OK, will do - when I get it working!


Smiffy.. any more luck yet ?? Or are you waiting on me?

You're saying this doesnt work?
my $cmd = "$ffmpeg -i '$loc' -y -threads 2 -map 0.0:0.0 -f mp4 -vcodec *h264* -aspect *16:9* -b $bitrate -r ntsc -g 24 -me epzs -qmin 2 -qmax 9 -acodec aac -ab $abitrate -ar 48000 -ac 2 -map 0.1:0.1 -benchmark '$loc.mp4'";

There is an online FFMPEG manual here http://ffmpeg.mplayerhq.hu/ffmpeg-doc.html


----------



## speedyrite (May 18, 2002)

I put changes into TTffmpeg.pm (a file within the TivoTool app package) via TextEdit and then quit TivoTool, started TivoTool again and tried an extract. Still got a 4:3 result.

After browsing the logs, I saw that the extract had used the old settings. I wonder if quitting TivoTool then starting it again is not enough to make the changes effective?

Maybe the settings have got cached and I need to reboot the computer (or clear a cache?) to get the changes to take effect? I'll have another go at the weekend...

Clarification: I am running TivoTool 0.5.7 under Mac OS X 10.4.11 (Tiger) [on my MacBook].


----------



## PaulWilkinsUK (Mar 20, 2006)

speedyrite said:


> I put changes into TTffmpeg.pm (a file within the TivoTool app package) via TextEdit and then quit TivoTool, started TivoTool again and tried an extract. Still got a 4:3 result.
> 
> After browsing the logs, I saw that the extract had used the old settings. I wonder if quitting TivoTool then starting it again is not enough to make the changes effective?
> 
> ...


Are you saving as MP4 ?


----------



## speedyrite (May 18, 2002)

PaulWilkinsUK said:


> Are you saving as MP4 ?


Yeah baby (well not the first time due to the mad cow - no of course not Mrs. S!!! - old age is taking its toll on the little grey cells!)

Now then, as it 'appens, I would also like to get MP2 in widescreen too (because I have found saving in MP2 cures the warbly sound - particularly in music - on MP4 files).

So, I have usually been saving as MP2 and then using MPEG Streamclip to re-encode to MP4 etc and also adjust the aspect ratio at the same time.


----------



## PaulWilkinsUK (Mar 20, 2006)

speedyrite said:


> Yeah baby (well not the first time due to the mad cow - no of course not Mrs. S!!! - old age is taking its toll on the little grey cells!)
> 
> Now then, as it 'appens, I would also like to get MP2 in widescreen too (because I have found saving in MP2 cures the warbly sound - particularly in music - on MP4 files).
> 
> So, I have usually been saving as MP2 and then using MPEG Streamclip to re-encode to MP4 etc and also adjust the aspect ratio at the same time.


I'm affraid I'm a bit stuck... coz I'm running Leopard and not able to run 0.5.7 I'm unable to prove my theory... have a search through the other pm modules for other instances of ffmpeg, it has to be there somewhere...


----------



## speedyrite (May 18, 2002)

Hmm, yes, I think 0.7.0 for Leopard is considerably different to 0.5.7 (and also relatively buggy from what I've seen!)

I'll get on it again at the weekend...


----------



## TCM2007 (Dec 25, 2006)

PaulWilkinsUK said:


> You're saying this doesnt work?
> my $cmd = "$ffmpeg -i '$loc' -y -threads 2 -map 0.0:0.0 -f mp4 -vcodec h264 -aspect 16:9 -b $bitrate *-r ntsc * -g 24 -me epzs -qmin 2 -qmax 9 -acodec aac -ab $abitrate -ar 48000 -ac 2 -map 0.1:0.1 -benchmark '$loc.mp4'";


You're forcing to 29.96Hz in that command - not a pretty thing in my experience. It will also significantly slow the transcode.


----------



## PaulWilkinsUK (Mar 20, 2006)

TCM2007 said:


> You're forcing to 29.96Hz in that command - not a pretty thing in my experience. It will also significantly slow the transcode.


Now, you see, this is a clever man talking...


----------



## PaulWilkinsUK (Mar 20, 2006)

Hold on there Chris... 
I've re-downloaded 0.5.7, I can see some 'other things....'


----------



## speedyrite (May 18, 2002)

PaulWilkinsUK said:


> Hold on there Chris...
> I've re-downloaded 0.5.7, I can see some 'other things....'


Splendid, I'll await further developments...


----------



## PaulWilkinsUK (Mar 20, 2006)

speedyrite said:


> Splendid, I'll await further developments...


Right then...
You need to 'tweak' TTmencoder and TTFrame modules and twiddle the aspect parms from 4:3 to 16:9 or 4/3 to 16/9.

Needless to say, back it up first


----------



## speedyrite (May 18, 2002)

PaulWilkinsUK said:


> Right then...
> You need to 'tweak' TTmencoder and TTFrame modules and twiddle the aspect parms from 4:3 to 16:9 or 4/3 to 16/9.
> 
> Needless to say, back it up first


I'm on it (well I will be this afternoon) - I'll report back later...


----------



## speedyrite (May 18, 2002)

Couldn't wait, had to try it.

Result! TivoTool now saves to mp4 in 16:9 aspect ratio.

However, TivoTool still saves to mpg (mp2) in 4:3 aspect ratio. [I have found it better to save in mpg (mp2) format and then re-encode to mp4 because of the warbly sound (particularly noticeable on music) on mp4 from TivoTool].

Maybe TiVo records everything in 4:3 ratio, including something in the material that indicates that it's really 16:9 format, so the TV can present it correctly on playback?


----------



## TCM2007 (Dec 25, 2006)

For all MPEG, the aspect ratio is independent of the recorded pixel resolution.

TiVo doesn't seem to set the aspect ratio flag in the MPEG2 stream properly; I guess aspect ratio is held in the TiVo specific header for TiVo's own use. If your software is set to preserve inut aspect ratio, you'll always get 4:3. You need to force it to 16:9.


----------



## speedyrite (May 18, 2002)

TCM2007 said:


> For all MPEG, the aspect ratio is independent of the recorded pixel resolution.
> 
> TiVo doesn't seem to set the aspect ratio flag in the MPEG2 stream properly; I guess aspect ratio is held in the TiVo specific header for TiVo's own use. If your software is set to preserve inut aspect ratio, you'll always get 4:3. You need to force it to 16:9.


Thanks, I'll have another look through all the .pm files in the TivoTool application package and see if I can spot something else to change to force to 16:9 when saving in mp2 format!


----------



## speedyrite (May 18, 2002)

TCM2007 said:


> You're forcing to 29.96Hz in that command - not a pretty thing in my experience. It will also significantly slow the transcode.


What's the corrective action? (Is it by chance *-r pal*?)


----------



## TCM2007 (Dec 25, 2006)

I wouldn't be surprised if that works,

r 25

will, or I think if you omit the r parameter altogether it will default to being the same as the input file,


----------



## speedyrite (May 18, 2002)

TCM2007 said:


> You're forcing to 29.96Hz in that command - not a pretty thing in my experience. It will also significantly slow the transcode.





TCM2007 said:


> I wouldn't be surprised if that works,
> 
> r 25
> 
> will, or I think if you omit the r parameter altogether it will default to being the same as the input file,


Cheers! I'll try that out today.


----------



## PaulWilkinsUK (Mar 20, 2006)

Right... I've created a small partition on one of my drives here to load in 10.4.11. I've downloaded TiVoTool 0.5.7 and shall have a hack about...


----------



## speedyrite (May 18, 2002)

I think I (finally!) understand the cause of my problem in not getting widescreen output when saving as .mpg (.mp2)!

I should have dug out my copy of the book "Ha*king TiVo" by Jeff Keegan. The diagram on page 369 shows that when a recording is made, TiVo itself encodes the input video and audio streams into MPEG-2 format and then multiplexes the MPEG-2 video and audio streams together into tystream format for storage. 

When a recording is played, the reverse is done.

TCM2007's comment now makes more sense to me:
"For all MPEG, the aspect ratio is independent of the recorded pixel resolution.

TiVo doesn't seem to set the aspect ratio flag in the MPEG2 stream properly; I guess aspect ratio is held in the TiVo specific header for TiVo's own use. If your software is set to preserve inut aspect ratio, you'll always get 4:3. You need to force it to 16:9."

So, at the moment, I open a .mpg file in QT Player and change the movie properties from 320x240 (4:3) to 427x240 (16:9) and trim any unwanted pre-show and post-show nonsense before saving it as a .mov file, and then encode it to .mp4 to get a final version for use on iPod touch.


----------



## PaulWilkinsUK (Mar 20, 2006)

speedyrite said:


> I think I (finally!) understand the cause of my problem in not getting widescreen output when saving as .mpg (.mp2)!
> 
> I should have dug out my copy of the book "Ha*king TiVo" by Jeff Keegan. The diagram on page 369 shows that when a recording is made, TiVo itself encodes the input video and audio streams into MPEG-2 format and then multiplexes the MPEG-2 video and audio streams together into tystream format for storage.
> 
> ...


ere Smiffy... use MpegStreamClip.. its free and it has presets for Ipod Touch / Apple TV etc etc and its a doddle to edit the top n tail too

In theory you should be able to force the resolution in TiVoTool .. still fiddling..


----------

