How to have handbrake correctly place additional audio tracks without duplicating track 1?

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
BluePieNinja
Posts: 3
Joined: Mon Feb 12, 2024 12:42 am

How to have handbrake correctly place additional audio tracks without duplicating track 1?

Post by BluePieNinja »

Description of problem or question:
I'm trying to cut down the filesizes of my gameplay footage, as well as ensure a consistant framerate so my video editor program is usable on my computer with my gameplay footage. I have 2 audio tracks on each video, one for computer audio and another for microphone audio.

When I go to convert the video with Handbrake, it automatically decides to encode only a single audio track and delete the second. I tried to set up a preset to include both, but then I end up in the stupid situation of Handbrake encoding the computer audio twice onto two tracks.

I can select the second audio track containing the microphone audio to manually be placed onto the second audio track, but this is a tedious and time-consuming process when I batch convert my videos. Is there a way to force Handbrake to put the next audio track onto the next audio track slot or something to avoid needing to manually ensure every single video is using the correct audio tracks?


Steps to reproduce the problem (If Applicable):
Open Handbrake with file, select preset including two audio tracks, go to audio tab, see that Handbrake duplicates the first audio track instead of placing the second audio track in the second slot.

HandBrake version (e.g., 1.0.0):
Handbrake 1.7.3

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

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

Code: Select all

HandBrake 1.7.3 (2024021000)
OS: Microsoft Windows NT 10.0.19045.0
CPU: AMD Ryzen 5 3600 6-Core Processor              
Ram: 16309 MB, 
GPU Information:
  NVIDIA GeForce GTX 1070 - 31.0.15.5123
Screen: 1920x1080
Temp Dir: C:\Users\natha\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake\
Data Dir: C:\Users\natha\AppData\Roaming\HandBrake

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

 # Starting Encode ...

[11:52:58] base preset: dual audio tracks
[11:52:58] Remote Process started with Process ID: 23576 using port: 8037. Max Allowed Instances: 1
[11:52:58] Worker: Starting HandBrake Engine ...
[11:52:58] Worker: Parent Process Id 14108
[11:52:58] Worker: Starting Web Server on port 8037 ...
[11:52:58] Worker: Starting Listener: 1
[11:52:58] Worker: Server Started
[11:52:59] Worker: Disconnected worker monitoring enabled!
[11:52:59] Compile-time hardening features are enabled
[11:52:59] nvenc: version 12.2 is available
[11:52:59] nvdec: is available
[11:52:59] CUDA Version: 6.1
[11:52:59] vcn: not available on this system
[11:52:59] qsv: not available on this system
[11:52:59] hb_init: starting libhb thread
[11:52:59] Starting work at: Mon Feb 12 11:52:59 2024
[11:52:59] 1 job(s) to process
[11:52:59] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 160,
        "DRC": 0,
        "Encoder": "av_aac",
        "Gain": 0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Name": "System sounds",
        "Track": 0,
        "DitherMethod": 0
      },
      {
        "Bitrate": 160,
        "DRC": 0,
        "Encoder": "av_aac",
        "Gain": 0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Name": "System sounds",
        "Track": 0,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      "copy:aac",
      "copy:mp3"
    ],
    "FallbackEncoder": "av_aac"
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": true,
    "File": "F:\\Videos\\Shadowplay\\Captures\\The Finals\\Converted\\The Finals 2024.01.28 - 21.54.10.14.Dvr.mp4",
    "Options": {
      "IpodAtom": false,
      "Optimize": false
    },
    "Mux": "av_mp4"
  },
  "Filters": {
    "FilterList": [
      {
        "ID": 5,
        "Settings": {
          "mode": "7"
        }
      },
      {
        "ID": 4,
        "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": 19,
        "Settings": {
          "crop-bottom": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "1080",
          "width": "1920"
        }
      },
      {
        "ID": 10,
        "Settings": {
          "mode": "2",
          "rate": "27000000/900000"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {
    "ReleaseDate": "2024"
  },
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 12,
    "Path": "F:\\Videos\\Shadowplay\\Captures\\The Finals\\The Finals 2024.01.28 - 21.54.10.14.DVR.mp4",
    "HWDecode": 4
  },
  "Subtitle": {
    "Search": {
      "Burn": true,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": []
  },
  "Video": {
    "Encoder": "x264",
    "Level": "4.0",
    "MultiPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "fast",
    "Profile": "main",
    "Quality": 22,
    "QSV": {
      "Decode": false
    },
    "HardwareDecode": 0
  }
}
[11:52:59] CPU: AMD Ryzen 5 3600 6-Core Processor
[11:52:59]  - logical processor count: 12
[11:52:59] Intel Quick Sync Video support: no
[11:52:59] hb_scan: path=F:\Videos\Shadowplay\Captures\The Finals\The Finals 2024.01.28 - 21.54.10.14.DVR.mp4, title_index=12
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'F:\Videos\Shadowplay\Captures\The Finals\The Finals 2024.01.28 - 21.54.10.14.DVR.mp4':
  Metadata:
    major_brand     : mp42
    minor_version   : 0
    compatible_brands: isommp42
    creation_time   : 2024-01-28T10:54:49.000000Z
    date            : 2024
  Duration: 00:14:14.19, start: 0.000000, bitrate: 42728 kb/s
  Stream #0:0[0x1](und): Video: h264 (High) (avc1 / 0x31637661), yuv420p(tv, smpte170m, progressive), 1920x1080 [SAR 1:1 DAR 16:9], 42346 kb/s, 59.76 fps, 60 tbr, 90k tbn (default)
    Metadata:
      creation_time   : 2024-01-28T10:54:49.000000Z
      handler_name    : VideoHandle
      vendor_id       : [0][0][0][0]
  Stream #0:1[0x2](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 196 kb/s (default)
    Metadata:
      creation_time   : 2024-01-28T10:54:49.000000Z
      handler_name    : SoundHandle
      vendor_id       : [0][0][0][0]
      title           : System sounds
  Stream #0:2[0x3](und): Audio: aac (LC) (mp4a / 0x6134706D), 48000 Hz, stereo, fltp, 178 kb/s (default)
    Metadata:
      creation_time   : 2024-01-28T10:54:49.000000Z
      handler_name    : SoundHandle
      vendor_id       : [0][0][0][0]
      title           : Microphone
[11:52:59] scan: decoding previews for title 12
[11:52:59] scan: audio 0x2: aac, rate=48000Hz, bitrate=178190 Unknown (AAC LC, 2.0 ch, 178 kbps)
[11:52:59] scan: audio 0x1: aac, rate=48000Hz, bitrate=196364 Unknown (AAC LC, 2.0 ch, 196 kbps)
[11:53:00] using container PAR 1:1
[11:53:00] scan: 10 previews, 1920x1080, 59.764 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1, color profile: 6-6-6, chroma location: left
[11:53:00] scan: supported video decoders: avcodec hwaccel
[11:53:00] libhb: scan thread found 1 valid title(s)
[11:53:00] Skipping subtitle scan.  No suitable subtitle tracks.
[11:53:00] Starting Task: Encoding Pass
[11:53:00] work: skipping crop/scale filter
[11:53:00] work: track 1, dithering not supported by codec
[11:53:00] work: track 2, dithering not supported by codec
[11:53:00] work: only 1 chapter, disabling chapter markers
[11:53:00] job configuration:
[11:53:00]  * source
[11:53:00]    + F:\Videos\Shadowplay\Captures\The Finals\The Finals 2024.01.28 - 21.54.10.14.DVR.mp4
[11:53:00]    + title 12, chapter(s) 1 to 1
[11:53:00]    + container: mov,mp4,m4a,3gp,3g2,mj2
[11:53:00]    + data rate: 42728 kbps
[11:53:00]  * destination
[11:53:00]    + F:\Videos\Shadowplay\Captures\The Finals\Converted\The Finals 2024.01.28 - 21.54.10.14.Dvr.mp4
[11:53:00]    + container: MPEG-4 (libavformat)
[11:53:00]      + align initial A/V stream timestamps
[11:53:00]  * video track
[11:53:00]    + decoder: h264 8-bit (yuv420p)
[11:53:00]      + bitrate 42346 kbps
[11:53:00]    + filters
[11:53:00]      + 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)
[11:53:00]      + Decomb (mode=39)
[11:53:00]      + Framerate Shaper (mode=2:rate=27000000/900000)
[11:53:00]        + frame rate: 59.764 fps -> peak rate limited to 30.000 fps
[11:53:00]    + Output geometry
[11:53:00]      + storage dimensions: 1920 x 1080
[11:53:00]      + pixel aspect ratio: 1 : 1
[11:53:00]      + display dimensions: 1920 x 1080
[11:53:00]    + encoder: H.264 (libx264)
[11:53:00]      + preset:  fast
[11:53:00]      + profile: main
[11:53:00]      + level:   4.0
[11:53:00]      + quality: 22.00 (RF)
[11:53:00]      + color profile: 6-6-6
[11:53:00]      + chroma location: left
[11:53:00]  * audio track 1
[11:53:00]    + name: System sounds
[11:53:00]    + decoder: Unknown (AAC LC, 2.0 ch, 196 kbps) (track 1, id 0x1)
[11:53:00]      + bitrate: 196 kbps, samplerate: 48000 Hz
[11:53:00]    + mixdown: Stereo
[11:53:00]    + encoder: AAC (libavcodec)
[11:53:00]      + bitrate: 160 kbps, samplerate: 48000 Hz
[11:53:00]  * audio track 2
[11:53:00]    + name: System sounds
[11:53:00]    + decoder: Unknown (AAC LC, 2.0 ch, 196 kbps) (track 1, id 0x1)
[11:53:00]      + bitrate: 196 kbps, samplerate: 48000 Hz
[11:53:00]    + mixdown: Stereo
[11:53:00]    + encoder: AAC (libavcodec)
[11:53:00]      + bitrate: 160 kbps, samplerate: 48000 Hz
[11:53:00] sync: expecting 51050 video frames
[11:53:00] encx264: min-keyint: 30, keyint: 300
[11:53:00] encx264: encoding at constant RF 22.000000
[11:53:00] encx264: unparsed options: level=4.0:ref=2:8x8dct=0:weightp=1:subme=6:vbv-bufsize=25000:vbv-maxrate=20000:rc-lookahead=30
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 UnalignedStack
x264 [info]: profile Main, level 4.0, 4:2:0, 8-bit
[11:53:00] sync: first pts video is 0
[11:53:00] sync: "Chapter 1" (1) at frame 1 time 0
[11:53:00] sync: first pts audio 0x1 is 0
[11:53:00] sync: first pts audio 0x1 is 0
[12:01:09] reader: done. 1 scr changes
[12:01:10] work: average encoding speed for job is 104.137604 fps
[12:01:10] comb detect: heavy 3341 | light 8511 | uncombed 39198 | total 51050
[12:01:10] decomb: deinterlaced 3341 | blended 8511 | unfiltered 39198 | total 51050
[12:01:10] vfr: 25086 frames output, 25964 dropped and 0 duped for CFR/PFR
[12:01:10] vfr: lost time: 0 (0 frames)
[12:01:10] vfr: gained time: 0 (0 frames) (0 not accounted for)
[12:01:10] aac-decoder done: 40040 frames, 0 decoder errors
[12:01:10] aac-decoder done: 40040 frames, 0 decoder errors
[12:01:10] h264-decoder done: 51050 frames, 0 decoder errors
[12:01:10] sync: got 51050 frames, 51050 expected
[12:01:10] sync: framerate min 3.102 fps, max 94.637 fps, avg 59.764 fps
x264 [info]: frame I:171   Avg QP:18.33  size:134645
x264 [info]: frame P:7851  Avg QP:21.51  size: 45240
x264 [info]: frame B:17064 Avg QP:21.89  size: 20923
x264 [info]: consecutive B-frames:  6.6%  5.1%  9.2% 79.1%
x264 [info]: mb I  I16..4: 51.8%  0.0% 48.2%
x264 [info]: mb P  I16..4: 21.5%  0.0% 15.8%  P16..4: 19.3%  6.3%  2.7%  0.0%  0.0%    skip:34.4%
x264 [info]: mb B  I16..4: 10.6%  0.0%  2.8%  B16..8: 18.0%  7.0%  0.6%  direct: 7.6%  skip:53.5%  L0:47.2% L1:43.5% BI: 9.2%
x264 [info]: coded y,uvDC,uvAC intra: 34.5% 49.5% 19.7% inter: 9.9% 17.7% 1.7%
x264 [info]: i16 v,h,dc,p: 38% 28% 18% 15%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 24% 22% 24%  4%  6%  5%  6%  4%  5%
x264 [info]: i8c dc,h,v,p: 52% 22% 22%  3%
x264 [info]: Weighted P-Frames: Y:4.1% UV:2.8%
x264 [info]: ref P L0: 73.7% 26.3%
x264 [info]: ref B L0: 86.8% 13.2%
x264 [info]: ref B L1: 95.8%  4.2%
x264 [info]: kb/s:6885.65
[12:01:10] mux: track 0, 25086 frames, 735232313 bytes, 6885.54 kbps, fifo 4096
[12:01:10] mux: track 1, 40041 frames, 17594400 bytes, 164.77 kbps, fifo 8192
[12:01:10] mux: track 2, 40041 frames, 17594400 bytes, 164.77 kbps, fifo 8192
[12:01:10] Finished work at: Mon Feb 12 12:01:10 2024
[12:01:10] libhb: work result = 0

 # Job Completed!
BluePieNinja
Posts: 3
Joined: Mon Feb 12, 2024 12:42 am

Re: How to have handbrake correctly place additional audio tracks without duplicating track 1?

Post by BluePieNinja »

Ok so am I supposed to choose language as "any" to get the audio tracks to be added?
User avatar
JohnAStebbins
HandBrake Team
Posts: 5705
Joined: Sat Feb 09, 2008 7:21 pm

Re: How to have handbrake correctly place additional audio tracks without duplicating track 1?

Post by JohnAStebbins »

BluePieNinja wrote: Wed Feb 14, 2024 8:06 am Ok so am I supposed to choose language as "any" to get the audio tracks to be added?
Set "Selection Behavior" to "All Tracks Matching Selected Languages" and add "Any" to "Selected Languages".
BluePieNinja
Posts: 3
Joined: Mon Feb 12, 2024 12:42 am

Re: How to have handbrake correctly place additional audio tracks without duplicating track 1?

Post by BluePieNinja »

JohnAStebbins wrote: Wed Feb 14, 2024 4:04 pm Set "Selection Behavior" to "All Tracks Matching Selected Languages" and add "Any" to "Selected Languages".
Ok thanks, that seems to have fixed this problem!
Post Reply