Creating mp4/mkv with multiple language tracks and forced subtitles

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
poshoholic
Posts: 1
Joined: Wed Mar 08, 2017 2:02 am

Creating mp4/mkv with multiple language tracks and forced subtitles

Post by poshoholic »

Please detail your question or problem in as much detail as possible:
I'm trying to create a mp4 or mkv file with multiple language tracks (English and French), where the forced subtitles appear in the proper language. I've been experimenting with the "Foreign Audio Scan" subtitle track as well as English/French language subtitle tracks, always checking Forced Only, and the end result is always the same: a video file with multiple audio tracks, each of which displays the forced subtitles in the first language in the audio track list (e.g. if I place the French audio track first, the video will default to French and the forced subtitles will appear in French even if I have the English audio track selected). I have gone through various combinations with trial and error over a dozen times with the same result every time. I never check Burn In, nor do I check Default.

My questions:
1. If this is possible, and working in Handbrake today, how do I do this?
2. If this is possible, but not working in Handbrake, would you consider implementing this as a feature request?
3. Is this simply not possible in either the mp4 or mkv file formats?

Tell us about your environment. What version of HandBrake? What version of Windows are you running. etc.
Handbrake 1.0.3. Windows 10 Anniversary Update, Slow Track updates.

If there was any exception or error displayed, please copy it and paste it here:
N/A

Please include the scan or encode log:
I'm not sure where this is.

Code: Select all

HandBrake 1.0.3 (2017022500) - 64bit
OS: Microsoft Windows NT 10.0.14986.0 - 64bit
CPU: Intel(R) Core(TM) i7-2720QM CPU @ 2.20GHz
Ram: 32721 MB, 
GPU Information:
  EPSON Projector Support Driver for UD - 1.0.0.0
  NVIDIA Quadro 1000M - 21.21.13.6909
Screen: 1920x1080
Temp Dir: C:\Users\Poshoholic\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake
Data Dir: C:\Users\Poshoholic\AppData\Roaming\HandBrake Team\HandBrake\1.0.3.0

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


# Starting Encode ...

[21:46:43] hb_init: starting libhb thread
[21:46:43] 1 job(s) to process
[21:46:43] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 160,
        "DRC": 0.0,
        "Encoder": 65536,
        "Gain": 0.0,
        "Mixdown": 6,
        "NormalizeMixLevel": false,
        "Samplerate": 48000,
        "Track": 4,
        "DitherMethod": 0
      },
      {
        "Bitrate": 160,
        "DRC": 0.0,
        "Encoder": 65536,
        "Gain": 0.0,
        "Mixdown": 6,
        "NormalizeMixLevel": false,
        "Samplerate": 48000,
        "Track": 1,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      1073807360,
      1073743872,
      1074003968,
      1073750016,
      1090519040,
      1074790400,
      1074266112,
      1107296256
    ],
    "FallbackEncoder": 2048
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "File": "E:\\Movies\\X-Men - First Class\\00897-1.m4v",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": true
    },
    "Mux": 131072
  },
  "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": 11,
        "Settings": {
          "crop-bottom": "132",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "132",
          "height": "816",
          "width": "1920"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "1"
        }
      }
    ]
  },
  "PAR": {
    "Num": 1,
    "Den": 1
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "E:\\tsMuxeR\\00897.iso"
  },
  "Subtitle": {
    "Search": {
      "Burn": false,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": [
      {
        "Burn": false,
        "Default": false,
        "Forced": true,
        "ID": 1,
        "Offset": 0,
        "Track": 0
      },
      {
        "Burn": false,
        "Default": false,
        "Forced": true,
        "ID": 4,
        "Offset": 0,
        "Track": 3
      }
    ]
  },
  "Video": {
    "Encoder": 65536,
    "Level": "5.1",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "medium",
    "Profile": "high",
    "Quality": 21.0,
    "OpenCL": false,
    "HWDecode": false,
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[21:46:43] CPU: Intel(R) Core(TM) i7-2720QM CPU @ 2.20GHz
[21:46:43]  - Intel microarchitecture Sandy Bridge
[21:46:43]  - logical processor count: 8
[21:46:43] Intel Quick Sync Video support: no
[21:46:43] hb_scan: path=E:\tsMuxeR\00897.iso, title_index=1
[21:46:43] scan: BD has 1 title(s)
[21:46:43] bd: scanning title 1
[21:46:43] bd: playlist 00000.MPLS
[21:46:43] bd: duration is 00:06:33 (393684 ms)
[21:46:43] bd: video id=0x1011, stream type=H.264, format 1080p
[21:46:43] bd: aspect = 16:9
[21:46:43] bd: audio id=0x711100, lang=English (DTS), 3cc=eng
[21:46:43] bd: audio id=0x1100, lang=English (DTS-HD MA), 3cc=eng
[21:46:43] bd: audio id=0x1101, lang=English (AC3), 3cc=eng
[21:46:43] bd: audio id=0x1102, lang=español (AC3), 3cc=spa
[21:46:43] bd: audio id=0x1103, lang=Francais (AC3), 3cc=fra
[21:46:43] bd: audio id=0x1104, lang=English (AC3), 3cc=eng
[21:46:43] bd: subtitle id=0x1200, lang=English, 3cc=eng
[21:46:43] bd: subtitle id=0x1201, lang=español, 3cc=spa
[21:46:43] bd: subtitle id=0x1202, lang=Francais, 3cc=fra
[21:46:43] bd: subtitle id=0x1203, lang=English, 3cc=eng
[21:46:43] bd: chap 1 packet=768, 393684 ms
[21:46:43] bd: title 1 has 1 chapters
[21:46:43] scan: decoding previews for title 1
[21:46:43] scan: title angle(s) 1
[21:46:43] scan: audio 0x711100: dca, rate=48000Hz, bitrate=1536000 English (DTS) (5.1 ch)
[21:46:43] scan: audio 0x1100: dca, rate=48000Hz, bitrate=1536000 English (DTS-HD MA) (5.1 ch)
[21:46:43] scan: audio 0x1101: ac3, rate=48000Hz, bitrate=448000 English (AC3) (5.1 ch)
[21:46:43] scan: audio 0x1102: ac3, rate=48000Hz, bitrate=448000 español (AC3) (5.1 ch)
[21:46:43] scan: audio 0x1103: ac3, rate=48000Hz, bitrate=448000 Francais (AC3) (5.1 ch)
[21:46:43] scan: audio 0x1104: ac3, rate=48000Hz, bitrate=448000 English (AC3) (5.1 ch)
[21:46:45] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 132/132/0/0, aspect 16:9, PAR 1:1
[21:46:45] scan: supported video decoders: avcodec qsv
[21:46:45] stream: 8 good frames, 0 errors (0%)
[21:46:45] libhb: scan thread found 1 valid title(s)
[21:46:45] starting job
[21:46:45] decomb filter thread started for segment 0
[21:46:45] decomb filter thread started for segment 7
[21:46:45] decomb filter thread started for segment 1
[21:46:45] decomb check thread started for segment 4
[21:46:45] decomb check thread started for segment 6
[21:46:45] decomb filter thread started for segment 6
[21:46:45] decomb filter thread started for segment 5
[21:46:45] mask filter thread started for segment 3
[21:46:45] decomb check thread started for segment 0
[21:46:45] mask filter thread started for segment 7
[21:46:45] decomb check thread started for segment 1
[21:46:45] decomb check thread started for segment 3
[21:46:45] decomb filter thread started for segment 3
[21:46:45] decomb check thread started for segment 5
[21:46:45] decomb filter thread started for segment 4
[21:46:45] decomb check thread started for segment 7
[21:46:45] mask dilate thread started for segment 4
[21:46:45] mask filter thread started for segment 1
[21:46:45] yadif thread started for segment 0
[21:46:45] decomb filter thread started for segment 2
[21:46:45] mask filter thread started for segment 4
[21:46:45] yadif thread started for segment 6
[21:46:45] work: only 1 chapter, disabling chapter markers
[21:46:45] mask filter thread started for segment 6
[21:46:45] job configuration:
[21:46:45]  * source
[21:46:45]    + E:\tsMuxeR\00897.iso
[21:46:45]    + title 1, chapter(s) 1 to 1
[21:46:45]  * destination
[21:46:45]    + E:\Movies\X-Men - First Class\00897-1.m4v
[21:46:45]    + container: MPEG-4 (libavformat)
[21:46:45]      + optimized for HTTP streaming (fast start)
[21:46:45]  * video track
[21:46:45]    + decoder: h264
[21:46:45]      + bitrate 200 kbps
[21:46:45] decomb check thread started for segment 2
[21:46:45]    + filters
[21:46:45]      + 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:46:45]      + Decomb (mode=39)
[21:46:45]      + Framerate Shaper (mode=1)
[21:46:45]        + frame rate: 23.976 fps -> constant 23.976 fps
[21:46:45] mask erode thread started for segment 0
[21:46:45]      + Crop and Scale (width=1920:height=816:crop-top=132:crop-bottom=132:crop-left=0:crop-right=0)
[21:46:45]        + source: 1920 * 1080, crop (132/132/0/0): 1920 * 816, scale: 1920 * 816
[21:46:45]    + Output geometry
[21:46:45]      + storage dimensions: 1920 x 816
[21:46:45]      + pixel aspect ratio: 1 : 1
[21:46:45]      + display dimensions: 1920 x 816
[21:46:45]  * Foreign Audio Search: Passthrough, Forced Only
[21:46:45] mask erode thread started for segment 1
[21:46:45]    + subtitle, Francais (track 2, id 0x1202) Picture [PGS]
[21:46:45] mask erode thread started for segment 2
[21:46:45] mask erode thread started for segment 3
[21:46:45] mask erode thread started for segment 4
[21:46:45] mask erode thread started for segment 5
[21:46:45] mask erode thread started for segment 7
[21:46:45] mask erode thread started for segment 6
[21:46:45] mask dilate thread started for segment 0
[21:46:45] mask dilate thread started for segment 1
[21:46:45] mask dilate thread started for segment 3
[21:46:45] mask dilate thread started for segment 2
[21:46:45] mask dilate thread started for segment 5
[21:46:45] mask filter thread started for segment 0
[21:46:45] mask dilate thread started for segment 6
[21:46:45] mask dilate thread started for segment 7
[21:46:45] mask filter thread started for segment 2
[21:46:45] yadif thread started for segment 1
[21:46:45] yadif thread started for segment 2
[21:46:45] sync: expecting 9438 video frames
[21:46:45] yadif thread started for segment 3
[21:46:45] yadif thread started for segment 4
[21:46:45] yadif thread started for segment 5
[21:46:45] mask filter thread started for segment 5
[21:46:45] yadif thread started for segment 7
[21:46:48] reader: done. 1 scr changes
[21:46:48] work: average encoding speed for job is 0.000000 fps
[21:46:48] comb detect: heavy 0 | light 0 | uncombed 0 | total 0
[21:46:48] decomb: deinterlaced 0 | blended 0 | unfiltered 0 | total 0
[21:46:48] vfr: 0 frames output, 0 dropped and 0 duped for CFR/PFR
[21:46:48] vfr: lost time: 0 (0 frames)
[21:46:48] vfr: gained time: 0 (0 frames) (0 not accounted for)
[21:46:49] stream: 9439 good frames, 0 errors (0%)
[21:46:49] sync: got 0 frames, 9438 expected
[21:46:49] Subtitle track 2 (id 0x1202) 'Francais': 42 hits (42 forced)
[21:46:49] Found a subtitle candidate with id 0x1202 (contains forced subs)
[21:46:49] starting job
[21:46:49] Subtitle pass-thru requested and input track is not compatible with container.  Changing track 0 to burned-in subtitle.
[21:46:49] Subtitle pass-thru requested and input track is not compatible with container.  One track already burned, dropping track 1.
[21:46:49] Subtitle pass-thru requested and input track is not compatible with container.  One track already burned, dropping track 1.
[21:46:49] decomb filter thread started for segment 0
[21:46:49] decomb filter thread started for segment 5
[21:46:49] decomb filter thread started for segment 2
[21:46:49] decomb check thread started for segment 0
[21:46:49] decomb filter thread started for segment 4
[21:46:49] decomb filter thread started for segment 1
[21:46:49] decomb filter thread started for segment 6
[21:46:49] decomb filter thread started for segment 7
[21:46:49] decomb filter thread started for segment 3
[21:46:49] decomb check thread started for segment 1
[21:46:49] mask filter thread started for segment 3
[21:46:49] mask filter thread started for segment 5
[21:46:49] mask filter thread started for segment 6
[21:46:49] mask erode thread started for segment 0
[21:46:49] decomb check thread started for segment 6
[21:46:49] decomb check thread started for segment 7
[21:46:49] mask filter thread started for segment 0
[21:46:49] mask filter thread started for segment 1
[21:46:49] mask filter thread started for segment 2
[21:46:49] decomb check thread started for segment 2
[21:46:49] mask dilate thread started for segment 4
[21:46:49] decomb check thread started for segment 3
[21:46:49] mask dilate thread started for segment 7
[21:46:49] mask filter thread started for segment 7
[21:46:49] yadif thread started for segment 3
[21:46:49] mask erode thread started for segment 1
[21:46:49] mask erode thread started for segment 2
[21:46:49] mask erode thread started for segment 3
[21:46:49] work: track 1, dithering not supported by codec
[21:46:49] work: track 2, dithering not supported by codec
[21:46:49] mask erode thread started for segment 4
[21:46:49] mask erode thread started for segment 5
[21:46:49] mask erode thread started for segment 6
[21:46:49] work: only 1 chapter, disabling chapter markers
[21:46:49] job configuration:
[21:46:49]  * source
[21:46:49]    + E:\tsMuxeR\00897.iso
[21:46:49]    + title 1, chapter(s) 1 to 1
[21:46:49] mask erode thread started for segment 7
[21:46:49]  * destination
[21:46:49]    + E:\Movies\X-Men - First Class\00897-1.m4v
[21:46:49]    + container: MPEG-4 (libavformat)
[21:46:49]      + optimized for HTTP streaming (fast start)
[21:46:49]  * video track
[21:46:49] mask dilate thread started for segment 0
[21:46:49]    + decoder: h264
[21:46:49]      + bitrate 200 kbps
[21:46:49]    + filters
[21:46:49] mask dilate thread started for segment 1
[21:46:49]      + 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:46:49]      + Decomb (mode=39)
[21:46:49]      + Framerate Shaper (mode=1)
[21:46:49]        + frame rate: 23.976 fps -> constant 23.976 fps
[21:46:49]      + Subtitle renderer ()
[21:46:49] mask dilate thread started for segment 2
[21:46:49]      + Crop and Scale (width=1920:height=816:crop-top=132:crop-bottom=132:crop-left=0:crop-right=0)
[21:46:49]        + source: 1920 * 1080, crop (132/132/0/0): 1920 * 816, scale: 1920 * 816
[21:46:49]    + Output geometry
[21:46:49]      + storage dimensions: 1920 x 816
[21:46:49]      + pixel aspect ratio: 1 : 1
[21:46:49]      + display dimensions: 1920 x 816
[21:46:49]    + encoder: H.264 (libx264)
[21:46:49]      + preset:  medium
[21:46:49]      + profile: high
[21:46:49]      + level:   5.1
[21:46:49]      + quality: 21.00 (RF)
[21:46:49] mask dilate thread started for segment 3
[21:46:49]  * subtitle track 1, Francais (track 2, id 0x1202) Picture [PGS] -> Render/Burn-in, Forced Only
[21:46:49]  * audio track 1
[21:46:49]    + decoder: Francais (AC3) (5.1 ch) (track 5, id 0x1103)
[21:46:49]      + bitrate: 448 kbps, samplerate: 48000 Hz
[21:46:49]    + mixdown: Dolby Pro Logic II
[21:46:49]    + encoder: AAC (libavcodec)
[21:46:49]      + bitrate: 160 kbps, samplerate: 48000 Hz
[21:46:49] mask filter thread started for segment 4
[21:46:49]  * audio track 2
[21:46:49]    + decoder: English (DTS-HD MA) (5.1 ch) (track 2, id 0x1100)
[21:46:49]      + bitrate: 1536 kbps, samplerate: 48000 Hz
[21:46:49]    + mixdown: Dolby Pro Logic II
[21:46:49]    + encoder: AAC (libavcodec)
[21:46:49]      + bitrate: 160 kbps, samplerate: 48000 Hz
[21:46:49] mask dilate thread started for segment 5
[21:46:49] mask dilate thread started for segment 6
[21:46:49] decomb check thread started for segment 4
[21:46:49] yadif thread started for segment 0
[21:46:49] yadif thread started for segment 1
[21:46:49] yadif thread started for segment 2
[21:46:49] decomb check thread started for segment 5
[21:46:49] yadif thread started for segment 4
[21:46:49] yadif thread started for segment 5
[21:46:49] yadif thread started for segment 6
[21:46:49] yadif thread started for segment 7
[21:46:49] sync: expecting 9438 video frames
[21:46:49] encx264: min-keyint: 24, keyint: 240
[21:46:49] encx264: encoding at constant RF 21.000000
[21:46:49] encx264: unparsed options: vbv-maxrate=300000:level=5.1:vbv-bufsize=300000
x264 [info]: using SAR=1/1
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x264 [info]: profile High, level 5.1
[21:46:49] sync: first pts video is 0
[21:46:49] sync: "Chapter 1" (1) at frame 1 time 0
[21:46:49] sync: first pts audio 0x1103 is 0
[21:46:49] sync: first pts audio 0x1100 is 0
[21:49:40] sync: first pts subtitle 0x1202 is 4898643

# Encode Stopped

[21:57:59] work: average encoding speed for job is 7.739922 fps
[21:57:59] comb detect: heavy 28 | light 1420 | uncombed 3712 | total 5160
[21:57:59] decomb: deinterlaced 28 | blended 1415 | unfiltered 3708 | total 5151
[21:57:59] vfr: 5144 frames output, 0 dropped and 0 duped for CFR/PFR
[21:57:59] vfr: lost time: 0 (0 frames)
[21:57:59] vfr: gained time: 0 (0 frames) (0 not accounted for)
[21:57:59] stream: 5311 good frames, 0 errors (0%)
[21:57:59] ac3-decoder done: 6837 frames, 0 decoder errors
[21:57:59] dca-decoder done: 20508 frames, 0 decoder errors
[21:57:59] h264-decoder done: 5230 frames, 0 decoder errors
[21:57:59] sync: got 5189 frames, 9438 expected
[21:57:59] sync: framerate min 23.974 fps, max 23.981 fps, avg 23.976 fps
x264 [info]: frame I:62    Avg QP:18.55  size:147316
x264 [info]: frame P:1340  Avg QP:21.40  size: 41054
x264 [info]: frame B:3674  Avg QP:22.75  size: 15123
x264 [info]: consecutive B-frames:  3.2%  0.3%  1.2% 95.2%
x264 [info]: mb I  I16..4: 41.0% 36.6% 22.5%
x264 [info]: mb P  I16..4:  4.8%  3.2%  0.8%  P16..4: 44.9% 14.7% 10.9%  0.0%  0.0%    skip:20.7%
x264 [info]: mb B  I16..4:  1.5%  0.2%  0.1%  B16..8: 49.9%  2.6%  0.5%  direct: 3.7%  skip:41.5%  L0:50.6% L1:47.1% BI: 2.3%
x264 [info]: 8x8 transform intra:29.7% inter:59.3%
x264 [info]: coded y,uvDC,uvAC intra: 85.3% 61.3% 29.3% inter: 21.6% 18.1% 0.4%
x264 [info]: i16 v,h,dc,p: 11% 11% 47% 31%
x264 [info]: i8 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 13% 34%  5%  6%  6%  7%  6%  7%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 16% 15% 33%  6%  7%  6%  6%  5%  6%
x264 [info]: i8c dc,h,v,p: 63% 17% 17%  2%
x264 [info]: Weighted P-Frames: Y:1.6% UV:0.1%
x264 [info]: ref P L0: 46.1% 10.3% 31.6% 11.9%  0.1%
x264 [info]: ref B L0: 78.2% 16.9%  4.8%
x264 [info]: ref B L1: 91.7%  8.3%
x264 [info]: kb/s:4523.35
[21:58:00] mux: track 0, 5075 frames, 119659282 bytes, 4418.87 kbps, fifo 1024
[21:58:00] mux: track 1, 10153 frames, 4337497 bytes, 160.18 kbps, fifo 2048
[21:58:00] mux: track 2, 10153 frames, 4337494 bytes, 160.18 kbps, fifo 2048
[21:58:00] libhb: work result = 1

# Encode Completed ...

Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Creating mp4/mkv with multiple language tracks and forced subtitles

Post by Woodstock »

PGS subtitles and MP4 output means burned-in subtitles, and only the first subtitle track specified. It's a limitation of that file format. Multiple subtitle tracks requires MKV for the output, OR you'll need to supply text-based or VOBSUB subtitles for the MP4.

"Forced only" rarely works with subtitles, because few titles use the forced flat. Foreign audio search works by looking for a track that has 10% or few subtitles, compared to other tracks. It should not be used with the "forced only" flag in most (almost all) cases, because of the lack of flagging.
Post Reply