# Preserving Aspect Ratio



## johala_reewi (Oct 30, 2002)

I have got a programme recorded on Tivo which plays as 16:9 widescreen. When I transfer  this to DVD, the aspect ratio ends up as 4:3 so on DVD playback, the picture is squashed up. I have had a look at the various stages and can't find anywhere obvious that could do this. Can anyone help?


----------



## Sneals2000 (Aug 25, 2002)

johala_reewi said:


> I have got a programme recorded on Tivo which plays as 16:9 widescreen. When I transfer  this to DVD, the aspect ratio ends up as 4:3 so on DVD playback, the picture is squashed up. I have had a look at the various stages and can't find anywhere obvious that could do this. Can anyone help?


You may need to pass the MPEG file through DVD Patcher which allows you to edit the aspect ratio flags in the MPEG stream to flag 16:9 rather than 4:3. Could be that Tivo MPEG is constantly flagged as 4:3 and the aspect ratio switching is handled in a different manner within the Tivo?


----------



## speedyrite (May 18, 2002)

johala_reewi said:


> I have got a programme recorded on Tivo which plays as 16:9 widescreen. When I transfer  this to DVD, the aspect ratio ends up as 4:3 so on DVD playback, the picture is squashed up. I have had a look at the various stages and can't find anywhere obvious that could do this. Can anyone help?


I've noticed this when using TivoTool 0.5.7 to get a file from TiVo as MPEG2 (.mpg)! I've been trying to find a way to change the flag from 4:3 to 16:9 but so I'm going to try Sneals2000's suggestion.


----------



## speedyrite (May 18, 2002)

Sneals2000 said:


> You may need to pass the MPEG file through DVD Patcher which allows you to edit the aspect ratio flags in the MPEG stream to flag 16:9 rather than 4:3. Could be that Tivo MPEG is constantly flagged as 4:3 and the aspect ratio switching is handled in a different manner within the Tivo?


Just had a quick check of DVD Patcher. Looks good but it's Windows only, I need something to run on a Mac.

Maybe MPEG Streamclip? But I can't see how to just edit the aspect ratio flag using that (looks like it can be done in conjunction with encoding the file to another format, but I don't necessarily always want to do that).


----------



## johala_reewi (Oct 30, 2002)

Sneals2000 said:


> You may need to pass the MPEG file through DVD Patcher which allows you to edit the aspect ratio flags in the MPEG stream to flag 16:9 rather than 4:3. Could be that Tivo MPEG is constantly flagged as 4:3 and the aspect ratio switching is handled in a different manner within the Tivo?


Could be. Having got the recording onto the PC, everything I use thinks it is 4:3. I guess for watching a recorded show, tivo just recontructs whatever there was and lets the TV do the switching. When archiving to PC, I guess the raw stream is grabbed and any other data is left behind?

Will give DVD patcher a go.


----------



## Cainam (May 25, 2004)

I have used DVDPatcher for a while now for exactly this reason, and it works really well.


----------



## martink0646 (Feb 8, 2005)

Hi,

Anything I drag across from TiVo is always 4:3. I only ever view the content on an HTPC through VLC which will play at any aspect ratio you require.

I know thats no help for archiving but it moght be for people viewing on a PC using WMP.

Martin


----------



## johala_reewi (Oct 30, 2002)

Thanks guys. DVD patcher does the job nicely.


----------



## PaulWilkinsUK (Mar 20, 2006)

speedyrite said:


> Just had a quick check of DVD Patcher. Looks good but it's Windows only, I need something to run on a Mac.
> 
> Maybe MPEG Streamclip? But I can't see how to just edit the aspect ratio flag using that (looks like it can be done in conjunction with encoding the file to another format, but I don't necessarily always want to do that).


What are you having troubles with Speedy ??


----------



## speedyrite (May 18, 2002)

PaulWilkinsUK said:


> What are you having troubles with Speedy ??


Well I sometimes use TivoTool 0.5.7 to save something from TiVo to the Mac in MPEG-2 (.mpg) format and then use Roxio Popcorn to burn it to DVD.

Trouble is, 16:9 material comes through in 4:3 format. When this came up before, TCM2007 said something about TiVo not setting the aspect ratio flag correctly for 16:9 material.

So I was looking for a way to edit the MPEG-2 file and amend the aspect ratio flag (which is apparently held in the header data of the MPEG stream - heh heh, sounding like I understand what I'm talking about eh?!?) then -and this is the crucial bit - save the MPEG-2 file *without* converting/encoding it to another format.

[NB. I have no problem with using TivoTool to save as MPEG-4 (where I have changed the ffmpeg aspect ratio flag), and no problem when using MPEG Streamclip (or other tools) to change the aspect ratio and then convert/encode from MEPG-2 to another format].


----------



## PaulWilkinsUK (Mar 20, 2006)

speedyrite said:


> Well I sometimes use TivoTool 0.5.7 to save something from TiVo to the Mac in MPEG-2 (.mpg) format and then use Roxio Popcorn to burn it to DVD.
> 
> Trouble is, 16:9 material comes through in 4:3 format. When this came up before, TCM2007 said something about TiVo not setting the aspect ratio flag correctly for 16:9 material.
> 
> ...


Ahhh... I see...


----------



## speedyrite (May 18, 2002)

PaulWilkinsUK said:


> Ahhh... I see...


The answer could be DVD Patcher, but it only works on the Windows platform.

Or it could be something called myDVDEdit, which works on the Mac - it looks like it has the capability to change the aspect ration, but sadly it the option remains greyed out when using it with a sample .mpg file from TiVo.

Sighs heavily and shambles off muttering something inaudible...


----------



## solaise (Sep 17, 2006)

If you were prepared to have a go at modifing some java code its possible to get the TySuiteJ code out of its jar file - since its Java it should run on your Mac.

It includes a patch command which changes the dimensions in the first MPEG header - it would pretty easy to change it to modify the aspect ratio instead. However I think that you may find that you actually need to update the ratio in every SEQ in the file. 

I actually use TySuiteJ to convert to MPEG2 in the first place and so I've instead modified it to patch all the SEQs as part of this conversion process.

It does seem odd that no-one has written a command line tool to do this!


----------



## speedyrite (May 18, 2002)

solaise said:


> If you were prepared to have a go at modifing some java code its possible to get the TySuiteJ code out of its jar file - since its Java it should run on your Mac.


Ah yes, TysuiteJ...

I did have a look at TysuiteJ when Apple released Mac OS X 10.5 (Leopard) because the TiVo owner's tool of choice on Mac (TivoTool 0.5.7) didn't work (and the Leopard version 0.7.0 is too buggy for me). I'm still running Mac OS X 10.4.11 on one Mac just to use the beloved TivoTool 0.5.7...

Anyway, yes, I previously had a look at TysuiteJ as a candidate replacement for TivoTool on Leopard. My pal PaulWilkinsUK has had it up and running, but I think he didn't find it as elegant as TivoTool to install, configure and use. I must confess I had a look at the instructions and it left me a bit cold. Maybe I've been spoiled by TivoTool!

I didn't know that TysuiteJ could do the aspect ratio thing. Thanks for the tip.

I've now got DVDPatcher.exe (which apparently can also do the aspect ratio edit) and a sample file to try it out on, but I haven't had time to get on the Windows PC and try it yet.


----------



## Raisltin Majere (Mar 13, 2004)

speedyrite said:


> I didn't know that TysuiteJ could do the aspect ratio thing. Thanks for the tip.


Neither did I. All my videos come out as 4:3, I've had a look around for an option to change this but can't find it. But, then, I don;t really know what I'm looking for.

Any tips, anyone please?


----------



## speedyrite (May 18, 2002)

Raisltin Majere said:


> Neither did I. All my videos come out as 4:3, I've had a look around for an option to change this but can't find it. But, then, I don;t really know what I'm looking for.
> 
> Any tips, anyone please?


See post 18 by TCM2007 in this thread:

http://www.tivocommunity.com/tivo-vb/showthread.php?t=356920

which I think explains the root cause of the problem.


----------



## Raisltin Majere (Mar 13, 2004)

Sorry if I'm being particularly dim, but Solaise is saying this can be overcome, no?


----------



## PaulWilkinsUK (Mar 20, 2006)

Raisltin Majere said:


> Sorry if I'm being particularly dim, but Solaise is saying this can be overcome, no?


Well the only way I could do it was by tweaking the ffmpeg parms in the java code.. not pretty. It does the the job but as Speedy says, it aint elegant.


----------



## speedyrite (May 18, 2002)

Raisltin Majere said:


> Sorry if I'm being particularly dim, but Solaise is saying this can be overcome, no?


Oh yes, it can apparently be overcome - but it seems to be a question of finding a tool that allows it to be done easily and quickly, and that fit into your conversion workflow with a minimum of fuss.

There seem to be a few tools that can (allegedly) do it - some are standalone tools, some are comprehensive tools such as TysuiteJ.


----------



## Raisltin Majere (Mar 13, 2004)

Yeah, I'm using tysuitej, but I can't figure out where to make the changes.

I found this elsewhere,



> The easiest place to change the aspect ratio would be in RestreamingTyRecordParser.writePacket(). I break out the sequence for special processing. Look for
> 
> ```
> (type==SEQUENCE_PACKET)
> ...


I found RestreamingTyRecordParser.writePacket() but don;t understand the rest of the above, neither do I know how to put the file back into the 'jar' thing.


----------



## solaise (Sep 17, 2006)

yes thats the place to change it - I actually changed SequenceHelper and called it from there.

The best solution would be for someone to persuade the author to offer a new patch utility in tysuitej!

Raistlen I will send you a PM


----------



## Cainam (May 25, 2004)

Not that I have ever tried it, but isn't it possible to run some windows programs in Mac OSX using a windows emulator such as WINE?

You might them be able to run DVDPatcher directly on the Mac.


----------



## TCM2007 (Dec 25, 2006)

I'm not sure, but I think you may be able to do it by creating an encoding profile for mencoder which leaves video and audio untouched, but sets the aspect ratio. It could then be done automatically in TySuiteJ.


----------

