Page 1 of 1

Explanation for why HandBrake rips don't keep aspect ratio in Blender?

Posted: Mon May 13, 2019 5:19 pm
by ZQAfv
Description of problem or question:
If I rip a section of DVD using a "commercial" program like DVDFab and then import that resulting file into Blender, Blender displays the image without distortion (i.e., it displays the stated 720x480 aspect ratio). But if I use HandBrake to rip a section of DVD and then import that resulting file into Blender, Blender stretches the image distorting the image (even though it says it is 720x480).



Steps to reproduce the problem (If Applicable):
1) rip section of DVD in HandBrake with Strict anamorphic setting to mp4 (no cropping)
2) import file into Blender



HandBrake version (e.g., 1.0.0):
0.10.2



Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):
Ubuntu 16.04 LTS


I post this question here because the issue only appears from HandBrake rips and not other applications. Is this a known bug in the 0.10.2 version of HandBrake? Or is there a setting I can use to fix this? I'm am looking for any info and if anyone has experienced this or knows what's going on.

Re: Explanation for why HandBrake rips don't keep aspect ratio in Blender?

Posted: Mon May 13, 2019 5:52 pm
by rollin_eng
Please update to the latest version of HB.

HB is not a ripper, it is a video converter.

Could you please post your HB logs, instructions can be found here:

https://handbrake.fr/docs/en/latest/hel ... y-log.html

Re: Explanation for why HandBrake rips don't keep aspect ratio in Blender?

Posted: Mon May 13, 2019 6:38 pm
by ZQAfv
To update HandBrake, I have to update the entire OS to get a newer repo. I am looking into this. It would be great if I could get confirmation that updating would fix the problem. But if it is a setting or something I would like to implement it now without having to update.

Yes, video converter. I could not think of correct term when writing.

Here is a log. Note I have tried different DVDs but the result is the same. Also note that the Handbrake conversion plays okay in VLC. For example, when appropriate, it shows black bars at top and bottom of video. But when importing into Blender the image is always stretched so there are no black bars on top and bottom. Both the Blender preview pane and the final render show a vertically stretched image:

Code: Select all

[14:17:12] gtkgui: HandBrake 0.10.2 (2016021200) - Linux x86_64 - https://handbrake.fr
[14:17:12] hb_init: starting libhb thread
[14:17:12] hb_init: starting libhb thread
[14:19:37] CPU: Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz
[14:19:37]  - Intel microarchitecture Haswell
[14:19:37]  - logical processor count: 4
[14:19:37] OpenCL: library not available
[14:19:37] hb_scan: path=/dev/sr0, title_index=0
disc.c:350: error opening file BDMV/index.bdmv
disc.c:350: error opening file BDMV/BACKUP/index.bdmv
[14:19:37] bd: not a bd - trying as a stream/file instead
[14:19:37] dvd: Region mask 0xfe
libdvdnav: Using dvdnav version 5.0.3
libdvdnav: DVD Title: 
libdvdnav: DVD Serial Number: 
libdvdnav: DVD Title (Alternative): 
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 1 2 3 4 5 6 7 8

libdvdread: Attempting to retrieve all CSS keys
libdvdread: This can take a _long_ time, please be patient

libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x00000118
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_0.VOB at 0x00000202
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_1.VOB at 0x00003d02
libdvdread: Elapsed time 0
libdvdread: Found 1 VTS's
libdvdread: Elapsed time 0
[14:19:37] scan: DVD has 1 title(s)
[14:19:37] scan: scanning title 1
[14:19:37] scan: opening IFO for VTS 1
[14:19:37] scan: duration is 00:50:16 (3016100 ms)
[14:19:37] pgc_id: 1, pgn: 1: pgc: 0x7f4054024350
[14:19:37] scan: vts=1, ttn=1, cells=0->5, blocks=0->1296621, 1296622 blocks
[14:19:37] scan: checking audio 1
[14:19:37] scan: id=0xa0bd, lang=Unknown (LPCM), 3cc=und ext=0
[14:19:37] scan: title 1 has 6 chapters
[14:19:37] scan: chap 1 c=0->0, b=0->56508 (56509), 128700 ms
[14:19:37] scan: chap 2 c=1->1, b=56509->126053 (69545), 187834 ms
[14:19:37] scan: chap 3 c=2->2, b=126054->334053 (208000), 417500 ms
[14:19:37] scan: chap 4 c=3->3, b=334054->744392 (410339), 934967 ms
[14:19:37] scan: chap 5 c=4->4, b=744393->1106902 (362510), 894367 ms
[14:19:37] scan: chap 6 c=5->5, b=1106903->1296621 (189719), 455734 ms
[14:19:37] scan: aspect = 1.77778
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 1 2 3 4 5 6 7 8
[14:19:41] scan: decoding previews for title 1
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 1 2 3 4 5 6 7 8
[14:19:41] scan: title angle(s) 1
[14:19:42] scan: audio 0xa0bd: LPCM, rate=48000Hz, bitrate=1536000 Unknown (LPCM) (2.0 ch)
[14:19:44] scan: 10 previews, 720x480, 29.970 fps, autocrop = 0/0/74/12, aspect 16:9, PAR 32:27
[14:19:44] libhb: scan thread found 1 valid title(s)
[14:21:00] CPU: Intel(R) Core(TM) i5-4250U CPU @ 1.30GHz
[14:21:00]  - Intel microarchitecture Haswell
[14:21:00]  - logical processor count: 4
[14:21:00] OpenCL: library not available
[14:21:00] hb_scan: path=/dev/sr0, title_index=1
disc.c:350: error opening file BDMV/index.bdmv
disc.c:350: error opening file BDMV/BACKUP/index.bdmv
[14:21:00] bd: not a bd - trying as a stream/file instead
[14:21:00] dvd: Region mask 0xfe
libdvdnav: Using dvdnav version 5.0.3
libdvdnav: DVD Title: 
libdvdnav: DVD Serial Number: 
libdvdnav: DVD Title (Alternative): 
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 1 2 3 4 5 6 7 8

libdvdread: Attempting to retrieve all CSS keys
libdvdread: This can take a _long_ time, please be patient

libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x00000118
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_0.VOB at 0x00000202
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_1.VOB at 0x00003d02
libdvdread: Elapsed time 0
libdvdread: Found 1 VTS's
libdvdread: Elapsed time 0
[14:21:00] scan: DVD has 1 title(s)
[14:21:00] scan: scanning title 1
[14:21:00] scan: opening IFO for VTS 1
[14:21:00] scan: duration is 00:50:16 (3016100 ms)
[14:21:00] pgc_id: 1, pgn: 1: pgc: 0x7f404c011fa0
[14:21:00] scan: vts=1, ttn=1, cells=0->5, blocks=0->1296621, 1296622 blocks
[14:21:00] scan: checking audio 1
[14:21:00] scan: id=0xa0bd, lang=Unknown (LPCM), 3cc=und ext=0
[14:21:00] scan: title 1 has 6 chapters
[14:21:00] scan: chap 1 c=0->0, b=0->56508 (56509), 128700 ms
[14:21:00] scan: chap 2 c=1->1, b=56509->126053 (69545), 187834 ms
[14:21:00] scan: chap 3 c=2->2, b=126054->334053 (208000), 417500 ms
[14:21:00] scan: chap 4 c=3->3, b=334054->744392 (410339), 934967 ms
[14:21:00] scan: chap 5 c=4->4, b=744393->1106902 (362510), 894367 ms
[14:21:00] scan: chap 6 c=5->5, b=1106903->1296621 (189719), 455734 ms
[14:21:00] scan: aspect = 1.77778
[14:21:00] scan: decoding previews for title 1
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 1 2 3 4 5 6 7 8
[14:21:00] scan: title angle(s) 1
[14:21:00] scan: audio 0xa0bd: LPCM, rate=48000Hz, bitrate=1536000 Unknown (LPCM) (2.0 ch)
[14:21:00] scan: 10 previews, 720x480, 29.970 fps, autocrop = 0/0/74/12, aspect 16:9, PAR 32:27
[14:21:00] libhb: scan thread found 1 valid title(s)
[14:21:02] gtkgui: Modified Preset: Devices->iPad
[14:21:02] 1 job(s) to process
[14:21:02] starting job
[14:21:02] yadif thread started for segment 0
[14:21:02] yadif thread started for segment 1
[14:21:02] yadif thread started for segment 2
[14:21:02] yadif thread started for segment 3
[14:21:02] decomb filter thread started for segment 0
[14:21:02] decomb filter thread started for segment 1
[14:21:02] decomb filter thread started for segment 2
[14:21:02] decomb check thread started for segment 2
[14:21:02] decomb check thread started for segment 0
[14:21:02] mask filter thread started for segment 2
[14:21:02] decomb filter thread started for segment 3
[14:21:02] decomb check thread started for segment 3
[14:21:02] mask filter thread started for segment 0
[14:21:02] mask erode thread started for segment 1
[14:21:02] decomb check thread started for segment 1
[14:21:02] mask filter thread started for segment 3
[14:21:02] mask erode thread started for segment 0
[14:21:02] mask filter thread started for segment 1
[14:21:02] mask erode thread started for segment 2
[14:21:02] mask erode thread started for segment 3
[14:21:02] mask dilate thread started for segment 0
[14:21:02] mask dilate thread started for segment 1
[14:21:02] sync: expecting 3857 video frames
[14:21:02] mask dilate thread started for segment 3
[14:21:02] mask dilate thread started for segment 2
[14:21:02] job configuration:
[14:21:02]  * source
[14:21:02]    + /dev/sr0
[14:21:02]    + title 1, chapter(s) 1 to 1
[14:21:02]  * destination
[14:21:02]    + /home/Tom/Videos/chapter-1.mp4
[14:21:02]    + container: MPEG-4 (libavformat)
[14:21:02]  * video track
[14:21:02]    + decoder: mpeg2video
[14:21:02]      + bitrate 200 kbps
[14:21:02]    + filters
[14:21:02]      + Decomb (default settings)
[14:21:02]      + Framerate Shaper (2:27000000:900900)
[14:21:02]        + frame rate: 29.970 fps -> peak rate limited to 29.970 fps
[14:21:02]      + Crop and Scale (720:480:0:0:0:0)
[14:21:02]        + source: 720 * 480, crop (0/0/0/0): 720 * 480, scale: 720 * 480
[14:21:02]    + strict anamorphic
[14:21:02]      + storage dimensions: 720 * 480, mod 2
[14:21:02]      + pixel aspect ratio: 32 / 27
[14:21:02]      + display dimensions: 853 * 480
[14:21:02]    + encoder: H.264 (libx264)
[14:21:02]      + preset:  veryslow
[14:21:02]      + profile: high
[14:21:02]      + level:   3.1
[14:21:02]      + quality: 20.00 (RF)
[14:21:02]  * audio track 1
[14:21:02]    + decoder: Unknown (LPCM) (2.0 ch) (track 1, id 0xa0bd)
[14:21:02]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[14:21:02]    + mixdown: Stereo
[14:21:02]    + encoder: AAC (libavcodec)
[14:21:02]      + bitrate: 64 kbps, samplerate: 48000 Hz
[14:21:02] dvd: Region mask 0xfe
libdvdnav: Using dvdnav version 5.0.3
libdvdnav: DVD Title: 
libdvdnav: DVD Serial Number: 
libdvdnav: DVD Title (Alternative): 
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 1 2 3 4 5 6 7 8

libdvdread: Attempting to retrieve all CSS keys
libdvdread: This can take a _long_ time, please be patient

libdvdread: Get key for /VIDEO_TS/VIDEO_TS.VOB at 0x00000118
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_0.VOB at 0x00000202
libdvdread: Elapsed time 0
libdvdread: Get key for /VIDEO_TS/VTS_01_1.VOB at 0x00003d02
libdvdread: Elapsed time 0
libdvdread: Found 1 VTS's
libdvdread: Elapsed time 0
libdvdnav: DVD disk reports itself with Region mask 0x00000000. Regions: 1 2 3 4 5 6 7 8
[14:21:02] encx264: min-keyint: 30, keyint: 300
[14:21:02] encx264: encoding at constant RF 20.000000
[14:21:02] encx264: unparsed options: level=3.1:ref=13:bframes=8:b-adapt=2:direct=auto:analyse=all:me=umh:merange=24:subme=10:trellis=2:vbv-bufsize=17500:vbv-maxrate=17500:rc-lookahead=60
[14:21:02] reader: first SCR 146 id 0xe0 DTS 18018
[14:21:02] mpeg2video: "Chapter 1" (1) at frame 0 time 3003
x264 [info]: using SAR=32/27
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 AVX2 LZCNT BMI2
x264 [info]: profile High, level 3.1
[14:21:02] sync: first pts is 3003
[14:23:34] reader: end of chapter 1 (media 1) reached at media chapter 2
[14:23:34] reader: done. 1 scr changes
[14:23:38] work: average encoding speed for job is 25.177492 fps
[14:23:38] sync: got 3861 frames, 3857 expected
[14:23:39] decomb: deinterlaced 724 | blended 177 | unfiltered 2959 | total 3860
[14:23:39] render: 3860 frames output, 0 dropped and 0 duped for CFR/PFR
[14:23:39] render: lost time: 0 (0 frames)
[14:23:39] render: gained time: 0 (0 frames) (0 not accounted for)
[14:23:39] mpeg2video-decoder done: 3861 frames, 0 decoder errors, 0 drops
x264 [info]: frame I:14    Avg QP:10.71  size: 24881
x264 [info]: frame P:656   Avg QP:19.05  size:  7992
x264 [info]: frame B:3190  Avg QP:26.60  size:  1508
x264 [info]: consecutive B-frames:  1.2%  0.9%  3.7% 14.0%  9.3% 18.5%  5.3%  1.9% 45.2%
x264 [info]: mb I  I16..4: 50.1% 27.2% 22.7%
x264 [info]: mb P  I16..4:  1.6%  2.1%  0.3%  P16..4: 21.9%  7.2%  6.7%  0.5%  0.2%    skip:59.5%
x264 [info]: mb B  I16..4:  0.1%  0.2%  0.0%  B16..8: 16.9%  3.4%  0.9%  direct: 3.3%  skip:75.3%  L0:61.9% L1:30.7% BI: 7.4%
x264 [info]: 8x8 transform intra:49.8% inter:36.6%
x264 [info]: direct mvs  spatial:99.3% temporal:0.7%
x264 [info]: coded y,uvDC,uvAC intra: 31.9% 15.7% 5.6% inter: 7.0% 1.8% 0.1%
x264 [info]: i16 v,h,dc,p: 59% 23% 12%  5%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 14%  6% 43%  6%  7%  8%  5%  6%  6%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 13% 11%  6%  9% 10%  7%  7%  8%
x264 [info]: i8c dc,h,v,p: 76% 13%  8%  3%
x264 [info]: Weighted P-Frames: Y:6.7% UV:1.7%
x264 [info]: ref P L0: 32.9%  5.9% 19.9% 15.2%  6.8%  5.3%  3.3%  2.9%  1.3%  1.9%  1.3%  1.8%  1.4%  0.1%  0.0%
x264 [info]: ref B L0: 39.4% 19.3% 11.2%  7.4%  8.6%  5.9%  4.5%  1.1%  0.9%  0.8%  0.5%  0.3%
x264 [info]: ref B L1: 84.5% 15.5%
x264 [info]: kb/s:646.08
[aac @ 0x7f40389e61e0] 1 frames left in the queue on closing
[14:23:39] mux: track 0, 3860 frames, 10400872 bytes, 646.04 kbps, fifo 4096
[14:23:39] mux: track 1, 6039 frames, 401008 bytes, 24.91 kbps, fifo 8192
[14:23:39] libhb: work result = 0

Re: Explanation for why HandBrake rips don't keep aspect ratio in Blender?

Posted: Mon May 13, 2019 6:40 pm
by s55
Does Blender actually support Anamorphic? Your desciption makes it sound like it doesn't.

Re: Explanation for why HandBrake rips don't keep aspect ratio in Blender?

Posted: Mon May 13, 2019 7:12 pm
by ZQAfv
If I use a different file conversion program, then there are no issues in Blender. This is the reason that I have come here with this question because the "stretching" only occurs in Blender when I am using a file I created using HandBrake.

Re: Explanation for why HandBrake rips don't keep aspect ratio in Blender?

Posted: Mon May 13, 2019 9:05 pm
by s55
Is the other program setup to output anamorphic content?

Re: Explanation for why HandBrake rips don't keep aspect ratio in Blender?

Posted: Mon May 13, 2019 9:10 pm
by ZQAfv
s55 wrote:
Mon May 13, 2019 9:05 pm
Is the other program setup to output anamorphic content?
Yes, of course. Other programs produce anamorphic 720x480 in VLC and in Blender. HandBrake created content plays anamorphic 720x480 in VLC but not in Blender. My first though was that something was wrong with Blender and I have researched a lot. But the only content that gives this problem in Blender is HandBrake content. That's why I ask here if there is any knowledge or experience with this problem so I can try to understand and fix it.

Re: Explanation for why HandBrake rips don't keep aspect ratio in Blender?

Posted: Mon May 13, 2019 10:59 pm
by ZQAfv
FYI: I updated to HandBrake 1.1.2 and the same issue exists. Files created in HandBrake produce vertically stretched images when previewed/rendered in Blender.

Re: Explanation for why HandBrake rips don't keep aspect ratio in Blender?

Posted: Mon May 13, 2019 11:00 pm
by ZQAfv
I noticed in v1.1.2 that the "Strict" anamorphic is no longer an option. I used Automatic. What is the equivalent "strict" setting in v1.1.2?

Re: Explanation for why HandBrake rips don't keep aspect ratio in Blender?

Posted: Mon May 13, 2019 11:10 pm
by mduell
1.2.2 is the current release.

Re: Explanation for why HandBrake rips don't keep aspect ratio in Blender?

Posted: Tue May 14, 2019 4:07 am
by BradleyS
Automatic is basically strict with some improvements.