News:

--

Main Menu

x265 - can't set PAR

Started by andrewk8, June 16, 2018, 10:00:40 PM

Previous topic - Next topic

andrewk8

Using Windows 2.7.1.  Source has the wrong aspect ratio.  I used MyMP4Box to change the aspect ratio, so that the source plays correctly in VLC.

Transcoding the modified source with ADM x265.  In the x265 Configuration, on the Output 1 tab, "As Input" option is greyed out.  I set the Custom PAR to the same values I used in MyMP4Box.

Resulting video had the wrong aspect ratio - distorted - looks the same as the original original (before repairing with MyMP4Box).  Looks like square pixels.

Poking around in ADM, the video properties report "Aspect Ratio: Unknown (107:90)".

So ADM can read the aspect ratio in the source file, but won't automagically pass it to the x265 configuration settings and the x265 configuration settings aren't being applied to the video.

eumagga0x2a

Have you played with specifying display aspect ratio in the muxer (both Mkv and Mp4 muxers in 2.7.1 support setting DAR) instead of doing it in the codec configuration?

andrewk8

Quote from: eumagga0x2a on June 16, 2018, 10:42:31 PM
Have you played with specifying display aspect ratio in the muxer (both Mkv and Mp4 muxers in 2.7.1 support setting DAR) instead of doing it in the codec configuration?
MP4 output configuration I haven't tried ... it only supports 4 preset aspect ratios.  Assuming it works, it only applies to the limited cases where everyone follows the assumed rules making source files. I need a custom (107:90) to fix someone else's mistake.

MKV output configuration can force the desired display width.

Can we agree MKV output configuration is only a work-around, not a solution?

eumagga0x2a

Please post the output of ffprobe for the video stream of the source.

If someone cropped the video resulting in non-standard dimensions and if you are going to reencode it anyway, the best solution would be to add borders. One of the pre-defined DAR values will match then.

andrewk8

Quote from: eumagga0x2a on June 17, 2018, 02:26:00 PM
Please post the output of ffprobe for the video stream of the source.
Where is ffprobe?  I don't see it in the ADM menus or an .exe in the program folder.
ADM source properties reports:

Codec 4CC: H264
Image Size: 640 x 428
Aspect Ratio: Unknown (107:90)
Frame Rate: 30.000 fps
Total Duration: 00:10:51.234

MediaInfo:
Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3.2
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 4 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 10 min 51 s
Bit rate                                 : 484 kb/s
Maximum bit rate                         : 740 kb/s
Width                                    : 640 pixels
Height                                   : 428 pixels
Display aspect ratio                     : 16:9
Frame rate mode                          : Constant
Frame rate                               : 30.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.059
Stream size                              : 37.5 MiB (79%)
Writing library                          : x264 core 148 r2638 7599210
Encoding settings                        : cabac=1 / ref=4 / deblock=1:0:0 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=13 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=8 / b_pyramid=2 / b_adapt=2 / b_bias=0 / direct=3 / weightb=1 / open_gop=0 / weightp=0 / keyint=90 / keyint_min=9 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=24.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=2000 / vbv_bufsize=12000 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00


l'll post ffprobe if you can tell me where to find it on Windows.

eumagga0x2a

MediaInfo is good enough, thanks. ffprobe is part of FFmpeg.

andrewk8

Quote from: eumagga0x2a on June 17, 2018, 02:26:00 PM
If someone cropped the video resulting in non-standard dimensions and if you are going to reencode it anyway, the best solution would be to add borders. One of the pre-defined DAR values will match then.
No, I don't want to add padding.

  • How annoying is it to watch a 16:9 source on a widescreen TV, but the source was padded to fit a 4:3 program.  There's padding on all 4 sides.  It's why TV manufacturers include the "Zoom" display mode.  Any way you try to view it looks like garbage.
  • I'm transcoding for archive.  I don't want to encode the extra bits.
  • The ability to set a custom output ratio for x.265 is available, but not working. - a bug.
FYI, I transcoded the 'corrected' source (107:90 PAR / 16:9 DAR) with Handbrake 1.1.0 x.265.   The HEVC/MP4 output preserved the source PAR/DAR.  HB doesn't have the filters I want to apply to the archive.  Really just proof that the desired outcome is feasible.