News:

--

Main Menu

How to lossless cut if uncommon/ unknown AR?

Started by guju, March 30, 2025, 08:22:17 PM

Previous topic - Next topic

guju

Lossless cutting does fine in ADM if AR is one of the common values.
But from time to time there is a movie that has a uncommon/ unknown entry.
For example:

=====================================================
Codec 4CC:         H264
Image Size:         766 x 1080
Aspect Ratio:         Unknown (3556:3559)
Frame Rate:         30.000 fps
Average Bitrate:      1189 kbps
Total Duration:         00:05:07.134
Pixel format:         YUV 4:2:0, 8-bit
Color range:         Limited (MPEG)
Color primaries:      BT.709
Transfer characteristics:   BT.709
Color space:         BT.709

=====================================================

If I save it as is, with the same container type (mp4) it shows slightly squeezed.
Still there is no way to "force aspect ratio" of that uncommon kind.

How to handle that?

eumagga0x2a

Quote from: guju on March 30, 2025, 08:22:17 PMIf I save it as is, with the same container type (mp4) it shows slightly squeezed.

With width of merely 766 pixels, pixel aspect ratio of 3556:3559 instead of 1:1 would make less than 1 pixel difference on screen. I doubt that this is noticeable with a naked eye. Much more likely, this pixel aspect ratio is incorrect. Please attach the textual output of MediaInfo for that file to your reply.

While you cannot specify a custom aspect ratio as a rational, you can let Avidemux derive it by specifying display width in pixels in the configuration of the MP4 muxer.

guju

#2
Hi :) and thanks for the quick response.

If I save without "forcing aspect ratio", it shows 1 pixel wider (height not changed);
picture width is 766;
and well... A/B comparison lets it be noticeable to my eye :).

If I choose explicitely 765 (!) for display width, then visually identical.
Although the produced width is 766 then (???).

You asked for MediaInfos's output (the output above was from ADM itself):

General
Complete name              : movie.mp4
Format                      : MPEG-4
Format profile              : Base Media
Codec ID                    : isom (isom/iso2/avc1/mp41)
File size                  : 51.3 MiB
Duration                    : 5 min 7 s
Overall bit rate            : 1 402 kb/s
Writing application        : Lavf60.16.100

Video
ID                          : 1
Format                      : AVC
Format/Info                : Advanced Video Codec
Format profile              : High@L3.1
Format settings            : CABAC / 4 Ref Frames
Format settings, CABAC      : Yes
Format settings, Reference  : 4 frames
Format settings, GOP        : M=4, N=90
Codec ID                    : avc1
Codec ID/Info              : Advanced Video Coding
Duration                    : 5 min 7 s
Source duration            : 5 min 7 s
Bit rate                    : 1 189 kb/s
Width                      : 766 pixels
Height                      : 1 080 pixels
Display aspect ratio        : 0.709
Frame rate mode            : Variable
Frame rate                  : 30.000 FPS
Minimum frame rate          : 29.421 FPS
Maximum frame rate          : 30.000 FPS
Color space                : YUV
Chroma subsampling          : 4:2:0
Bit depth                  : 8 bits
Scan type                  : Progressive
Bits/(Pixel*Frame)          : 0.048
Stream size                : 43.5 MiB (85%)
Source stream size          : 43.5 MiB (85%)
Writing library            : x264 core 159
Encoding settings          : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.00:0.00 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-2 / threads=12 / lookahead_threads=2 / sliced_threads=0 / nr=0 / decimate=1 / interlaced=0 / bluray_compat=0 / constrained_intra=0 / bframes=3 / b_pyramid=2 / b_adapt=1 / b_bias=0 / direct=1 / weightb=1 / open_gop=0 / weightp=2 / keyint=90 / keyint_min=46 / scenecut=0 / intra_refresh=0 / rc_lookahead=40 / rc=crf / mbtree=1 / crf=23.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=4000 / vbv_bufsize=133 / crf_max=27.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Codec configuration box    : avcC

Audio
ID                          : 2
Format                      : AAC LC
Format/Info                : Advanced Audio Codec Low Complexity
Codec ID                    : mp4a-40-2
Duration                    : 5 min 7 s
Bit rate mode              : Constant
Bit rate                    : 204 kb/s
Channel(s)                  : 2 channels
Channel layout              : L R
Sampling rate              : 44.1 kHz
Frame rate                  : 43.066 FPS (1024 SPF)
Compression mode            : Lossy
Stream size                : 7.48 MiB (15%)
Default                    : Yes
Alternate group            : 1

----------

Strange all this, isn't it?