Project

General

Profile

Bug #307

[patch] mkv aspect ratio

Added by sbi - over 8 years ago. Updated over 8 years ago.

Status:
Fixed
Priority:
Urgent
Assignee:
Category:
General
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Found in version:
Affected Versions:

Description

Hi,

I believe there is a bug in the mkv muxer related to aspect ratios.

Indeed, it seems to me that the aspect ratio written as Display Aspect Ratio in the mkv files is actually the Samble Aspect Ratio that comes from the h264 stream. This is not always correct.

The attach patch is an attempt to fix this.

-sbi

mkv_aspect.patch (817 Bytes) mkv_aspect.patch The patch sbi -, 2010-10-18 21:08

History

#1 Updated by Andreas Smas over 8 years ago

Hm, I know this is a problem for h264. But for mpeg2 I think it does the correct thing?

#2 Updated by Andreas Smas over 8 years ago

  • Found in version set to fixed

Fixed differently in r5478.

Please verify that it works :-)

#3 Updated by sbi - over 8 years ago

  • Status changed from Fixed to Need feedback
  • Found in version deleted (fixed)

Almost. This should take care of interlacing:

diff --git a/tvheadend/src/parser_h264.c b/tvheadend/src/parser_h264.c
index 1114f7e..3833049 100644
--- a/tvheadend/src/parser_h264.c
+++ b/tvheadend/src/parser_h264.c
@ -410,8 +410,8 @ h264_decode_slice_header(th_stream_t *st, bitstream_t *bs, i

if(p->sps[sps_id].aspect_num && p->sps[sps_id].aspect_den) {

- int w = p->sps[sps_id].aspect_num * p->sps[sps_id].width;
- int h = p->sps[sps_id].aspect_den * p->sps[sps_id].height;
+ int w = p->sps[sps_id].aspect_num * st->st_width;
+ int h = p->sps[sps_id].aspect_den * st->st_height;
int d = gcd(w, h);

st->st_aspect_num = w / d;

#4 Updated by Andreas Smas over 8 years ago

  • Status changed from Need feedback to Fixed
  • Found in version set to fixed

Aye, Fixed in 5481

Also available in: Atom PDF