SageTV Community  

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

Notices

SageTV Software Discussion related to the SageTV application produced by SageTV. Questions, issues, problems, suggestions, etc. relating to the SageTV software application should be posted here. (Check the descriptions of the other forums; all hardware related questions go in the Hardware Support forum, etc. And, post in the customizations forum instead if any customizations are active.)

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-08-2007, 09:46 AM
simonen simonen is offline
Sage Aficionado
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 384
aspect ratio on imported videos

I found a post on this issue awhile back, but I cannot seem to locate it again.

I seem to be having a problem with "personal" dvds that I have ripped into avi's that have an aspect ratio of 16x9, when Sage is selected to use source as aspect ratio, these videos come through as 16x6 instead of 16x9. If I manually select 16x9 they resize to the proper ratio. Of course, this would not be a problem if everything was 16x9, but I always find myself having to manually switch it back to source when watching regular TV.

Is there some magical trick that I am unaware of?
Reply With Quote
  #2  
Old 10-08-2007, 08:27 PM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
Quote:
Originally Posted by simonen View Post
Is there some magical trick that I am unaware of?
The magic trick is: revert to version 5!

It's a bug that they introdiced in v.6. I've reported it many times, and they've always answered that it will easily be fixed in the next release... Yet, it is still here in v.6.2.10.

The bug I'm talking about manifests itself when you set up Sage to use SageTVPlayer for MPEG4 playback. What it does is, it disregards the aspect ratio information contained in the AVI headers, and plays the video as "square pixels". As a result, all my 4:3 videos that were captured at 720x480 resolution play with the wrong aspect of 3:2 (720:480) instread of 4:3.

Personally, I am quite ticked off by all this, as I have hundreds of videos that now have this wrong aspect problem. I don't know why more people aren't complaining about it, as I would think that AVI is a good choice for a container if you want to convert your recordings to h.264 or something.

Yours,
Patilan.
Reply With Quote
  #3  
Old 10-08-2007, 08:38 PM
ke6guj ke6guj is offline
Sage Icon
 
Join Date: Jan 2005
Posts: 2,355
Quote:
Originally Posted by Patilan View Post
I don't know why more people aren't complaining about it, as I would think that AVI is a good choice for a container if you want to convert your recordings to h.264 or something.
.
Haven't complained since I haven't seen the problem. Don't use mplayer, so maybe thats why.
__________________
- Jack
__________________________________________
Server: AMD Phenom 9750, 2GB RAM, 2 Hauppauge PVR500, 1 Firewired DCT6200, 1 HDHomerun tuning 2 QAM channels, Vizio 37" HDTV LCD, 1 USB-UIRT

Clients: 1 MediaMVP, 1 Placeshifter Client, & 1 SageTV Client.
Reply With Quote
  #4  
Old 10-08-2007, 08:55 PM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
Quote:
Originally Posted by ke6guj View Post
I haven't seen the problem. Don't use mplayer, so maybe thats why.
Well yes, that's why!

I like MPlayer though. Apart from that inconvenience with the aspects, I've found that MPlayer gives a stellar performance, and with very little processor resources. And I am yet to find a video it can't play.

I'd hate to start experimenting with other players and codecses if Sage don't fix that bug.
Reply With Quote
  #5  
Old 10-09-2007, 03:12 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Quote:
Originally Posted by Patilan View Post
The bug I'm talking about manifests itself when you set up Sage to use SageTVPlayer for MPEG4 playback. What it does is, it disregards the aspect ratio information contained in the AVI headers, and plays the video as "square pixels". As a result, all my 4:3 videos that were captured at 720x480 resolution play with the wrong aspect of 3:2 (720:480) instread of 4:3.
I do not see this problem at all, neither with SageTVPlayer, not DShow

Using Source AR, Xvid/Mpeg4 AVIs
4x3 720x576 AVIs play as 4x3
16x9 720x576 AVIs play as 16x9
and square pixel AVIs also play correctly.

Are you sure your AVI's are tagged with the correct AR? Check detailed info, File format in Sage, open them in GSpot (see the 'd' box, bottom right for AR's), or play them manually in SageTVPlayer, and check for the line:
"Movie-Aspect is xxx - prescaling to correct movie aspect.".


Same goes for the original poster, whats the file format (Aspect Ratio and resolution) listed in Sage's detailed info screen...
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki

Last edited by nielm; 10-09-2007 at 03:33 AM.
Reply With Quote
  #6  
Old 10-09-2007, 06:18 AM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
Quote:
Originally Posted by nielm View Post
I do not see this problem at all, neither with SageTVPlayer, not DShow
Strange. I'll try figure out where I can upload some examples.

Quote:
Originally Posted by nielm View Post
...or play them manually in SageTVPlayer...
When I do so, they play correctly. That's the most puzzling part!

Quote:
Originally Posted by nielm View Post
whats the file format (Aspect Ratio and resolution) listed in Sage's detailed info screen...
Sage's detailed info screen doesn't mention Aspect Ratio for these videos. It reads:
Format: AVI[H.264 480p@24fps, MP2/224Kbps@48kHz Stereo]

Last edited by Patilan; 10-11-2007 at 05:34 AM. Reason: typo
Reply With Quote
  #7  
Old 10-09-2007, 08:06 AM
simonen simonen is offline
Sage Aficionado
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 384
I just ran GSpot on one of my files that I have a problem with and it showed 720x304 ratio. I guess this is my problem, thanks for the help.

At this point forward, I can make sure that handbreak uses to correct ration, but is there a way to manually corrected the videos I have previously ripped? Can I manually change the tag?

Thanks for the help.
Reply With Quote
  #8  
Old 10-09-2007, 12:47 PM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
A google for "avi edit aspect ratio" got a doom9 forum link to this tool: MPEG4 Modifier

It's also possible to construct a ffmpeg (sagetvtranscoder) command line to reset AR, but the above tool is probably easier!

However, 720x304 = 2.37:1 which is very close to the cinematic widescreen AR of 2.39:1 -- are you sure your vid really is a 16x9 vid?


Patilan: this tool will not help you: it's for Xvid/divx files as the aspect ratio is set in the mpeg4 video stream.
Having played a bit, i think your problem is specific to h264 AVIs: ffmpeg (and gspot) does not know how to get the AR from h264 vidstreams, so they assume square pixels.

Sage calls ffmpeg (transcoder) with -dumpmetatdata to get the video format, then I guess uses that info, along with the user's defined AR to set up mplayer...
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #9  
Old 10-09-2007, 01:41 PM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
Quote:
Originally Posted by nielm View Post
i think your problem is specific to h264 AVIs: ffmpeg (and gspot) does not know how to get the AR from h264 vidstreams, so they assume square pixels.
Right.

It is frustrsating, because apparently SageTVPlayer knows how to get the AR.

And, it is a medical fact that Sage used to play these videos correctly before version 6.
Reply With Quote
  #10  
Old 10-10-2007, 03:06 AM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
I have uploaded a 30-second video clip for demonstration:
http://Y3kLimousine.com/ASPECT.zip

The zip contains two files: the original capture in mpeg2 format, and also the same video converted to H.264 in AVI container.

To replicate the problem, set up Sage to use SageTVPlayer for MPEG4 playback. Set up Sage's Aspect Ratio Mode to "Source".

What you should be able to see is that Sage (v.6.2.10) plays the AVI file with incorrect aspect ratio.

I have verified that the AVI file contains correct Aspect Ratio information in the headers. I have also verified that SageTVPlayer.exe can play the AVI correctly outside of SageTV. So can the other players I have tested. The problem only arises when the AVI is played within SageTV.

Please somebody confirm or deny being able to replicate this bug. I can't believe that I am the only one here seing ghosts.

Yours,
Patilan
Reply With Quote
  #11  
Old 10-10-2007, 06:56 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
As mentioned above, Sage needs to know the AR of files so that it can rescale them correctly in proportion to the required AR and the display aspect ratio... (especially in the cases where the display pixels are non-square, eg a 1024x768 16:9 display).
(this is why your bug got introduced in v5 - thats where the concept of Display Aspect Ratio got introduced)

Sage uses ffmpeg to extract the video AR info from the file:
Code:
SageTVTranscoder -dumpmetadata -i ASPECT.avi
Input #0, avi, from 'ASPECT.avi':
  Duration: 00:00:23.7, start: 0.000000, bitrate: 838 kb/s
  Stream #0.0: Video: h264, yuv420p, 720x480, progressive, 23.98 fps(r)
  Stream #0.1: Audio: mp2, 48000 Hz, stereo, 224 kb/s
SageTVTranscoder -dumpmetadata -i ASPECT.mpg
Input #0, mpeg, from 'ASPECT.mpg':
  Duration: 00:00:23.4, start: 0.200000, bitrate: 8461 kb/s
  Stream #0.0[0x1e0]: Video: mpeg2video, yuv420p, 720x480, AR: 4:3, interlaced, 8000 kb/s, 29.97 fps(r)
  Stream #0.1[0x1c0]: Audio: mp2, 48000 Hz, stereo, 224 kb/s
As you can see, FFmpeg cannot extract display AR from h264 streams (in fact if you convert the file to mpeg4/xvid with the transcoder, it will make a 3:2 video). Nor does it know about, or use the vprp AVI header/

Sage therefore assumes that the video has square pixels, with 3:2 AR, and resizes it accordingly on playback


As you say, there is also the AR header in the AVI container, but I believe that mplayer is the only player that understand it... (search for "AVI OpenDML vprp")
(ffmpeg doesnt know about it, neither does VLC, WMP, Gspot, VirtualDub). To be honest, putting an AR in the header of the container is a bit dumb -- the video AR should be encoded with the video stream -- what happens when the video stream is removed from it's container: the info is lost!


Why do the h264 videos play back well in other players?
Well some decoders are aware of the aspect ratio information in the h264 stream. (VLC, mplayer), and some are not (ffdshow, ffmpeg), so on my system only vlc and mplayer play back your files in the correct AR.


So in summary, if you want to use h.264 in sage, you have to either:
  1. manually switch AR on playback
  2. resize the file on encode to create a 1:1 SAR (square pixels) video (mencoder optione: -vf scale=-2:-1 to scale width and preserve height, or -vf scale=-1:-2 to scale height and preserve width)
  3. provide resources (time/money) to fix ffmpeg so that it understands h264 streams' AR
  4. wait for someone else to do (3)

You may be the only one seeing this bug, because you may be the only one encoding to non-square pixel h.264 encoded files... if you encoded to mpeg4, you would have no problems!
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki

Last edited by nielm; 10-10-2007 at 06:58 AM.
Reply With Quote
  #12  
Old 10-10-2007, 09:57 AM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
To summarise the most important points of what you said:
Quote:
1. Sage needs to know the AR...
2. Sage uses ffmpeg to extract the video AR...
3. FFmpeg cannot extract display AR from h264 streams...
4. ...this is why your bug got introduced in v5.
The combined logic of the above statements strikes me as idiotic.

Don't misunderstand me, Nielm, your explaination is correct. My comment is about the way SageTV does this business. Because all of these files played properly in SageTV before.


Quote:
...there is also the AR header in the AVI container, but I believe that mplayer is the only player that understand it
And that's exactly what SageTV is using for the playback, isn't it? mplayer! (AKA: SageTVPlayer) Why doesn't Sage use mplayer to get it's AR info?


Quote:
if you want to use h.264 in sage, you have to either:
1. manually switch AR on playback
I would, if I could. My videos are rarely at 720x480 pixels exactly. They all have been cropped differently during the conversion.

Quote:
2. resize the file on encode to create a 1:1 SAR.
I am very reluctant to do resizing at encoding as it leads to loss of quality. Resizing if any should be done at playback.

Quote:
3. provide resources (time/money) to fix ffmpeg so that it understands h264 streams' AR
I have provided resources to Sage: I've paid my licenses, so Sage would understands h264 streams.

Quote:
4. wait for someone else to do (3)
I wonder, when Sage's technical support assured me that this bug will easily fixed in a later release, what exactly did they have in mind?

Quote:
if you encoded to mpeg4, you would have no problems!
Well, h.264 is mpeg4. Are you saying that I shouldn't use h.264? Or are you talking about containers here? If so, then what container would you recomend for my h.264s, other than AVI?

Yours,
Patilan
Reply With Quote
  #13  
Old 10-10-2007, 12:20 PM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Quote:
Originally Posted by Patilan View Post
[mplayer is] exactly what SageTV is using for the playback, isn't it? mplayer! (AKA: SageTVPlayer) Why doesn't Sage use mplayer to get it's AR info?
Who knows... maybe they did not envision this problem when they made the design decision to use ffmpeg.
Also mplayer does not display the AR until after it has setup playback, which means it may not work in the service, and each time a new video is imported it would have to be played to get the AR..
Quote:
I wonder, when Sage's technical support assured me that this bug will easily fixed in a later release, what exactly did they have in mind?
Again, who knows, time, resources, problem may be more complex to resolve than initially thought...

Quote:
Well, h.264 is mpeg4. Are you saying that I shouldn't use h.264?
yes: if you don't want to resize, then for the moment you have to use a codec that Sage supports together with reading the aspect ratio.
I meant divx/xvid (MPEG-4 part2/SP/ASP) , which is commonly referred to as Mpeg-4
Quote:
Or are you talking about containers here? If so, then what container would you recomend for my h.264s, other than AVI?
I don't think changing containers will help, because ffmpeg will still be unable to get the aspect ratio from the h264 stream...
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #14  
Old 10-10-2007, 12:44 PM
simonen simonen is offline
Sage Aficionado
 
Join Date: Jan 2006
Location: Carlsbad, CA
Posts: 384
Quote:
Originally Posted by nielm View Post
A google for "avi edit aspect ratio" got a doom9 forum link to this tool: MPEG4 Modifier

It's also possible to construct a ffmpeg (sagetvtranscoder) command line to reset AR, but the above tool is probably easier!

However, 720x304 = 2.37:1 which is very close to the cinematic widescreen AR of 2.39:1 -- are you sure your vid really is a 16x9 vid?


Patilan: this tool will not help you: it's for Xvid/divx files as the aspect ratio is set in the mpeg4 video stream.
Having played a bit, i think your problem is specific to h264 AVIs: ffmpeg (and gspot) does not know how to get the AR from h264 vidstreams, so they assume square pixels.

Sage calls ffmpeg (transcoder) with -dumpmetatdata to get the video format, then I guess uses that info, along with the user's defined AR to set up mplayer...
The videos are ripped from DVDs that are widescreen, so I would assume that they should display correctly. If I use VLC, they display fine. I also did use an H.264 encoder.
Reply With Quote
  #15  
Old 10-10-2007, 11:35 PM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
Quote:
Originally Posted by nielm View Post
I don't think changing containers will help, because ffmpeg will still be unable to get the aspect ratio from the h264 stream...
Then ffmpeg is the totally wrong tool to use for getting aspect ratios!

As MPlayer can get the AR correctly, so can MEncoder (MPlayer's twin). And I am sure, other tools can do it too. Or, if needed, Sage could learn to read the file headers directly, without any external tools.

Just for fun, I typed:
mencoder.exe c:\test.avi -o nul -nosound -ovc raw -quiet
...and voilà! MEncoder displayed:
ODML: vprp aspect is 4:3.

See, unlike ffmpeg which is "open source", SageTV is a commercial product, and therefore SageTV cannot use ffmpeg as an excuse.

Besides, Sage made it a big point announcing improved support for H.264. When in fact, nothing improved for my case. Just the opposite: h.264s that were working before, now they don't work anymore. Understand my frustration: I have hundreds of quality movies that are now affected by this problem.

I hope that the Sage people read these posts sometimes.

Yours,
Patilan

Last edited by Patilan; 10-10-2007 at 11:40 PM. Reason: typos
Reply With Quote
  #16  
Old 10-11-2007, 02:21 AM
nielm's Avatar
nielm nielm is offline
SageTVaholic
 
Join Date: Oct 2003
Location: Belgium
Posts: 4,496
Quote:
Or, if needed, Sage could learn to read the file headers directly, without any external tools.
I think that they used to, or at least they got the AVI/MPEG-2 duration directly. But there are so many container/codec formats around that I guess they decided that is probably better to leverage something like ffmpeg.
Quote:
I hope that the Sage people read these posts sometimes.
You should assume that they do not - you may want to include a pointer to this thread next time you report the bug!
__________________
Check out my enhancements for Sage in the Sage Customisations and Sageplugins Wiki
Reply With Quote
  #17  
Old 10-11-2007, 05:31 AM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
Quote:
Originally Posted by nielm View Post
But there are so many container/codec formats around that I guess they decided that is probably better to leverage something like ffmpeg.
This is quite understandable. Although, ffmpeg may be a poor choice to do it. I have always advocated (for some other reasons) that Sage should better try using MEncoder for all the transcodings, but that's a matter of a whole different discussion.

As for the so many container/codec formats, h.264 should be a special priority for them. And AVI container is one of the most reasonable choices for a h.264.

Yours,
Patilan
Reply With Quote
  #18  
Old 10-11-2007, 12:35 PM
Taddeusz Taddeusz is offline
SageTVaholic
 
Join Date: Nov 2004
Location: Yukon, OK
Posts: 3,919
I believe this is the same problem I've noticed when MP4, either standard AVC container or Quicktime AVC/H.264, files are transcoded to my MVP. They are resized to 4:3 instead of being letterboxed into the proper aspect ratio for my SDTV. MPEG4 Part 2 files, Xvid/Divx, have always played correctly. Only AVC/H.264 files aren't sized properly.

I reported it to support over the weekend and submitted a video sample upon request. Their response was to tell me they'd listed as a bug to fix. I wonder what kind of priority it's gotten?
Reply With Quote
  #19  
Old 10-13-2007, 04:32 PM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
FYI, I just recieived an email from sage regarding this issue:
Quote:
Hello,

The developers are aware of this and are working on a fix for it.

Thanks
That's something anyway.

Patilan

Last edited by Patilan; 10-14-2007 at 11:40 AM.
Reply With Quote
  #20  
Old 10-18-2007, 03:35 PM
Patilan Patilan is offline
Sage Advanced User
 
Join Date: Oct 2006
Location: Lake Forest, Illinois, USA
Posts: 237
Quote:
The developers are aware of this and are working on a fix for it.
Here is my suggestion for a fix:

-If: SageTV is unable to determine the aspect ratio of a particular video,
AND
-If: SageTV is set up to use SageTVPlayer for MPEG4 content,

THEN: SageTV should pass the playback to SageTVPlayer without making any assumptions about the aspect ratio.

Problem Solved!
(the problem being: SageTV makes wrong assumptions based on the resolution.)

If SageTVPlayer is going to be used for this playback anyway, then SageTVPlayer is perfectly capable of determining the aspect ratio correctly. Also, SageTVPlayer is smart enough about resizing the video properly to fit the most of it in any given window size.

This is how SageTV worked before, and all was great. I see no reason why Sage can't be made to work like this again.

I really don't want to give up on SageTVPlayer, because it is probably the best video player there is. It can nicely play any kind of video you throw at it, and it plays all these videos with very little CPU. So please let's fix this bug.

Yours,
Patilan
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
Problem with aspect ratio mode delgrego SageTV Software 10 03-23-2007 02:35 PM
aspect ratio issues cbarrett SageTV Media Extender 3 11-29-2006 02:26 PM
Aspect Ratio tbonessc SageTV Beta Test Software 5 11-22-2006 10:15 AM
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 01:24 AM.


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