Opened 11 years ago

Closed 7 years ago

#80 closed defect (fixed)

x264 SAR (Sample Aspect Ratio)

Reported by: anonymous Owned by:
Priority: normal Milestone: Sometime after 1.0
Component: Perian-Main Version:
Severity: normal Keywords:


Libavcodec ignores sample aspect ratio of x264.

Change History (12)

comment:1 Changed 11 years ago by astrange

A file with a correct video SAR and incorrect container SAR is probably invalid. Can we get a sample?

comment:2 Changed 11 years ago by anonymous

I have difficulty attaching a file. So I uploaded it at
The file is high-Profile and I'm using Perian trunk so that I can play a high-profile h.264 with Quicktime.
The file was encoded with x264(r614). SAR is 32:27 (16:9) and the file resolution is 720x480. VLC and Mplayer detect x264 SAR (so the file resolution becomes 853x480) but Quicktime with Perian doesn't. Is it a problem of Quicktime? because VLC and Mplayer use Libavcodec to decode x264 files.

comment:3 Changed 11 years ago by astrange

  • Owner set to astrange
  • Status changed from new to assigned

That's not the right SAR (display size should be 873x480 due to overscan, SAR should be 40:33). I'm sticking with the file being invalid if the container SAR is wrong, but maybe we should check it if the container doesn't define it.

comment:4 Changed 11 years ago by astrange

  • Owner astrange deleted
  • Status changed from assigned to new

comment:5 Changed 11 years ago by dconrad

The problem is that QuickTime doesn't let decoders change the aspect ratio afaik, and leaves it at the dimensions that the track specifies (which can be different than the actual pixel resolution, that's how I think you'd normally get anamorphic video in mp4.) The only way I can see us being able to change the aspect ratio is if we added a pasp extension to the image description given, but that doesn't work. I think that the only way we could do this would be to handle .mp4 ourselves and extract the aspect ratio for h264 there.

comment:6 Changed 11 years ago by tick

  • Milestone set to Sometime after 1.0

comment:8 Changed 10 years ago by mcka

"pasp" means "pixel aspect ratio"

comment:9 Changed 10 years ago by Ritsuka

QuickTime 7.3 reads h.264 SAR, but only if perian is not installed.

comment:10 Changed 10 years ago by astrange

it's described in, I guess we can do it too.

comment:11 Changed 10 years ago by chromafile

I just noticed that Quicktime 7.4 handles H.264 SAR with or without Perian and plays high profile H.264 without Perian on both Tiger and Leopard. FYI, QT 7.4 Windows can't play High Profile h.264 correctly but reads SAR.

comment:12 Changed 7 years ago by astrange

  • Resolution set to fixed
  • Status changed from new to closed

I did what I could for this, I think.

Note: See TracTickets for help on using tickets.