SageTV Community  

Go Back   SageTV Community > SageTV BETA Release Products > SageTV Beta Test Software
Forum Rules FAQs Community Downloads Today's Posts Search

Notices

SageTV Beta Test Software Discussion related to BETA Releases of the SageTV application produced by SageTV. Questions, issues, problems, suggestions, etc. regarding SageTV Beta Releases should be posted here.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 11-17-2007, 12:45 PM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
Unhappy Aspect Ratio, again. (beta 6.3.1)

Hello,

A few days ago I was a little too hasty to celebrate that beta 6.3.1 fixed the aspect ratio problem in H.264 AVIs. Turns out, that's not quite the case.

Something has been fixed indeed. That is, recordings which have been captured at resolution 720x480, and have retained the same resolution when converted to H.264 in AVI -- all these recordings now play correctly in Sage.

But if any cropping had been done with the transcoding, Sage displays such videos incorrectly. Interestingly, sagetvplayer.exe plays such videos with the correct aspect ratio when played outside of SageTV.

For example, a video captured at 720x480, cropped to 704x480, and transcoded to H.264 AVI, should normally be displayed (as "source") with tiny little vertical bars to the left and to the right. Beta 6.3.1 plays such video squeezed vertically and with horizontal black bars on top and bottom of the picture.

I played with different cropped videos, and beta 6.3.1 always messed up the aspect if the video has been cropped either horisontally, or vertically, or on both sides.

So some progress has been made indeed, but we are not there yet.

-=patilan=-
Reply With Quote
  #2  
Old 11-18-2007, 09:51 PM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
I also noticed that Quicktime container H.264 files also don't play at the correct aspect ratio on the MVP. I understand Quicktime specifies the video aspect ratio in a different way than standard MP4 files.

All my H.264 AVI files play correctly. They are all 720x480 converted from DVD's. I'm not cropping mine. I'd rather the files have the proper dimensions. Plus, if you crop your files you end up having really odd PAR's on your files. Unless you're encoding them with square pixels, but then you're going to lose some resolution in the conversion to square pixels.
Reply With Quote
  #3  
Old 11-18-2007, 10:32 PM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
Quote:
Originally Posted by Taddeusz View Post
All my H.264 AVI files play correctly. They are all 720x480 converted from DVD's.
That's the good news about beta 6.3.1: videos@720x480 now play fine. All other resolutions are still messed up though. So Sage is still somehow misinterpreting the aspect information in the AVI header.

Quote:
Originally Posted by Taddeusz View Post
I'm not cropping mine. I'd rather the files have the proper dimensions. Plus, if you crop your files you end up having really odd PAR's on your files.
PAR is what it is. Can't possibly claim that one PAR is "odd" and another is not.

Besides, whan converting to H.264 you do benefit quite a lot by cropping the junk, if any, while still preserving the "proper" dimensions. Encoding with uncropped black bars is a killer for the movement estimation, and a huge waste of bitrate. But that's a topic for a separate discussion.

Yours,
Patilan
Reply With Quote
  #4  
Old 11-19-2007, 12:16 PM
iconic's Avatar
iconic iconic is offline
Sage Advanced User
 
Join Date: Sep 2006
Posts: 138
Quote:
Originally Posted by Taddeusz View Post
I also noticed that Quicktime container H.264 files also don't play at the correct aspect ratio on the MVP. I understand Quicktime specifies the video aspect ratio in a different way than standard MP4 files.
Quicktime uses a 'pasp' atom to specify pixel shape. I've noticed sometimes that atom is not present even though it's in the H.264 stream information. This is generally the fault of the encoder or muxer, even QT seems to be a bit lazy in using it when it assumes square pixels (a dangerous assumption...).


Quote:
Originally Posted by Taddeusz View Post
Plus, if you crop your files you end up having really odd PAR's on your files. Unless you're encoding them with square pixels, but then you're going to lose some resolution in the conversion to square pixels.
What's the harm in specifying a pixel aspect ratio? It'll guarantee the image looks proper on all systems, so long as the player can handle adjusting the image shape to accommodate it. If you crop and specify a PAR, then you'll encode less data which reduces not only the final bitstream size, but also (ever so slightly) the load on the encoder while it's crunching. And you'll be guaranteed the image looks right when it's played back.

Plus if you encode the black bars, you wouldn't be able to take advantage of properly shaped screens, e.g., if you encode 16:9 at 4:3 with black bars then want to play back on a true 16:9 display, you have to either crop the output image, suffer with black bars on ALL sides, or live with a squished image due to double black bars.

And pixels are never square
Reply With Quote
  #5  
Old 11-19-2007, 01:34 PM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
Quote:
Originally Posted by iconic View Post
Quicktime uses a 'pasp' atom to specify pixel shape. I've noticed sometimes that atom is not present even though it's in the H.264 stream information. This is generally the fault of the encoder or muxer, even QT seems to be a bit lazy in using it when it assumes square pixels (a dangerous assumption...).
Quicktime was doing ok with my MP4 files until the last update. It now gets the aspect ratio totally wrong. Apparently they screwed something up. It's like that on both Windows and Mac.

Quote:
Originally Posted by iconic View Post
What's the harm in specifying a pixel aspect ratio? It'll guarantee the image looks proper on all systems, so long as the player can handle adjusting the image shape to accommodate it. If you crop and specify a PAR, then you'll encode less data which reduces not only the final bitstream size, but also (ever so slightly) the load on the encoder while it's crunching. And you'll be guaranteed the image looks right when it's played back.

Plus if you encode the black bars, you wouldn't be able to take advantage of properly shaped screens, e.g., if you encode 16:9 at 4:3 with black bars then want to play back on a true 16:9 display, you have to either crop the output image, suffer with black bars on ALL sides, or live with a squished image due to double black bars.

And pixels are never square
I never said that there was any harm in specifying an aspect ratio. All the DVD's I've been converting all have the original 720x480 size and either have a 4:3 or 16:9 aspect ratio. I'm not so much against trimming the upper and lower black areas but do have something against trimming the sides. I'm still on an SDTV so am technically stuck with the 720 pixel width. I feel it's somehow more "kosher" to keep the 720 pixel width.

On a side note I've been quite a bit more pleased with the way my Mac deals with video. Surprisingly (or not), it actually knows what video black and white are and displays them correctly. I don't think I've ever had any consistent results with Windows where video black and white are displayed properly. On my Mac the video black borders of videos are always displayed as true black on the screen. Never as dark grey.
Reply With Quote
  #6  
Old 11-19-2007, 08:12 PM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
I submitted a bug report a couple days after the beta came out and they finally got back to me with a very unhelpful remark:

Quote:
We're not really sure this is a bug. The H.264 video stream itself is what indicates the aspect ratio of its encoded material. This isn't left up to the container.

I think it's an issue with how you're creating the files. The H.264 encoding should be adjusted to insert the proper aspect ratio into the H.264 video stream itself.
I'm not sure if what they say is true about H.264 streams but the fact of the matter is that when I play any wide H.264 MOV files on my TV they get stretched vertically to fit my SDTV.
Reply With Quote
  #7  
Old 11-19-2007, 09:43 PM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
Just a little update to the MOV problem. I got a reply back pretty quickly. They say the files in question have no aspect ratio information so when they get played on the MVP they get rescaled to 720x480 and then displayed on the TV at full screen, which on an SDTV would be 4:3 instead of whatever aspect ratio the original file is in. The same files playback fine within SageTV or the Client.
Reply With Quote
  #8  
Old 11-20-2007, 08:30 AM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
Quote:
Originally Posted by Taddeusz View Post
Just a little update to the MOV problem. I got a reply back pretty quickly. They say the files in question have no aspect ratio information
Well, that's a different problem. The AVI files do have aspect information, and SageTVPlayer knows how to get it. For some reason though SageTV uses SageTVPlayer incorrectly.
Reply With Quote
  #9  
Old 11-20-2007, 01:53 PM
bluenote bluenote is offline
Sage Aficionado
 
Join Date: Nov 2004
Location: Vancouver, canada
Posts: 336
Hey patilan,

I'd like to start cropping my recordings as they are compressed. I use the built in compression in sage, with a slightly customized profile (avi, H.264, mp3).

I don't suppose there is a "one size fits all" solution? either to detect the black bars and automatically crop them out, or to specify a particular size that most channels use? (and what would I use to measure the pixels, incidently?)

Like to hear any suggestions you may have,

Cory
Reply With Quote
  #10  
Old 11-20-2007, 03:06 PM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
Quote:
Originally Posted by cnovak View Post
Hey patilan,

I'd like to start cropping my recordings as they are compressed. I use the built in compression in sage, with a slightly customized profile (avi, H.264, mp3).

I don't suppose there is a "one size fits all" solution? either to detect the black bars and automatically crop them out, or to specify a particular size that most channels use? (and what would I use to measure the pixels, incidently?)

Like to hear any suggestions you may have,

Cory
Hi Cory,

I don't use the built in compression in sage because it uses ffmpeg, while I'd rather do it with mencoder. The reason being is that almost all my recordings need to be inverse-telecined to their original 24 fps when converting them in order to get a nice sharp picture with smooth movements. Ffmpeg can't do that and mencoder does it nicely.

If you want though, you can still use "built in" compression in sage with mencoder. For this you need Evilpenguin's DVD burning plugin. Or you can use SageMCE. You can find them in the customization section of the forums.

For detecting the best crop size you could do:
Code:
mencoder.exe  -vf cropdetect  -ovc raw  -o NUL  -nosound  yourvideo
For convenience I've made it into a little script that lets me drag a file with the mouse and drop it ontop of that cropdetect script.

Once desided on the cropping rectangle, I modify the crop settings in my encoding script. At this point I also modify the bitrate setting in the encoding script. Depending on the video, I may also tweak some of the H.264 settings. That done, drag-drop the file ontop of the encoding script, and go out to dinner.

Of course all this can be modified into a "one size fits all" solution. But I personally like to make these decisions on a movie by movie basis. I feel that if something is worth to be done at all then it is worth to be done well.

Yours,
Patilan
Reply With Quote
  #11  
Old 11-20-2007, 05:48 PM
evilpenguin's Avatar
evilpenguin evilpenguin is offline
SageTVaholic
 
Join Date: Aug 2003
Location: Seattle, WA
Posts: 3,696
Just a heads up I used to use mencoder cropdetect for my autocrop needs and I had to stop because I found that (atleast with my recordings) I was getting an incorrect result ~30% of the time. I'm pretty sure on those occasions it was having issues with the video timeline.

(edit: although I was using a different command line, perhaps i'll give that one a shot)


Regardless, i'm looking into using comskip to do my crop detection now. Its much more accurate and is smart enough to take network logos into account but it also takes a bit longer.

Last edited by evilpenguin; 11-20-2007 at 05:51 PM.
Reply With Quote
  #12  
Old 11-20-2007, 06:04 PM
bluenote bluenote is offline
Sage Aficionado
 
Join Date: Nov 2004
Location: Vancouver, canada
Posts: 336
I thought I was done and I could just use Sage and save disk space in peace ... but there's always that one more improvement necessary ...

Thanks for the info But darn you patilan, darn you, for sending me down the road of different projects, just as the end was in sight ....

I wonder if I can simply use a 'per show' transcoder format crop size. That's about the only way I can think of to easily integrate cropping into an "inside sage" solution.

I used to use mencoder manually (actually, I wrote batch files to integrate with sage and to key off the presence of xml files to compress) but I really really wanted to just have a nice elegant solution *inside* sage, accessible from the GUI interface, etcetera.

I'll have a look at EP's customization just to see though.

Thanks for the education

Cory
Reply With Quote
  #13  
Old 11-21-2007, 12:00 AM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
Quote:
Originally Posted by evilpenguin View Post
Just a heads up I used to use mencoder cropdetect for my autocrop needs and I had to stop because I found that (atleast with my recordings) I was getting an incorrect result ~30% of the time. I'm pretty sure on those occasions it was having issues with the video timeline.

(edit: although I was using a different command line, perhaps i'll give that one a shot)
Howdy, Penguin!

I don't know what command line you were using, but for me the mencoder's cropdetect works well. That's probably because the things I'm encoding are from quality premium channels, or from DVD. In the rare occasions when I want to encode a movie from a crappy channel with some logo hanging in the black bar, then I'd adjust the crop values myself. (and always remember to end up with dimensions divisible by 16)

But I suppose we have different goals here. You are probably aiming at a more automated solution for your plugin, while I like to tweak the settings for each particular movie.

Quote:
Originally Posted by cnovak View Post
Thanks for the info But darn you patilan, darn you, for sending me down the road of different projects, just as the end was in sight ....
If this will help, I'll send you my scripts.

Quote:
Originally Posted by cnovak View Post
I really really wanted to just have a nice elegant solution *inside* sage, accessible from the GUI interface
Again, it all depends what you call elegant. For my personal tastes, my scripts are elegant. It all comes to the desired level of automation versus level of control.

If the solution you're looking for absolutely has to be *inside* sage, then EP's plugin is quite elegant for the job.

Yours,
Patilan
Reply With Quote
  #14  
Old 11-27-2007, 10:22 PM
iconic's Avatar
iconic iconic is offline
Sage Advanced User
 
Join Date: Sep 2006
Posts: 138
Quote:
Originally Posted by Taddeusz View Post
I'm not sure if what they say is true about H.264 streams but the fact of the matter is that when I play any wide H.264 MOV files on my TV they get stretched vertically to fit my SDTV.
If you use encode *anything* in a QuickTime movie container, the movie container needs a 'pasp' (pixel aspect ratio) atom or it's subject to interpretation by the decoder, usually incorrectly determined from the image resolution.
Reply With Quote
  #15  
Old 11-28-2007, 05:40 AM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
Quote:
Originally Posted by iconic View Post
If you use encode *anything* in a QuickTime movie container, the movie container needs a 'pasp' (pixel aspect ratio) atom or it's subject to interpretation by the decoder, usually incorrectly determined from the image resolution.
As I said earlier, this wasn't anything I was encoding myself. I filed a bug report on the beta and it was fixed with the 6.3.2. They said the videos I was having a problem with like Tiki Bar TV and NASA's Hidden Universe HD had no aspect ratio information so the transcoder was assuming they were 4:3 instead of correctly assuming they had square pixels. It only happened on the MVP. But it's now been fixed with the latest beta so I'm happy.

Now I can't wait for the HD extender so I don't have to worry about transcoding at all.
Reply With Quote
  #16  
Old 11-28-2007, 03:16 PM
bluenote bluenote is offline
Sage Aficionado
 
Join Date: Nov 2004
Location: Vancouver, canada
Posts: 336
Hi Patilan

(Hopefully you'll see this, seems like your PMs may be set to off)
Well, it seems like I could not leave well enough alone -- I pulled out dirmon2, and went searching for the latest comskip lore, and read up on cutting commercials. Now all thats left is converting to H.264 with mencoder but Im thinking ... maybe I don't have to reinvent the wheel if you have a command line already written.

Can you share your script and/or commandlines? I'm interested in the auto crop too as long as this is going to happen outside of sage/in script ...

thanks

Cory
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
aspect ratio issues cbarrett SageTV Media Extender 3 11-29-2006 02:26 PM
Need Another Aspect Ratio Setting Humanzee SageTV Beta Test Software 0 03-02-2006 03:15 PM


All times are GMT -6. The time now is 02:56 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2023, vBulletin Solutions Inc.
Copyright 2003-2005 SageTV, LLC. All rights reserved.