Opus downsampling doesn't work

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
deikun
Posts: 4
Joined: Sat Aug 04, 2018 11:06 pm

Opus downsampling doesn't work

Post by deikun »

Description of problem or question:
Hi.
Opus downsampling doesn't work: pcm source is 48 kHz; I would like an output opus file at 44.1 kHz.
Many thanks.


Steps to reproduce the problem (If Applicable):

https://imgur.com/rnvWgRV


HandBrake version (e.g., 1.0.0):

HandBrake Nightly 20210214151010-0edac3da8-master (2021021401)



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

Windows 10 Enterprise v1909 64 bit.


HandBrake Activity Log ***required*** (see How-to get an activity log)

Code: Select all

HandBrake Nightly 20210214151010-0edac3da8-master (2021021401)
OS: Microsoft Windows NT 10.0.18363.0
CPU: Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz
Ram: 16043 MB, 
GPU Information:
  Intel(R) UHD Graphics 630 - 27.20.100.8853
Screen: 1680x1050

< CUT >

-------------------------------------------


# Starting Encode ...
[21:21:56] base preset: Fast 1080p30 (Modified)
[21:21:56] hb_init: starting libhb thread
[21:21:56] Starting work at: Sat Feb 20 21:21:56 2021
[21:21:56] 1 job(s) to process
[21:21:56] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 128,
        "DRC": 0,
        "Encoder": "opus",
        "Gain": 0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 44100,
        "Track": 0,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      "copy:aac",
      "copy:ac3",
      "copy:dtshd",
      "copy:dts",
      "copy:eac3",
      "copy:flac",
      "copy:mp3",
      "copy:truehd",
      "copy:mp2"
    ],
    "FallbackEncoder": "ac3"
  },
  "Destination": {
    "ChapterList": [],
    "ChapterMarkers": false,
    "AlignAVStart": false,
    "File": "C:\\Users\\deikun\\Videos\\test.mkv",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": false
    },
    "Mux": "av_mkv"
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 4,
        "Settings": {
          "mode": "7"
        }
      },
      {
        "ID": 3,
        "Settings": {
          "block-height": "16",
          "block-thresh": "40",
          "block-width": "16",
          "filter-mode": "2",
          "mode": "3",
          "motion-thresh": "1",
          "spatial-metric": "2",
          "spatial-thresh": "1"
        }
      },
      {
        "ID": 12,
        "Settings": {
          "crop-bottom": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "720",
          "width": "1280"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "1"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "C:\\Users\\deikun\\Videos\\test.mov"
  },
  "Subtitle": {
    "Search": {
      "Burn": false,
      "Default": false,
      "Enable": true,
      "Forced": false
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": "x264",
    "Level": "4.0",
    "Bitrate": 950,
    "TwoPass": true,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "veryslow",
    "Profile": "high",
    "QSV": {
      "Decode": false
    }
  }
}
[21:21:56] CPU: Intel(R) Core(TM) i5-8500 CPU @ 3.00GHz
[21:21:56]  - Intel microarchitecture Kaby Lake
[21:21:56]  - logical processor count: 6
[21:21:56] Intel Quick Sync Video support: yes, gpu list: 0
[21:21:56]  - Intel Media SDK hardware: API 1.33 (minimum: 1.3)
[21:21:56]  - H.264 encoder: yes
[21:21:56]     - preferred implementation: hardware (any) via D3D11
[21:21:56]     - capabilities (hardware):  breftype icq+la+i+downs vsinfo opt1 opt2+mbbrc+extbrc+trellis+ib_adapt+nmpslice
[21:21:56]  - H.265 encoder: yes (8bit: yes, 10bit: yes)
[21:21:56]     - preferred implementation: hardware (any) via D3D11
[21:21:56]     - capabilities (hardware):  bpyramid icq vsinfo opt1
[21:21:56] hb_scan: path=C:\Users\deikun\Videos\test.mov, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:323: failed opening UDF image C:\Users\deikun\Videos\test.mov
src/libbluray/disc/disc.c:424: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:424: error opening file BDMV\BACKUP\index.bdmv
src/libbluray/bluray.c:2585: nav_get_title_list(C:\Users\deikun\Videos\test.mov\) failed
[21:21:56] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.1
libdvdread: Encrypted DVD support unavailable.
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdread:DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.BUP failed
libdvdread: Can't open file VIDEO_TS.IFO.
libdvdnav: vm: failed to read VIDEO_TS.IFO
[21:21:56] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\deikun\Videos\test.mov':
  Metadata:
    major_brand     : isom
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2016-04-19T09:49:14.000000Z
  Duration: 00:00:42.60, start: 0.000000, bitrate: 6592 kb/s
    Stream #0:0(eng): Video: h264 (High) (avc1 / 0x31637661), yuvj420p(pc, bt709), 1280x720, 5053 kb/s, 25 fps, 25 tbr, 90k tbn, 180k tbc (default)
    Metadata:
      creation_time   : 2016-04-19T09:49:14.000000Z
    Stream #0:1(eng): Audio: pcm_s16le (sowt / 0x74776F73), 48000 Hz, 2 channels, s16, 1536 kb/s (default)
    Metadata:
      creation_time   : 2016-04-19T09:49:14.000000Z
[21:21:56] scan: decoding previews for title 1
[21:21:56] scan: audio 0x1: pcm_s16le, rate=48000Hz, bitrate=1536000 English (pcm_s16le) (2.0 ch) (1536 kbps)
[21:21:56] scan: 10 previews, 1280x720, 25.000 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1, color profile: 1-1-1
[21:21:56] scan: supported video decoders: avcodec qsv
[21:21:56] libhb: scan thread found 1 valid title(s)
[21:21:56] Skipping subtitle scan.  No suitable subtitle tracks.
[21:21:56] Starting Task: Analysis Pass
[21:21:56] Skipping crop/scale filter
[21:21:56] work: sanitizing track 1 unsupported samplerate 44100 Hz to 48 kHz
[21:21:56] work: compression level not specified, track 1 setting compression level 10.00
[21:21:56] work: track 1, dithering not supported by codec
[21:21:56] job configuration:
[21:21:56]  * source
[21:21:56]    + C:\Users\deikun\Videos\test.mov
[21:21:56]    + title 1, chapter(s) 1 to 1
[21:21:56]    + container: mov,mp4,m4a,3gp,3g2,mj2
[21:21:56]    + data rate: 6592 kbps
[21:21:56]  * destination
[21:21:56]    + C:\Users\deikun\Videos\test.mkv
[21:21:56]    + container: Matroska (libavformat)
[21:21:56]  * video track
[21:21:56]    + decoder: h264 8-bit
[21:21:56]      + bitrate 5053 kbps
[21:21:56]    + filters
[21:21:56]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[21:21:56]      + Decomb (mode=39)
[21:21:56]      + Framerate Shaper (mode=1)
[21:21:56]        + frame rate: 25.000 fps -> constant 25.000 fps
[21:21:56]    + Output geometry
[21:21:56]      + storage dimensions: 1280 x 720
[21:21:56]      + pixel aspect ratio: 1 : 1
[21:21:56]      + display dimensions: 1280 x 720
[21:21:56]    + encoder: H.264 (libx264)
[21:21:56]      + preset:  veryslow
[21:21:56]      + profile: high
[21:21:56]      + level:   4.0
[21:21:56]      + bitrate: 950 kbps, pass: 1
[21:21:56]      + color profile: 1-1-1
[21:21:56]  * audio track 1
[21:21:56]    + decoder: English (pcm_s16le) (2.0 ch) (1536 kbps) (track 1, id 0x1)
[21:21:56]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[21:21:56]    + mixdown: Stereo
[21:21:56]    + encoder: Opus (libopus)
[21:21:56]      + bitrate: 128 kbps, samplerate: 48000 Hz
[21:21:56]      + compression level: 10.00
[21:21:56] sync: expecting 1065 video frames
[21:21:56] encx264: encoding at average bitrate 950
[21:21:56] encx264: unparsed options: level=4.0:ref=9:bframes=8:b-adapt=2:direct=auto:analyse=all:me=umh:merange=24:subme=10:trellis=2:vbv-bufsize=31250:vbv-maxrate=25000:rc-lookahead=60
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x264 [info]: profile High, level 4.0, 4:2:0, 8-bit
[21:21:56] sync: first pts video is 0
[21:21:56] sync: Chapter 1 at frame 1 time 0
[21:21:56] sync: first pts audio 0x1 is 0
[21:22:26] reader: done. 1 scr changes
[21:22:30] work: average encoding speed for job is 33.620777 fps
[21:22:30] comb detect: heavy 11 | light 626 | uncombed 428 | total 1065
[21:22:30] decomb: deinterlaced 11 | blended 626 | unfiltered 428 | total 1065
[21:22:30] vfr: 1065 frames output, 0 dropped and 0 duped for CFR/PFR
[21:22:30] vfr: lost time: 0 (0 frames)
[21:22:30] vfr: gained time: 0 (0 frames) (0 not accounted for)
[21:22:31] pcm_s16le-decoder done: 2003 frames, 0 decoder errors
[21:22:31] h264-decoder done: 1065 frames, 0 decoder errors
[21:22:31] sync: got 1065 frames, 1065 expected
[21:22:31] sync: framerate min 24.999 fps, max 25.000 fps, avg 25.000 fps
x264 [info]: frame I:5     Avg QP:30.01  size: 67799
x264 [info]: frame P:196   Avg QP:33.54  size: 15136
x264 [info]: frame B:864   Avg QP:36.35  size:  2007
x264 [info]: consecutive B-frames:  0.6%  0.4%  9.3%  0.4%  0.9% 88.5%  0.0%  0.0%  0.0%
x264 [info]: mb I  I16..4: 27.7% 43.9% 28.5%
x264 [info]: mb P  I16..4:  3.3%  3.6%  0.7%  P16..4: 33.4%  7.1%  8.3%  0.0%  0.0%    skip:43.6%
x264 [info]: mb B  I16..4:  0.2%  0.2%  0.0%  B16..8: 25.0%  0.9%  0.2%  direct: 0.7%  skip:72.7%  L0:38.3% L1:59.7% BI: 1.9%
x264 [info]: final ratefactor: 30.15
x264 [info]: 8x8 transform intra:45.7% inter:67.8%
x264 [info]: direct mvs  spatial:99.3% temporal:0.7%
x264 [info]: coded y,uvDC,uvAC intra: 70.4% 21.1% 1.9% inter: 5.2% 1.2% 0.0%
x264 [info]: i16 v,h,dc,p: 20% 20% 37% 22%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  9%  7% 14% 10% 13% 11% 12% 10% 13%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 14% 11%  7%  8%  9%  9%  9% 15%
x264 [info]: i8c dc,h,v,p: 62% 20% 13%  5%
x264 [info]: Weighted P-Frames: Y:0.5% UV:0.5%
x264 [info]: ref P L0: 42.7%  8.9% 19.9%  3.5%  6.7%  4.0%  7.4%  2.6%  4.3%  0.0%
x264 [info]: ref B L0: 76.3% 10.8%  4.3%  2.4%  1.9%  2.4%  1.5%  0.5%
x264 [info]: ref B L1: 93.4%  6.6%
x264 [info]: kb/s:946.38
[21:22:31] Starting Task: Encoding Pass
[21:22:31] Skipping crop/scale filter
[21:22:31] work: sanitizing track 1 unsupported samplerate 44100 Hz to 48 kHz
[21:22:31] work: compression level not specified, track 1 setting compression level 10.00
[21:22:31] work: track 1, dithering not supported by codec
[21:22:31] job configuration:
[21:22:31]  * source
[21:22:31]    + C:\Users\deikun\Videos\test.mov
[21:22:31]    + title 1, chapter(s) 1 to 1
[21:22:31]    + container: mov,mp4,m4a,3gp,3g2,mj2
[21:22:31]    + data rate: 6592 kbps
[21:22:31]  * destination
[21:22:31]    + C:\Users\deikun\Videos\test.mkv
[21:22:31]    + container: Matroska (libavformat)
[21:22:31]  * video track
[21:22:31]    + decoder: h264 8-bit
[21:22:31]      + bitrate 5053 kbps
[21:22:31]    + filters
[21:22:31]      + Comb Detect (mode=3:spatial-metric=2:motion-thresh=1:spatial-thresh=1:filter-mode=2:block-thresh=40:block-width=16:block-height=16)
[21:22:31]      + Decomb (mode=39)
[21:22:31]      + Framerate Shaper (mode=1)
[21:22:31]        + frame rate: 25.000 fps -> constant 25.000 fps
[21:22:31]    + Output geometry
[21:22:31]      + storage dimensions: 1280 x 720
[21:22:31]      + pixel aspect ratio: 1 : 1
[21:22:31]      + display dimensions: 1280 x 720
[21:22:31]    + encoder: H.264 (libx264)
[21:22:31]      + preset:  veryslow
[21:22:31]      + profile: high
[21:22:31]      + level:   4.0
[21:22:31]      + bitrate: 950 kbps, pass: 2
[21:22:31]      + color profile: 1-1-1
[21:22:31]  * audio track 1
[21:22:31]    + decoder: English (pcm_s16le) (2.0 ch) (1536 kbps) (track 1, id 0x1)
[21:22:31]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[21:22:31]    + mixdown: Stereo
[21:22:31]    + encoder: Opus (libopus)
[21:22:31]      + bitrate: 128 kbps, samplerate: 48000 Hz
[21:22:31]      + compression level: 10.00
[21:22:31] sync: expecting 1065 video frames
[21:22:31] encx264: encoding at average bitrate 950
[21:22:31] encx264: unparsed options: level=4.0:ref=9:bframes=8:b-adapt=2:direct=auto:analyse=all:me=umh:merange=24:subme=10:trellis=2:vbv-bufsize=31250:vbv-maxrate=25000:rc-lookahead=60
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2
x264 [info]: profile High, level 4.0, 4:2:0, 8-bit
[21:22:31] sync: first pts video is 0
[21:22:31] sync: Chapter 1 at frame 1 time 0
[21:22:31] sync: first pts audio 0x1 is 0
[21:22:53] reader: done. 1 scr changes
[21:22:56] work: average encoding speed for job is 43.791401 fps
[21:22:56] comb detect: heavy 11 | light 626 | uncombed 428 | total 1065
[21:22:56] decomb: deinterlaced 11 | blended 626 | unfiltered 428 | total 1065
[21:22:56] vfr: 1065 frames output, 0 dropped and 0 duped for CFR/PFR
[21:22:56] vfr: lost time: 0 (0 frames)
[21:22:56] vfr: gained time: 0 (0 frames) (0 not accounted for)
[21:22:56] pcm_s16le-decoder done: 2003 frames, 0 decoder errors
[21:22:56] h264-decoder done: 1065 frames, 0 decoder errors
[21:22:56] sync: got 1065 frames, 1065 expected
[21:22:56] sync: framerate min 24.999 fps, max 25.000 fps, avg 25.000 fps
x264 [info]: frame I:5     Avg QP:29.97  size: 69258
x264 [info]: frame P:196   Avg QP:33.55  size: 14938
x264 [info]: frame B:864   Avg QP:36.28  size:  2057
x264 [info]: consecutive B-frames:  0.6%  0.4%  9.3%  0.4%  0.9% 88.5%  0.0%  0.0%  0.0%
x264 [info]: mb I  I16..4: 28.7% 41.9% 29.4%
x264 [info]: mb P  I16..4:  3.4%  3.6%  0.6%  P16..4: 32.9%  7.2%  8.5%  0.0%  0.0%    skip:43.8%
x264 [info]: mb B  I16..4:  0.3%  0.2%  0.0%  B16..8: 25.0%  1.0%  0.2%  direct: 0.7%  skip:72.7%  L0:39.1% L1:59.0% BI: 1.9%
x264 [info]: 8x8 transform intra:45.1% inter:68.7%
x264 [info]: direct mvs  spatial:99.3% temporal:0.7%
x264 [info]: coded y,uvDC,uvAC intra: 71.5% 20.7% 1.8% inter: 5.2% 1.2% 0.0%
x264 [info]: i16 v,h,dc,p: 20% 20% 39% 22%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu:  9%  7% 14% 10% 13% 11% 12% 10% 13%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 17% 14% 11%  7%  8%  9%  9%  9% 16%
x264 [info]: i8c dc,h,v,p: 63% 19% 13%  5%
x264 [info]: Weighted P-Frames: Y:0.5% UV:0.5%
x264 [info]: ref P L0: 43.6% 17.0% 15.2%  6.9%  6.1%  4.8%  4.0%  1.5%  1.0%  0.0%
x264 [info]: ref B L0: 74.5% 12.5%  6.1%  2.4%  2.0%  1.4%  0.9%  0.3%
x264 [info]: ref B L1: 93.5%  6.5%
x264 [info]: kb/s:948.65
[21:22:56] mux: track 0, 1065 frames, 5051323 bytes, 947.72 kbps, fifo 2048
[21:22:56] mux: track 1, 2131 frames, 444929 bytes, 83.48 kbps, fifo 4096
[21:22:56] Finished work at: Sat Feb 20 21:22:56 2021
[21:22:56] libhb: work result = 0

# Job Completed!

User avatar
Ritsuka
HandBrake Team
Posts: 1248
Joined: Fri Jan 12, 2007 11:29 am

Re: Opus downsampling doesn't work

Post by Ritsuka »

Opus can't be set to 44.1 kHz. It seems a bug in the UI, 44.1 shouldn't be a selectable value.
Deleted User 13735

Re: Opus downsampling doesn't work

Post by Deleted User 13735 »

Audio for video is 48 Khz most of the time.
deikun
Posts: 4
Joined: Sat Aug 04, 2018 11:06 pm

Re: Opus downsampling doesn't work

Post by deikun »

Ritsuka wrote: Sat Feb 20, 2021 9:18 pm Opus can't be set to 44.1 kHz. It seems a bug in the UI, 44.1 shouldn't be a selectable value.
If I selelect 32kHz in handbrake's samplerate, the output opus file's sampling rate is 24.0 kHz (from MediaInfo tool and potplayer).
deikun
Posts: 4
Joined: Sat Aug 04, 2018 11:06 pm

Re: Opus downsampling doesn't work

Post by deikun »

musicvid wrote: Sun Feb 21, 2021 12:52 am Audio for video is 48 Khz most of the time.
They are video with dialogue/speech audio, so 48kHz are useless (wasted space).
Deleted User 13735

Re: Opus downsampling doesn't work

Post by Deleted User 13735 »

They are video with dialogue/speech audio, so 48kHz are useless (wasted space).
Yes, somewhere in the neighborhood of a whopping 10 kb/s :!:
Breathe out. 44.1 is not a specified Opus sample rate, so you have found a ..., typo :!:
User avatar
s55
HandBrake Team
Posts: 9969
Joined: Sun Dec 24, 2006 1:05 pm

Re: Opus downsampling doesn't work

Post by s55 »

48, 24, 16, 12 and 8 are valid options for Opus.

The UI is simply showing a few invalid options and opus appears to be sanitising to the nearest valid option.
Post Reply