Custom settings on Display tab

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
Dibrom
Posts: 23
Joined: Tue Jul 20, 2021 3:35 am

Custom settings on Display tab

Post by Dibrom »

Just upgraded from v1.2.2 to v1.4.0

In v1.2.2 you could happily insert custom resolution, pixel AR, storage, cropping numbers as you saw fit and the program would accept them. Now in v1.4.0 I am fighting with the program when despite having everything set in full custom settings, it constantly changes other entry box numbers in conjunction with other ones I do change manually.

I am trying to encode a video with storage size 640x348, but displayed for aspect ration reasons as 636x347 equating to pixel aspect ration 294:295.

Those are the numbers I want to enter in Handbrake, but it just won't let me.

Resolution is set to Custom
Anamorphic is set to custom
Optimal & Upscaling are unchecked

I can enter the storage size I want. I can also enter the pixel AR I want, but when it comes to entering the storage size, whichever box I fill first with either 636 (horizontal) or 347 (vertical), the program automatically changes the other one to 32. It is annoying as all hell. It doesn't help that the balloon tip says "Custom allows manual setting of all parameters" - NO IT DOESN'T!

Anyone know why the program is [Censored] me off like this? FWIW version 1.2.2 does actually allow manual setting of all parameters. Why has this been broken in 1.4.0?

Image

I have no log file to provide because this is just trying to set it up to encode properly. No encode has actually been done.
rollin_eng
Veteran User
Posts: 4840
Joined: Wed May 04, 2011 11:06 pm

Re: Custom settings on Display tab

Post by rollin_eng »

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

https://handbrake.fr/docs/en/latest/hel ... y-log.html
User avatar
Ritsuka
HandBrake Team
Posts: 1650
Joined: Fri Jan 12, 2007 11:29 am

Re: Custom settings on Display tab

Post by Ritsuka »

Set anamorphic to automatic, disable "optimal size", and uncheck the automatic checkbox after the display size fields.
Then set the sizes.
But that's not how anamorphic works, anamorphic resizes either the width or the height, you can't get it to resize both the width and the height, it makes no sense.
Dibrom
Posts: 23
Joined: Tue Jul 20, 2021 3:35 am

Re: Custom settings on Display tab

Post by Dibrom »

Thank you, that finally worked. It seems all the settings have been rejigged massively since 1.2.2. The logic of setting the frame sizes appears to have changed a lot and doesn't carry over. It's almost like you have to learn it all new again when upgrading from 1.2.2 to ~v1.3/1.4 generation.

Next question: Why does Handbrake refuse to mux MP2 audio streams to MP4 video? When you have a source with a perfectly valid MP2 audio stream and you set the audio handling to MP2 passthrough, why does Handbrake refuse to mux it? This happens repeatedly, is easily reproducible on multiple sources and yields no error messages whatsoever. All that happens is you end up with an encoded video stream with no audio. You then have to mux it with the MP2 manually using something like XMedia Recode or MP4Box etc. to get the end result you want. Why won't Handbrake just handle this seemlessly like XMedia Recode does?

There is one exception. If the MP2 audio stream identifies as MP3 instead of MP2, then Handbrake will passthrough correctly and mux it normally, even though the actual audio stream is MP2 (though with an MP3 header for ID). It seems Handbrake is happy to mux it if the stream has an incorrect header, but refuses to if it is proper MP2 with an MP2 header. Is this a deliberate compatibility thing where Handbrake refuses to create a standards incompatible MP4 file with an MP2 audio stream even though such a file will play perfectly well in every player known to mankind?
Dibrom
Posts: 23
Joined: Tue Jul 20, 2021 3:35 am

Re: Custom settings on Display tab

Post by Dibrom »

I don't actually know if MP4 with MP2 audio is strictly speaking non-standard, but I can say that here in Australia, the FTA broadcast TV Networks routinely broadcast OTA transmissions in MP4/H264 video + MP2 audio as their standard, so there is no shortage of source material in this format to pick from. MP4+MP2 is in fact the standard 2-channel audio stream type broadcast in Australia. There are also AC-3 broadcasts, but limited to only HD channels. It would be good if there was a "relaxed standards" option in Handbrake to handle MP2 audio streams correctly for muxing, like other encoders do.
User avatar
Ritsuka
HandBrake Team
Posts: 1650
Joined: Fri Jan 12, 2007 11:29 am

Re: Custom settings on Display tab

Post by Ritsuka »

MP2 and MP3 in MP4 will not play perfectly well in every player known to mankind, for example it won't playback in any Apple player and probably in any browser.
Anyway, there is no plan to enable MP2 in MP4.
Dibrom
Posts: 23
Joined: Tue Jul 20, 2021 3:35 am

Re: Custom settings on Display tab

Post by Dibrom »

Ritsuka wrote: Mon Aug 23, 2021 7:16 am MP2 and MP3 in MP4 will not play perfectly well in every player known to mankind, for example it won't playback in any Apple player and probably in any browser.
Anyway, there is no plan to enable MP2 in MP4.
That's a shame because XMedia Recode allows it, so does My MP4Box and Avidemux, which kinda makes Handbrake stand out as the one recalcitrant encoder that won't handle it. Apple TV boxes do absolutely play MP4/MP2 because I have one and it can receive and play through it every FTA broadcast channel in Australia, all of which broadcast at least one channel in MP4/MP2 (though with an MP3 header).

All my set top boxes (which are ancient - only kept for convenience sake to plug USB sticks into) accept and play MP4/MP2 without complaint, as do all the TVs and Chrome and Firefox on iPad in iOS also play MP4/MP2 because I recently encoded a captured video from TV recorded 7 years ago of a family member being interviewed at a model railway exhibition, which was broadcast on local TV in… you guessed it, MP4/MP2. I had to remux it with the original MP2 audio stream after encoding the video with Handbrake because I didn't have any need to re-encode the original audio stream.

If you think about it, it makes perfect sense that any hardware would play MP4/MP2 because MP2 was the standard audio for the previous generation MPEG-1/2 video format of VCD/SVCD/DVD, so to maintain any sort of backwards compatibility, hardware would retain MP2 decoding ability. Whether that's contained within an MP4 or not is irrelevent. Hardware just sees whatever audio stream is there and uses the decoder for it. MP2 is definitely always going to be there.

I don't see what would be so wrong with adding a simple non-default switch to enable MP2 audio muxing under a 'relaxed standards' option that could be checked by any user who knows what they're doing, in much the same way as you've added the "Allow Upscaling" checkbox.
Deleted User 11865

Re: Custom settings on Display tab

Post by Deleted User 11865 »

Can you provide a sample of an MP4 file with MP2 audio that plays on your AppleTV?
Dibrom
Posts: 23
Joined: Tue Jul 20, 2021 3:35 am

Re: Custom settings on Display tab

Post by Dibrom »

Sure: https://www.dropbox.com/s/gazgvz46fpjrr ... v-2015.mp4

Code: Select all

General
Complete name                            : D:\Documents\Dean\Dropbox\Public\WAMRC TT Segment 13-Nov-2015.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom)
File size                                : 80.2 MiB
Duration                                 : 3 min 27 s
Overall bit rate                         : 3 248 kb/s
Encoded date                             : UTC 2021-08-07 03:55:35
Tagged date                              : UTC 2021-08-07 03:55:35
Writing application                      : My MP4Box GUI 0.6.0.6 <http://my-mp4box-gui.zymichost.com>

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L4.2
Format settings                          : CABAC / 16 Ref Frames
Format settings, CABAC                   : Yes
Format settings, Reference frames        : 16 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 3 min 27 s
Source duration                          : 3 min 27 s
Bit rate                                 : 2 990 kb/s
Maximum bit rate                         : 6 492 kb/s
Width                                    : 720 pixels
Height                                   : 562 pixels
Display aspect ratio                     : 1.85:1
Frame rate mode                          : Variable
Frame rate                               : 24.602 FPS
Minimum frame rate                       : 14.286 FPS
Maximum frame rate                       : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.300
Stream size                              : 73.8 MiB (92%)
Source stream size                       : 73.8 MiB (92%)
Title                                    : WAMRC TT Segment 13-Nov-2015.mp4
Writing library                          : x264 core 163 r3059 b684ebe0
Encoding settings                        : cabac=1 / ref=16 / deblock=1:-1:-1 / analyse=0x3:0x133 / me=umh / subme=10 / psy=1 / psy_rd=1.00:0.15 / mixed_ref=1 / me_range=24 / chroma_me=1 / trellis=2 / 8x8dct=1 / cqm=0 / deadzone=21,11 / fast_pskip=1 / chroma_qp_offset=-3 / threads=6 / lookahead_threads=1 / 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=2 / keyint=250 / keyint_min=25 / scenecut=40 / intra_refresh=0 / rc_lookahead=60 / rc=crf / mbtree=1 / crf=17.0 / qcomp=0.60 / qpmin=0 / qpmax=69 / qpstep=4 / vbv_maxrate=62500 / vbv_bufsize=78125 / crf_max=0.0 / nal_hrd=none / filler=0 / ip_ratio=1.40 / aq=1:1.00
Encoded date                             : UTC 2021-08-07 03:31:51
Tagged date                              : UTC 2021-08-07 03:55:37
Color range                              : Limited
Color primaries                          : BT.601 PAL
Transfer characteristics                 : BT.709
Matrix coefficients                      : BT.601
Codec configuration box                  : avcC

Audio
ID                                       : 2
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 2
Format settings                          : Joint stereo / Intensity Stereo + MS Stereo
Codec ID                                 : .mp3
Duration                                 : 3 min 27 s
Bit rate mode                            : Constant
Bit rate                                 : 256 kb/s
Maximum bit rate                         : 264 kb/s
Channel(s)                               : 2 channels
Sampling rate                            : 48.0 kHz
Compression mode                         : Lossy
Stream size                              : 6.32 MiB (8%)
Title                                    : WAMRC TT Segment 13-Nov-2015.mp2
Encoded date                             : UTC 2021-08-07 03:55:36
Tagged date                              : UTC 2021-08-07 03:55:37
User avatar
Ritsuka
HandBrake Team
Posts: 1650
Joined: Fri Jan 12, 2007 11:29 am

Re: Custom settings on Display tab

Post by Ritsuka »

Sure that works, but it stores mp3 audio in a weird way, probably the way MOV did, HandBrake does something different.
I see no specifications on how to store mp3 like that on http://mp4ra.org/#/codecs
Dibrom
Posts: 23
Joined: Tue Jul 20, 2021 3:35 am

Re: Custom settings on Display tab

Post by Dibrom »

Just for completeness,here's the raw captured broadcast video from the TV which back then in 2015 was MPEG-2/MP2 standard definition source.
https://www.dropbox.com/s/v8b57tvz3ymo0 ... v-2015.mpg
Post Reply