[svn1505] dvd's aspect ratio miscalculated

Archive of historical bug reports.
Please use the GitHub link above to report issues.
Forum rules
*******************************
Please be aware we are now using GitHub for issue tracking and feature requests.
- This section of the forum is now closed to new topics.

*******************************
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

[svn1505] dvd's aspect ratio miscalculated

Post by jzietman »

I have being having difficulty when ripping the Les Choristes (Collector's Edition) dvd using svn1505 (no patches applied). I have tested the same dvd rip (done using the latest veriosns of FairMount and DTOX) with svn1477 and 0.9.2 and neither have had this issue. The problem is that svn1505 incorrectly reads the video aspect ratio, stretching it horizontally so that the image is very distorted. Below are activity logs for svns 1505 and 1477 and also version 0.9.2 as they scan the source as well as screen shots of the picture settings window as I try to set up an anamorphic encode. The distortion is also present when trying to encode without anamorphic and "keep aspect ratio" checked.

Further information:
Mac OS X 10.5.3
Preset is a slightly altered version of Constant Quality Rate (just some x264 options changed and decombing + vfr turned on in the svns)
DVD is Les Choristes (http://www.amazon.fr/Choristes-%C3%89di ... 394&sr=8-9). This is a PAL dvd ripped using an external dvd drive (plextor 712-uf with the latest firmware)
This issue happens consistently with this dvd (haven't had a chance to test with too many others yet, though I've never had this problem before) with svn1505 and never with the earlier svn and stable build.

svn1505:
Activity Log:

Code: Select all

[23:51:07] macgui: Handbrake Version: svn1505 (2008061001)
[23:51:08] hb_init: checking cpu count
[23:51:08] hb_init: starting libhb thread
[23:51:08] thread b01c9000 started ("libhb")
[23:51:11] macgui: trying to open video_ts folder (parent directory chosen)
[23:51:11] hb_scan: path=/Users/jzietman/Documents/DVD Rip Temp/LES CHORISTES, title_index=0
[23:51:11] thread b087f000 started ("scan")
[23:51:11] scan: trying to open with libdvdread
[23:51:11] scan: DVD has 1 title(s)
[23:51:11] scan: scanning title 1
[23:51:11] scan: opening IFO for VTS 1
[23:51:11] pgc_id: 1, pgn: 1: pgc: 0xeaf9ac0
[23:51:11] scan: vts=1, ttn=1, cells=0->15, blocks=0->2569861, 2569862 blocks
[23:51:11] scan: duration is 01:32:34 (5554050 ms)
[23:51:11] scan: checking audio 1
[23:51:11] scan: id=81bd, lang=Francais (AC3), 3cc=fra
[23:51:11] scan: title 1 has 16 chapters
[23:51:11] scan: chap 1 c=0->0, b=0->115951 (115952), 250469 ms
[23:51:11] scan: chap 2 c=1->1, b=115952->269739 (153788), 332757 ms
[23:51:11] scan: chap 3 c=2->2, b=269740->440932 (171193), 369621 ms
[23:51:11] scan: chap 4 c=3->3, b=440933->587980 (147048), 317398 ms
[23:51:11] scan: chap 5 c=4->4, b=587981->696234 (108254), 233458 ms
[23:51:11] scan: chap 6 c=5->5, b=696235->847258 (151024), 326399 ms
[23:51:11] scan: chap 7 c=6->6, b=847259->1014694 (167436), 361491 ms
[23:51:11] scan: chap 8 c=7->7, b=1014695->1208291 (193597), 418860 ms
[23:51:11] scan: chap 9 c=8->8, b=1208292->1426149 (217858), 470581 ms
[23:51:11] scan: chap 10 c=9->9, b=1426150->1557664 (131515), 284579 ms
[23:51:11] scan: chap 11 c=10->10, b=1557665->1723393 (165729), 358628 ms
[23:51:11] scan: chap 12 c=11->11, b=1723394->1962418 (239025), 516746 ms
[23:51:11] scan: chap 13 c=12->12, b=1962419->2136803 (174385), 376549 ms
[23:51:11] scan: chap 14 c=13->13, b=2136804->2394150 (257347), 556824 ms
[23:51:11] scan: chap 15 c=14->14, b=2394151->2480543 (86393), 186282 ms
[23:51:11] scan: chap 16 c=15->15, b=2480544->2569861 (89318), 193400 ms
[23:51:11] scan: aspect = 16
[23:51:11] scan: decoding previews for title 1
[23:51:11] scan: preview 1
[23:51:11] scan: audio 0x81bd: AC-3, rate=48000Hz, bitrate=448000 Francais (AC3) (5.1 ch)
[23:51:11] scan: preview 2
[23:51:11] scan: preview 3
[23:51:11] scan: preview 4
[23:51:11] scan: preview 5
[23:51:11] scan: preview 6
[23:51:11] scan: preview 7
[23:51:11] scan: preview 8
[23:51:11] scan: preview 9
[23:51:12] scan: preview 10
[23:51:12] scan: 10 previews, 720x576, 25.000 fps, autocrop = 70/70/2/0, aspect 2.33:1, PAR 256:135
[23:51:12] scan: title (0) job->width:720, job->height:240
[23:51:12] thread b087f000 exited ("scan")
[23:51:12] thread b087f000 joined ("scan")
[23:51:12] libhb: scan thread found 1 valid title(s)
Image

svn1477:
Activity Log:

Code: Select all

[23:52:43] macgui: Handbrake Version: svn1477 (2008053101)
[23:52:44] hb_init: checking cpu count
[23:52:44] hb_init: starting libhb thread
[23:52:44] thread b01da000 started ("libhb")
[23:52:46] macgui: trying to open video_ts folder (parent directory chosen)
[23:52:46] hb_scan: path=/Users/jzietman/Documents/DVD Rip Temp/LES CHORISTES, title_index=0
[23:52:46] thread b087f000 started ("scan")
[23:52:46] scan: trying to open with libdvdread
[23:52:46] scan: DVD has 1 title(s)
[23:52:46] scan: scanning title 1
[23:52:46] scan: opening IFO for VTS 1
[23:52:46] pgc_id: 1, pgn: 1: pgc: 0x11801790
[23:52:46] scan: vts=1, ttn=1, cells=0->15, blocks=0->2569861, 2569862 blocks
[23:52:46] scan: duration is 01:32:34 (5554050 ms)
[23:52:46] scan: checking audio 1
[23:52:46] scan: id=81bd, lang=Francais (AC3), 3cc=fra
[23:52:46] scan: title 1 has 16 chapters
[23:52:46] scan: chap 1 c=0->0, b=0->115951 (115952), 250469 ms
[23:52:46] scan: chap 2 c=1->1, b=115952->269739 (153788), 332757 ms
[23:52:46] scan: chap 3 c=2->2, b=269740->440932 (171193), 369621 ms
[23:52:46] scan: chap 4 c=3->3, b=440933->587980 (147048), 317398 ms
[23:52:46] scan: chap 5 c=4->4, b=587981->696234 (108254), 233458 ms
[23:52:46] scan: chap 6 c=5->5, b=696235->847258 (151024), 326399 ms
[23:52:46] scan: chap 7 c=6->6, b=847259->1014694 (167436), 361491 ms
[23:52:46] scan: chap 8 c=7->7, b=1014695->1208291 (193597), 418860 ms
[23:52:46] scan: chap 9 c=8->8, b=1208292->1426149 (217858), 470581 ms
[23:52:46] scan: chap 10 c=9->9, b=1426150->1557664 (131515), 284579 ms
[23:52:46] scan: chap 11 c=10->10, b=1557665->1723393 (165729), 358628 ms
[23:52:46] scan: chap 12 c=11->11, b=1723394->1962418 (239025), 516746 ms
[23:52:46] scan: chap 13 c=12->12, b=1962419->2136803 (174385), 376549 ms
[23:52:46] scan: chap 14 c=13->13, b=2136804->2394150 (257347), 556824 ms
[23:52:46] scan: chap 15 c=14->14, b=2394151->2480543 (86393), 186282 ms
[23:52:46] scan: chap 16 c=15->15, b=2480544->2569861 (89318), 193400 ms
[23:52:46] scan: aspect = 16
[23:52:46] scan: decoding previews for title 1
[23:52:46] scan: preview 1
[23:52:46] unknown aspect ratio 21
[23:52:46] scan: AC3, rate=48000Hz, bitrate=448000
[23:52:46] scan: preview 2
[23:52:46] unknown aspect ratio 21
[23:52:46] scan: preview 3
[23:52:46] unknown aspect ratio 21
[23:52:46] scan: preview 4
[23:52:46] unknown aspect ratio 21
[23:52:47] scan: preview 5
[23:52:47] unknown aspect ratio 21
[23:52:47] scan: preview 6
[23:52:47] unknown aspect ratio 21
[23:52:47] scan: preview 7
[23:52:47] unknown aspect ratio 21
[23:52:47] scan: preview 8
[23:52:47] unknown aspect ratio 21
[23:52:47] scan: preview 9
[23:52:47] unknown aspect ratio 21
[23:52:47] scan: preview 10
[23:52:47] unknown aspect ratio 21
[23:52:47] scan: 10 previews, 720x576, 25.000 fps, autocrop = 70/70/2/0, aspect 16:9
[23:52:47] scan: title (0) job->width:720, job->height:304
[23:52:47] thread b087f000 exited ("scan")
[23:52:47] thread b087f000 joined ("scan")
[23:52:47] libhb: scan thread found 1 valid title(s)
Image

Stable 0.9.2
Activity Log:

Code: Select all

[23:54:08] hb_init: checking cpu count
[23:54:08] hb_init: starting libhb thread
[23:54:08] thread b01c9000 started ("libhb")
[23:54:12] macgui: trying to open video_ts folder (parent directory chosen)
[23:54:12] hb_scan: path=/Users/jzietman/Documents/DVD Rip Temp/LES CHORISTES, title_index=0
[23:54:12] thread b08a6000 started ("scan")
[23:54:12] scan: trying to open with libdvdread
[23:54:12] scan: DVD has 1 title(s)
[23:54:12] scan: scanning title 1
[23:54:12] scan: opening IFO for VTS 1
[23:54:12] pgc_id: 1, pgn: 1: pgc: 0xe5f3190
[23:54:12] scan: vts=1, ttn=1, cells=0->15, blocks=0->2569861, 2569862 blocks
[23:54:12] scan: duration is 01:32:34 (5554050 ms)
[23:54:12] scan: checking audio 1
[23:54:12] scan: id=81bd, lang=Francais (AC3), 3cc=fra
[23:54:12] scan: title 1 has 16 chapters
[23:54:12] scan: chap 1 c=0->0, b=0->115951 (115952), 250469 ms
[23:54:12] scan: chap 2 c=1->1, b=115952->269739 (153788), 332757 ms
[23:54:12] scan: chap 3 c=2->2, b=269740->440932 (171193), 369621 ms
[23:54:12] scan: chap 4 c=3->3, b=440933->587980 (147048), 317398 ms
[23:54:12] scan: chap 5 c=4->4, b=587981->696234 (108254), 233458 ms
[23:54:12] scan: chap 6 c=5->5, b=696235->847258 (151024), 326399 ms
[23:54:12] scan: chap 7 c=6->6, b=847259->1014694 (167436), 361491 ms
[23:54:12] scan: chap 8 c=7->7, b=1014695->1208291 (193597), 418860 ms
[23:54:12] scan: chap 9 c=8->8, b=1208292->1426149 (217858), 470581 ms
[23:54:12] scan: chap 10 c=9->9, b=1426150->1557664 (131515), 284579 ms
[23:54:12] scan: chap 11 c=10->10, b=1557665->1723393 (165729), 358628 ms
[23:54:12] scan: chap 12 c=11->11, b=1723394->1962418 (239025), 516746 ms
[23:54:12] scan: chap 13 c=12->12, b=1962419->2136803 (174385), 376549 ms
[23:54:12] scan: chap 14 c=13->13, b=2136804->2394150 (257347), 556824 ms
[23:54:12] scan: chap 15 c=14->14, b=2394151->2480543 (86393), 186282 ms
[23:54:12] scan: chap 16 c=15->15, b=2480544->2569861 (89318), 193400 ms
[23:54:12] scan: aspect = 16
[23:54:12] scan: decoding previews for title 1
[23:54:12] scan: preview 1
[23:54:12] scan: AC3, rate=48000Hz, bitrate=448000
[23:54:12] scan: preview 2
[23:54:12] scan: preview 3
[23:54:12] scan: preview 4
[23:54:12] scan: preview 5
[23:54:12] scan: preview 6
[23:54:12] scan: preview 7
[23:54:12] scan: preview 8
[23:54:12] scan: preview 9
[23:54:12] scan: preview 10
[23:54:12] scan: 720x576, 25.000 fps, autocrop = 70/70/2/0
[23:54:12] scan: title (0) job->width:720, job->height:304
[23:54:12] thread b08a6000 exited ("scan")
[23:54:12] thread b08a6000 joined ("scan")
[23:54:12] libhb: scan thread found 1 valid title(s)
Image

Any thoughts as to what might be going on here? Do you need any more information?

Thanks!
TedJ
Veteran User
Posts: 5388
Joined: Wed Feb 20, 2008 11:25 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by TedJ »

Looks like the PAR is being miscalculated and the job height is way off, although I'm not a developer. There's some major changes going on under the hood with the ffmpeg based decoder at the moment, so things are likely to break unexpectedly. Isn't life on the bleeding edge fun? :)

Oh by the way, this forum is usually reserved for bugs pertaining to public releases, although this has been relaxed to also allow reports on dev snapshots. If building from SVN, your best bet would probably to try the #handbrake IRC channel.
van
Veteran User
Posts: 417
Joined: Wed Aug 29, 2007 6:35 am

Re: [svn1505] dvd's aspect ratio miscalculated

Post by van »

It looks to me like this dvd wasn't mastered correctly. There are two aspect ratios on a dvd, one in the metadata (the VTSI) and one in the sequence header of the mpeg content. The two are supposed to be the same & must be either 4:3 or 16:9. (The mpeg standard also allows aspect ratios of 1:1 and 2.33:1 but they're not legal on a dvd.) On this dvd the VTSI is reporting 16:9 in this line:

Code: Select all

[23:51:11] scan: aspect = 16
but the mpeg content is reporting an aspect of 2.33:1
in this line from r1505:

Code: Select all

scan: 10 previews, 720x576, 25.000 fps, autocrop = 70/70/2/0, aspect 2.33:1, PAR 256:135
and this line from r1477:

Code: Select all

[23:52:46] unknown aspect ratio 21
Prior to r1489/1490 Handbrake "knew" it was dealing with a dvd so it would map whatever aspect the mpeg reported to the closest of 4:3 or 16:9. But the current svn deals with a much wider range of input content and we have no choice but to believe what the content says about its aspect ratio. So some dvd mastering errors that used to be fixed by HB aren't fixed after r1490.

You should still be able to get a viewable conversion by selecting non-anamorphic, turning off "preserve aspect ratio" and manually setting the width & height to something with a 16:9 ratio.
jbrjake
Veteran User
Posts: 4805
Joined: Wed Dec 13, 2006 1:38 am

Re: [svn1505] dvd's aspect ratio miscalculated

Post by jbrjake »

If this happens with a sizable number of discs, maybe it would be best to go back to ignoring the advertised PAR for DVDs...or at least add some sanity checking to disregard it when the display width would be way too large.
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by jzietman »

I'll check some more dvds today, and also see if there's any correlation between this problem and PAL vs NTSC. I don't have a giant collection, though, so I'm not sure how exhaustive my testing will be. I'll report back if I find this issue with any other disks.
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by jzietman »

So far I've been having this issue exclusively with my French PAL dvds. The other offending movies have been:

L'auberge espagnole
Le dîner de cons

My English PAL edition of the Firefly tv series is read just fine.

edit: When I get a chance (in a few hours) I'll try the French dvds using a different dvd drive (I've been using an external Plextor PX-712 UF with latest firmware). Maybe it's a weird drive read error.

edit 2: It's a dvd problem, not a drive one. Macbook pro's internal dvd drive also --> wonky ratio.
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by jzietman »

I've gone through all of my NTSC dvds now, and none others are having this issue. Same goes for UK PAL dvds. There seems to just be something about the French ones that's really weird. What more information could I provide that might help figure this one out?
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by jzietman »

Found another weird one. Using the UK PAL version of the Firefly dvds, ripping the Out of Gas episode on disc three. The left and right sides of the image are cropped without explanation. Source resolution is 720x576, output resolution is 648x574, anamorphic (strict) resolution is 921x574. This is very odd. All other episodes rip with a horizontal resolution around 1021, making for a 16:9 ratio. I'm now using svn1528, and again this issue does not occur with 0.9.2.

Below are images and activity logs for both 0.9.2. and svn1528 with this episode. I'll edit in sample images+logs using another episode from the same disc asap.

svn1528:

Code: Select all

[22:36:44] macgui: Handbrake Version: svn1528 (2008061801)
[22:36:44] hb_init: checking cpu count
[22:36:44] hb_init: starting libhb thread
[22:36:44] thread b01c9000 started ("libhb")
[22:36:47] macgui: trying to open video_ts folder (parent directory chosen)
[22:36:47] hb_scan: path=/Users/jzietman/Documents/DVD Rip Temp/FIREFLY_DISC3, title_index=0
[22:36:47] thread b0866000 started ("scan")
[22:36:47] scan: trying to open with libdvdread
[22:36:47] scan: DVD has 1 title(s)
[22:36:47] scan: scanning title 1
[22:36:47] scan: opening IFO for VTS 1
[22:36:47] pgc_id: 1, pgn: 1: pgc: 0xea6f9d0
[22:36:47] scan: vts=1, ttn=1, cells=0->11, blocks=0->924578, 924579 blocks
[22:36:47] scan: duration is 00:42:12 (2532160 ms)
[22:36:47] scan: checking audio 1
[22:36:47] scan: id=80bd, lang=English (AC3), 3cc=eng
[22:36:47] scan: checking audio 2
[22:36:47] scan: id=81bd, lang=English (AC3), 3cc=eng
[22:36:47] scan: title 1 has 12 chapters
[22:36:47] scan: chap 1 c=0->0, b=0->140067 (140068), 373906 ms
[22:36:47] scan: chap 2 c=1->1, b=140068->161876 (21809), 51130 ms
[22:36:47] scan: chap 3 c=2->2, b=161877->249859 (87983), 222770 ms
[22:36:47] scan: chap 4 c=3->3, b=249860->343693 (93834), 256693 ms
[22:36:47] scan: chap 5 c=4->4, b=343694->452601 (108908), 305739 ms
[22:36:47] scan: chap 6 c=5->5, b=452602->497967 (45366), 132345 ms
[22:36:47] scan: chap 7 c=6->6, b=497968->591317 (93350), 262626 ms
[22:36:47] scan: chap 8 c=7->7, b=591318->671848 (80531), 214712 ms
[22:36:47] scan: chap 9 c=8->8, b=671849->740772 (68924), 176620 ms
[22:36:47] scan: chap 10 c=9->9, b=740773->863428 (122656), 312804 ms
[22:36:47] scan: chap 11 c=10->10, b=863429->919738 (56310), 186442 ms
[22:36:47] scan: chap 12 c=11->11, b=919739->924578 (4840), 36368 ms
[22:36:47] scan: aspect = 16
[22:36:47] scan: decoding previews for title 1
[22:36:47] scan: preview 1
[22:36:47] scan: audio 0x81bd: AC-3, rate=48000Hz, bitrate=192000 English (AC3) (Dolby Surround)
[22:36:47] scan: audio 0x80bd: AC-3, rate=48000Hz, bitrate=192000 English (AC3) (Dolby Surround)
[22:36:47] scan: preview 2
[22:36:47] scan: preview 3
[22:36:47] scan: preview 4
[22:36:47] scan: preview 5
[22:36:47] scan: preview 6
[22:36:47] scan: preview 7
[22:36:47] scan: preview 8
[22:36:47] scan: preview 9
[22:36:47] scan: preview 10
[22:36:47] scan: 10 previews, 720x576, 25.000 fps, autocrop = 0/2/72/0, aspect 16:9, PAR 64:45
[22:36:47] scan: title (0) job->width:656, job->height:416
[22:36:47] thread b0866000 exited ("scan")
[22:36:47] thread b0866000 joined ("scan")
[22:36:47] libhb: scan thread found 1 valid title(s)
Image

0.9.2:

Code: Select all

[22:38:03] hb_init: checking cpu count
[22:38:03] hb_init: starting libhb thread
[22:38:03] thread b01d1000 started ("libhb")
[22:38:07] macgui: trying to open video_ts folder (parent directory chosen)
[22:38:07] hb_scan: path=/Users/jzietman/Documents/DVD Rip Temp/FIREFLY_DISC3, title_index=0
[22:38:07] thread [Censored] started ("scan")
[22:38:07] scan: trying to open with libdvdread
[22:38:07] scan: DVD has 1 title(s)
[22:38:07] scan: scanning title 1
[22:38:07] scan: opening IFO for VTS 1
[22:38:07] pgc_id: 1, pgn: 1: pgc: 0xe5f1980
[22:38:07] scan: vts=1, ttn=1, cells=0->11, blocks=0->924578, 924579 blocks
[22:38:07] scan: duration is 00:42:12 (2532160 ms)
[22:38:07] scan: checking audio 1
[22:38:07] scan: id=80bd, lang=English (AC3), 3cc=eng
[22:38:07] scan: checking audio 2
[22:38:07] scan: id=81bd, lang=English (AC3), 3cc=eng
[22:38:07] scan: title 1 has 12 chapters
[22:38:07] scan: chap 1 c=0->0, b=0->140067 (140068), 373906 ms
[22:38:07] scan: chap 2 c=1->1, b=140068->161876 (21809), 51130 ms
[22:38:07] scan: chap 3 c=2->2, b=161877->249859 (87983), 222770 ms
[22:38:07] scan: chap 4 c=3->3, b=249860->343693 (93834), 256693 ms
[22:38:07] scan: chap 5 c=4->4, b=343694->452601 (108908), 305739 ms
[22:38:07] scan: chap 6 c=5->5, b=452602->497967 (45366), 132345 ms
[22:38:07] scan: chap 7 c=6->6, b=497968->591317 (93350), 262626 ms
[22:38:07] scan: chap 8 c=7->7, b=591318->671848 (80531), 214712 ms
[22:38:07] scan: chap 9 c=8->8, b=671849->740772 (68924), 176620 ms
[22:38:07] scan: chap 10 c=9->9, b=740773->863428 (122656), 312804 ms
[22:38:07] scan: chap 11 c=10->10, b=863429->919738 (56310), 186442 ms
[22:38:07] scan: chap 12 c=11->11, b=919739->924578 (4840), 36368 ms
[22:38:07] scan: aspect = 16
[22:38:07] scan: decoding previews for title 1
[22:38:07] scan: preview 1
[22:38:07] scan: AC3, rate=48000Hz, bitrate=192000
[22:38:07] scan: AC3, rate=48000Hz, bitrate=192000
[22:38:07] scan: preview 2
[22:38:07] scan: preview 3
[22:38:07] scan: preview 4
[22:38:08] scan: preview 5
[22:38:08] scan: preview 6
[22:38:08] scan: preview 7
[22:38:08] scan: preview 8
[22:38:08] scan: preview 9
[22:38:08] scan: preview 10
[22:38:08] scan: 720x576, 25.000 fps, autocrop = 0/0/2/0
[22:38:08] scan: title (0) job->width:720, job->height:400
[22:38:08] thread [Censored] exited ("scan")
[22:38:08] thread [Censored] joined ("scan")
[22:38:08] libhb: scan thread found 1 valid title(s)
Image


Anything enlightening in these logs?
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by jzietman »

Here's another issue. If I switch the anamorphic from strict to loose, I get the following in svn1528:

Code: Select all

[22:42:05] macgui: Handbrake Version: svn1528 (2008061801)
[22:42:05] hb_init: checking cpu count
[22:42:05] hb_init: starting libhb thread
[22:42:05] thread b01c9000 started ("libhb")
[22:42:09] macgui: trying to open video_ts folder (parent directory chosen)
[22:42:09] hb_scan: path=/Users/jzietman/Documents/DVD Rip Temp/FIREFLY_DISC3, title_index=0
[22:42:09] thread b0866000 started ("scan")
[22:42:09] scan: trying to open with libdvdread
[22:42:09] scan: DVD has 1 title(s)
[22:42:09] scan: scanning title 1
[22:42:09] scan: opening IFO for VTS 1
[22:42:10] pgc_id: 1, pgn: 1: pgc: 0x10d036d0
[22:42:10] scan: vts=1, ttn=1, cells=0->11, blocks=0->924578, 924579 blocks
[22:42:10] scan: duration is 00:42:12 (2532160 ms)
[22:42:10] scan: checking audio 1
[22:42:10] scan: id=80bd, lang=English (AC3), 3cc=eng
[22:42:10] scan: checking audio 2
[22:42:10] scan: id=81bd, lang=English (AC3), 3cc=eng
[22:42:10] scan: title 1 has 12 chapters
[22:42:10] scan: chap 1 c=0->0, b=0->140067 (140068), 373906 ms
[22:42:10] scan: chap 2 c=1->1, b=140068->161876 (21809), 51130 ms
[22:42:10] scan: chap 3 c=2->2, b=161877->249859 (87983), 222770 ms
[22:42:10] scan: chap 4 c=3->3, b=249860->343693 (93834), 256693 ms
[22:42:10] scan: chap 5 c=4->4, b=343694->452601 (108908), 305739 ms
[22:42:10] scan: chap 6 c=5->5, b=452602->497967 (45366), 132345 ms
[22:42:10] scan: chap 7 c=6->6, b=497968->591317 (93350), 262626 ms
[22:42:10] scan: chap 8 c=7->7, b=591318->671848 (80531), 214712 ms
[22:42:10] scan: chap 9 c=8->8, b=671849->740772 (68924), 176620 ms
[22:42:10] scan: chap 10 c=9->9, b=740773->863428 (122656), 312804 ms
[22:42:10] scan: chap 11 c=10->10, b=863429->919738 (56310), 186442 ms
[22:42:10] scan: chap 12 c=11->11, b=919739->924578 (4840), 36368 ms
[22:42:10] scan: aspect = 16
[22:42:10] scan: decoding previews for title 1
[22:42:10] scan: preview 1
[22:42:10] scan: audio 0x81bd: AC-3, rate=48000Hz, bitrate=192000 English (AC3) (Dolby Surround)
[22:42:10] scan: audio 0x80bd: AC-3, rate=48000Hz, bitrate=192000 English (AC3) (Dolby Surround)
[22:42:10] scan: preview 2
[22:42:10] scan: preview 3
[22:42:10] scan: preview 4
[22:42:10] scan: preview 5
[22:42:10] scan: preview 6
[22:42:10] scan: preview 7
[22:42:10] scan: preview 8
[22:42:10] scan: preview 9
[22:42:10] scan: preview 10
[22:42:10] scan: 10 previews, 720x576, 25.000 fps, autocrop = 0/2/72/0, aspect 16:9, PAR 64:45
[22:42:10] scan: title (0) job->width:656, job->height:416
[22:42:10] thread b0866000 exited ("scan")
[22:42:10] thread b0866000 joined ("scan")
[22:42:10] libhb: scan thread found 1 valid title(s)
Image

I can't show what happens with loose in 0.9.2 since it didn't exist when that was released.

Also, if, in svn1528, I select no anamorphic and have "keep aspect ratio" selected, then it seems to work ok, giving the following:

Same activity log as above.

Image
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by jzietman »

And I just figured out how to fix this, though what the issue was I'm not sure:

HandBrake is for some reason deciding the crop the image automatically (as seen in the linked screens, it's taking 72 pixels off the left and two off the bottom). Setting crop to custom and setting all values to 0 fixes the issue, and anamorphic strict, loose, and off all work as they should.
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by jzietman »

Looking back over my encodes of the firefly series, one other episode (Our Mrs. Reynolds, from disc 2) had the same issue as above, and a number of others had a very minor version, ending up with anamorphic resolutions of 1021x576 instead of 1024x576 (2 pixels were cropped from either the right or the left in the picture settings window).

Edit: for Our Mrs. Reynolds, the unasked-for cropping was 2 off the top, 50 off the right.
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by jzietman »

I went back to Les Choristes, and again,the issue was this weird cropping, this time 2 off the left and 70 off of both the top and the bottom.

Again, I have only had these issues with PAL dvds, and even then only on an extreme (i.e. really noticeable, more than a 2 pixel crop off the left or right) level for all tested French dvds and two Firefly episodes. However, this issue is present in it's 2 pixel, minor manifestation quite often for the firefly series.

I have now tested with svn 1529, and the same issues are there. What could be going on here?
van
Veteran User
Posts: 417
Joined: Wed Aug 29, 2007 6:35 am

Re: [svn1505] dvd's aspect ratio miscalculated

Post by van »

The incorrect 2 pixel crop off the top was a bug fixed in r1507. I just tried the current svn on my Firefly disk 2 ep.3 & disk 3 ep.1 and the cropping was perfect. The cropping was designed to get rid of matting onto black or dark gray. My guess is that the original content got darkened slightly in the NTSC to PAL conversion and HB mis-detects the dark scene content at the sides as matting & crops it. You could try changing this line in libhb/scan.c:

Code: Select all

#define DARK 64
to

Code: Select all

#define DARK 48
to see if that fixes the cropping problem (try 32 if 48 doesn't work).

If that fixes things I'll try to find a more robust matting detector, maybe by requiring nearly constant luma values and/or also looking at the chroma.
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by jzietman »

Changing that setting to 32 seems to have fixed it for Our Mrs Reynolds, and has reduced the Out of Gas cropping to only 2 pixels off the left.

Firefly disc 1 title 3 (Bushwhacked) still has the 2 pixel crop on the right.

Disc 1 title 4 (dvd menu) is cropped 10 off the left and 8 off the right.

So, problems were kind of fixed, but not entirely.

This testing was done using svn1530.
Cavalicious
Moderator
Posts: 1804
Joined: Mon Mar 26, 2007 12:07 am

Re: [svn1505] dvd's aspect ratio miscalculated

Post by Cavalicious »

You are judging this off an encode (of a chapter, lets say) and not off the Picture Preview window...right?
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by jzietman »

I'm judging off of both in most cases except in my last post, which was just using the picture settings window. So far, whatever the picture viewer has reported has turned out in the encode. I can go back and do some chapter encodes to make sure that the issue sticks between picture setting window and encoded file, though.

edit: changed a bit for clarity's sake
Cavalicious
Moderator
Posts: 1804
Joined: Mon Mar 26, 2007 12:07 am

Re: [svn1505] dvd's aspect ratio miscalculated

Post by Cavalicious »

Yes, your last tests should be based on an encode due to a known issue.
van
Veteran User
Posts: 417
Joined: Wed Aug 29, 2007 6:35 am

Re: [svn1505] dvd's aspect ratio miscalculated

Post by van »

jzietman wrote:Changing that setting to 32 seems to have fixed it for Our Mrs Reynolds, and has reduced the Out of Gas cropping to only 2 pixels off the left.

Firefly disc 1 title 3 (Bushwhacked) still has the 2 pixel crop on the right.

Disc 1 title 4 (dvd menu) is cropped 10 off the left and 8 off the right.

So, problems were kind of fixed, but not entirely.
Yes, the test was just to see if I was looking in the right place for the problem. The patch at http://pastebin.ca/1051538 should do a better job. It correctly crops my regression tests but it shouldn't mis-crop your tests. I suspect it will still crop the left column of "Out of Gas" and the right of "Bushwhacked" - those columns are nearly black in my DVDs & must be darker in yours. It will also crop the d.1 t.4 logo image - that has a gradient going from black to light gray on each side & HB will just crop away the gradient until its average intensity is above the 'darkness' threshold. HB's cropping uses a combination of a linear filters on the individual preview frames to find dark borders & a non-linear temporal filter across frames to discard crops that are local to a particular scene rather than global to the entire title. The temporal filter is what normally keeps gradients from being cropped but since this title consists of a single static image the temporal filter does nothing. I haven't seen a case where there's a problem with real content.
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by jzietman »

With the patch, almost all Firefly episodes are being scanned and encoding correctly now. As you predicted, there is still a bit of issue with darker episodes such as Our Mrs Reynolds (disk 2 ep 3), but nothing I can't handle manually.

The Les Choristes cropping issue is still there, taking 70 pixels off of the top and bottom. When I manually remove the crop, though, I get black bars on top of and below the film. Maybe something was wrong with my DTOX rip. The issue here is more that the film is vertically squashed than cropped. Van may be correct that's it's just a badly mastered dvd, though this still wasn't an issue in 0.9.2...
van
Veteran User
Posts: 417
Joined: Wed Aug 29, 2007 6:35 am

Re: [svn1505] dvd's aspect ratio miscalculated

Post by van »

jzietman wrote:The Les Choristes cropping issue is still there, taking 70 pixels off of the top and bottom. When I manually remove the crop, though, I get black bars on top of and below the film. Maybe something was wrong with my DTOX rip. The issue here is more that the film is vertically squashed than cropped. Van may be correct that's it's just a badly mastered dvd, though this still wasn't an issue in 0.9.2...
The black bars are there because the original film content had a 2.35:1 aspect ratio. Content on a DVD has to be either 4:3 or 16:9 aspect ratio. 2.35:1 is roughly 16:7 so you have to add about 30% to the height to fill it out to 16:9. That's the 70 pixel black bars you see top & bottom. Adding borders to make film fit into the fixed DVD or TV aspect ratio is called matting & HB's cropping is designed to remove this matting & just leave you with the original content. That cropping now seems to be working fine.

What's broken is that, since there are two possible aspect ratios on a DVD, 4:3 & 16:9, the DVD has to tell a player which to use. This is done two places - once in the DVD's metadata & once in the MPEG content stream's metadata. These are supposed to agree. On your DVD the content metadata contains the original film's aspect ratio, not the aspect ratio of the content. This is wrong according to both the DVD & MPEG standards (at least the English versions - maybe they read differently in French). This error used to be invisible to HB because it just looked at the aspect in the DVD metadata & ignored the aspect in the content metadata. Since we now handle a lot more non-DVD content we need to look at the aspect in the content & get messed up when it's wrong. I'm in the process of implementing jbrjake's suggestion of using the container aspect when there is one & it disagrees with the content aspect. That should allow HB to do the right thing with DVDs that have this mastering error.
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by jzietman »

Sounds great, I'm really excited for that addition. Thanks for your help, van.
bitsflew
Posts: 33
Joined: Mon Aug 27, 2007 2:32 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by bitsflew »

On your DVD the content metadata contains the original film's aspect ratio, not the aspect ratio of the content. This is wrong according to both the DVD & MPEG standards (at least the English versions - maybe they read differently in French)
Not sure where the discs were mastered but all my Battlestar Galactica (season 2) discs have the same aspect ratio problem.
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by jzietman »

Are they PAL (region 2) dvds? It would say on the back of the box.
bitsflew
Posts: 33
Joined: Mon Aug 27, 2007 2:32 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by bitsflew »

jzietman wrote:Are they PAL (region 2) dvds? It would say on the back of the box.
Yep PAL region 2
jzietman
Enlightened
Posts: 146
Joined: Mon Feb 04, 2008 3:29 pm

Re: [svn1505] dvd's aspect ratio miscalculated

Post by jzietman »

Could this mastering issue be some standard kind of thing in Europe/Region 2? Anyway, van says he's working on a patch for this, so we just have to be patient until he gets a chance to finish it.
Post Reply