HandBrake / HandBrake

HandBrake's main development repository
https://handbrake.fr
Other
17.33k stars 1.32k forks source link

Unable to add additional subtitle tracks to the file #4303

Closed KWierso closed 2 years ago

KWierso commented 2 years ago

Problem Description

I'm trying to encode a video from an mkv file that has several subtitle tracks embedded in it.

When I open the mkv file in Handbrake, it defaults to having the Foreign Audio Scan track as "Burn In".

I want to also have the English subtitles be available when I play the video, so I open the "Tracks" menu and select "Add New Track".

Nothing happens. The only added subtitle track is still the Foreign Audio Scan.

I've tried changing the "Selection Behavior" to always add any English subtitle tracks, in addition to the Foreign Audio Scan, but when I use that, it still only adds the Foreign Audio Scan.

Am I just not understanding how to add subtitle tracks to videos, or is there something actually wrong, here?

Activity Log, Crash Log or any other details

HandBrake 1.5.1 (2022011000)
OS: Microsoft Windows NT 10.0.22000.0
CPU: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
Ram: 32667 MB, 
GPU Information:
  NVIDIA GeForce GTX 1060 6GB - 30.0.15.1179
  Intel(R) HD Graphics 630 - 27.20.100.8854
Screen: 2752x1152
Temp Dir: C:\Users\kwier\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake\
Data Dir: C:\Users\kwier\AppData\Roaming\HandBrake

-------------------------------------------
[01:17:56] hb_init: starting libhb thread

 # Starting Scan ...

[01:17:56] CPU: Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz
[01:17:56]  - Intel microarchitecture Kaby Lake
[01:17:56]  - logical processor count: 8
[01:17:56] Intel Quick Sync Video support: yes, gpu list: 1
[01:17:56] Intel Quick Sync Video integrated adapter with index 1
[01:17:56]  - Intel Media SDK hardware: API 1.33 (minimum: 1.3)
[01:17:56]  - Decode support:  h264 hevc (8bit: yes, 10bit: yes)
[01:17:56]  - H.264 encoder: yes
[01:17:56]     - preferred implementation: hardware (2) via D3D11
[01:17:56]     - capabilities (hardware):  breftype icq+la+i+downs vsinfo opt1 opt2+mbbrc+extbrc+trellis+ib_adapt+nmpslice
[01:17:56]  - H.265 encoder: yes (8bit: yes, 10bit: yes)
[01:17:56]     - preferred implementation: hardware (2) via D3D11
[01:17:56]     - capabilities (hardware):  bpyramid icq vsinfo opt1
[01:17:56] hb_scan: path=H:\Video\Resident Evil- Welcome to Raccoon City, title_index=0
src/libbluray/disc/disc.c:437: error opening file BDMV\index.bdmv
src/libbluray/disc/disc.c:437: error opening file BDMV\BACKUP\index.bdmv
src/libbluray/bluray.c:2646: nav_get_title_list(H:\Video\Resident Evil- Welcome to Raccoon City\) failed
[01:17:56] bd: not a bd - trying as a stream/file instead
libdvdread: Could not open input:
libdvdread: Can't open H:\Video\Resident Evil- Welcome to Raccoon City for reading
libdvdread: Device H:\Video\Resident Evil- Welcome to Raccoon City inaccessible, CSS authentication not available.
libdvdread: DVDOpenFilePath:findDVDFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav: vm: vm: failed to read VIDEO_TS.IFO
[01:17:56] dvd: not a dvd - trying as a stream/file instead
[01:17:56] batch: scanning H:\Video\Resident Evil- Welcome to Raccoon City\Resident Evil- Welcome to Raccoon City-FPL_MainFeature_t01.mkv
Input #0, matroska,webm, from 'H:\Video\Resident Evil- Welcome to Raccoon City\Resident Evil- Welcome to Raccoon City-FPL_MainFeature_t01.mkv':
  Metadata:
    title           : Resident Evil: Welcome to Raccoon City
    encoder         : libmakemkv v1.16.7 (1.3.10/1.5.2) win(x64-release)
    creation_time   : 2022-04-15T03:04:08.000000Z
  Duration: 01:47:29.47, start: 0.000000, bitrate: 33544 kb/s
  Chapters:
    Chapter #0:0: start 0.000000, end 602.518583
      Metadata:
        title           : Chapter 01
    Chapter #0:1: start 602.518583, end 1093.884458
      Metadata:
        title           : Chapter 02
    Chapter #0:2: start 1093.884458, end 1565.772542
      Metadata:
        title           : Chapter 03
    Chapter #0:3: start 1565.772542, end 2031.070708
      Metadata:
        title           : Chapter 04
    Chapter #0:4: start 2031.070708, end 2309.598958
      Metadata:
        title           : Chapter 05
    Chapter #0:5: start 2309.598958, end 2754.209792
      Metadata:
        title           : Chapter 06
    Chapter #0:6: start 2754.209792, end 3081.244833
      Metadata:
        title           : Chapter 07
    Chapter #0:7: start 3081.244833, end 3289.286000
      Metadata:
        title           : Chapter 08
    Chapter #0:8: start 3289.286000, end 3629.626000
      Metadata:
        title           : Chapter 09
    Chapter #0:9: start 3629.626000, end 3952.990708
      Metadata:
        title           : Chapter 10
    Chapter #0:10: start 3952.990708, end 4203.741208
      Metadata:
        title           : Chapter 11
    Chapter #0:11: start 4203.741208, end 4397.684958
      Metadata:
        title           : Chapter 12
    Chapter #0:12: start 4397.684958, end 4495.949792
      Metadata:
        title           : Chapter 13
    Chapter #0:13: start 4495.949792, end 4723.343625
      Metadata:
        title           : Chapter 14
    Chapter #0:14: start 4723.343625, end 5551.671125
      Metadata:
        title           : Chapter 15
    Chapter #0:15: start 5551.671125, end 6449.472000
      Metadata:
        title           : Chapter 16
  Stream #0:0(eng): Video: h264 (High), yuv420p(progressive), 1920x1080 [SAR 1:1 DAR 16:9], 23.98 fps, 23.98 tbr, 1k tbn, 47.95 tbc
    Metadata:
      BPS-eng         : 27751707
      DURATION-eng    : 01:47:29.443000000
      NUMBER_OF_FRAMES-eng: 154632
      NUMBER_OF_BYTES-eng: 22372881828
      SOURCE_ID-eng   : 001011
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.7 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2022-04-15 03:04:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:1(eng): Audio: dts (DTS-HD MA), 48000 Hz, 5.1(side), s16p (default)
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 2283247
      DURATION-eng    : 01:47:29.450666666
      NUMBER_OF_FRAMES-eng: 604636
      NUMBER_OF_BYTES-eng: 1840711612
      SOURCE_ID-eng   : 001100
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.7 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2022-04-15 03:04:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:2(eng): Audio: dts (DTS), 48000 Hz, 5.1(side), fltp, 1536 kb/s
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 1509000
      DURATION-eng    : 01:47:29.450666666
      NUMBER_OF_FRAMES-eng: 604636
      NUMBER_OF_BYTES-eng: 1216527632
      SOURCE_ID-eng   : 001100
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.7 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2022-04-15 03:04:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:3(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 640000
      DURATION-eng    : 01:47:29.472000000
      NUMBER_OF_FRAMES-eng: 201546
      NUMBER_OF_BYTES-eng: 515957760
      SOURCE_ID-eng   : 001101
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.7 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2022-04-15 03:04:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:4(spa): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 640000
      DURATION-eng    : 01:47:29.472000000
      NUMBER_OF_FRAMES-eng: 201546
      NUMBER_OF_BYTES-eng: 515957760
      SOURCE_ID-eng   : 001102
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.7 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2022-04-15 03:04:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:5(fra): Audio: ac3, 48000 Hz, 5.1(side), fltp, 640 kb/s
    Metadata:
      title           : Surround 5.1
      BPS-eng         : 640000
      DURATION-eng    : 01:47:29.472000000
      NUMBER_OF_FRAMES-eng: 201546
      NUMBER_OF_BYTES-eng: 515957760
      SOURCE_ID-eng   : 001103
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.7 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2022-04-15 03:04:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:6(eng): Subtitle: hdmv_pgs_subtitle
    Metadata:
      BPS-eng         : 23515
      DURATION-eng    : 01:40:34.173979166
      NUMBER_OF_FRAMES-eng: 1959
      NUMBER_OF_BYTES-eng: 17736840
      SOURCE_ID-eng   : 001200
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.7 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2022-04-15 03:04:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:7(eng): Subtitle: hdmv_pgs_subtitle
    Metadata:
      BPS-eng         : 19480
      DURATION-eng    : 01:39:37.450645833
      NUMBER_OF_FRAMES-eng: 1600
      NUMBER_OF_BYTES-eng: 14555583
      SOURCE_ID-eng   : 001201
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.7 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2022-04-15 03:04:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:8(fra): Subtitle: hdmv_pgs_subtitle
    Metadata:
      BPS-eng         : 15659
      DURATION-eng    : 01:44:47.009895833
      NUMBER_OF_FRAMES-eng: 1582
      NUMBER_OF_BYTES-eng: 12306176
      SOURCE_ID-eng   : 001202
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.7 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2022-04-15 03:04:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:9(spa): Subtitle: hdmv_pgs_subtitle
    Metadata:
      BPS-eng         : 16870
      DURATION-eng    : 01:46:12.386854166
      NUMBER_OF_FRAMES-eng: 1654
      NUMBER_OF_BYTES-eng: 13438397
      SOURCE_ID-eng   : 001203
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.7 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2022-04-15 03:04:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:10(spa): Subtitle: hdmv_pgs_subtitle
    Metadata:
      BPS-eng         : 951
      DURATION-eng    : 01:42:22.240270833
      NUMBER_OF_FRAMES-eng: 68
      NUMBER_OF_BYTES-eng: 730674
      SOURCE_ID-eng   : 001203
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.7 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2022-04-15 03:04:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:11(fra): Subtitle: hdmv_pgs_subtitle
    Metadata:
      BPS-eng         : 827
      DURATION-eng    : 01:30:05.087187500
      NUMBER_OF_FRAMES-eng: 60
      NUMBER_OF_BYTES-eng: 559113
      SOURCE_ID-eng   : 001204
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.7 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2022-04-15 03:04:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
  Stream #0:12(fra): Subtitle: hdmv_pgs_subtitle
    Metadata:
      BPS-eng         : 827
      DURATION-eng    : 01:30:05.087187500
      NUMBER_OF_FRAMES-eng: 60
      NUMBER_OF_BYTES-eng: 559113
      SOURCE_ID-eng   : 001204
      _STATISTICS_WRITING_APP-eng: MakeMKV v1.16.7 win(x64-release)
      _STATISTICS_WRITING_DATE_UTC-eng: 2022-04-15 03:04:08
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES SOURCE_ID
[01:17:56] scan: decoding previews for title 1 (H:\Video\Resident Evil- Welcome to Raccoon City\Resident Evil- Welcome to Raccoon City-FPL_MainFeature_t01.mkv)
[01:17:56] scan: audio 0x1: dca, rate=48000Hz, bitrate=1 English (DTS-HD MA) (5.1 ch)
[01:17:56] scan: audio 0x2: dca, rate=48000Hz, bitrate=1536000 English (DTS) (5.1 ch) (1536 kbps)
[01:17:56] scan: audio 0x3: ac3, rate=48000Hz, bitrate=640000 English (AC3) (5.1 ch) (640 kbps)
[01:17:56] scan: audio 0x4: ac3, rate=48000Hz, bitrate=640000 español (AC3) (5.1 ch) (640 kbps)
[01:17:56] scan: audio 0x5: ac3, rate=48000Hz, bitrate=640000 Francais (AC3) (5.1 ch) (640 kbps)
[01:17:57] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 140/140/0/0, aspect 16:9, PAR 1:1, color profile: 1-1-1, chroma location: left
[01:17:57] scan: supported video decoders: avcodec qsv
[01:17:57] libhb: scan thread found 1 valid title(s)

 # Scan Finished ...

[01:17:58] decomb: deinterlaced 1 | blended 0 | unfiltered 0 | total 1

What Operating System are you running?

Windows 11

What version of HandBrake are you running?

1.5.1

Where did you download HandBrake from?

handbrake.fr

KWierso commented 2 years ago

If I open the dropdown that says "foreign audio scan" I see all of the other subtitle tracks in the list. I could change to one of those, but then I'd lose the burned-in foreign audio scan, since I still can't add any other subtitle tracks.

galad87 commented 2 years ago

PGS tracks can only burned in if the selected container format is mp4.

KWierso commented 2 years ago

Is that explained anywhere in the UI? Would it be worth adding something when the user tries to add PGS tracks so it's not just sitting there failing silently?

sr55 commented 2 years ago

Tricky one. It's not a one off limitation. you'd need a small essay to explain all the possible limitations and behaviours that take effect when hitting add that could cause confusion.

I'm not sure there is a good way to really portray that in the UI without making it obnoxious.

Not a super fan of generic messages myself.

https://handbrake.fr/docs/en/latest/advanced/subtitles.html may be of interest.

KWierso commented 2 years ago

That's fair! Happy to close this if that's the case. Still think some feedback should happen if I click "Add new track" and the number of tracks remains unchanged, just to avoid some confusion about what's happening.

nurbles commented 2 years ago

I'm using the Roku 720p preset, with the subtitles set to auto-select and include any English subtitle tracks. It is set to burn in Foreign Audio Scan, if found. My output container is MP4.

Unfortunately, the automatic selection is not working from any BluRay sources. The page referenced by @sr55 seems to say that the subtitles with [PGS] tags may be included in MP4 output, but I cannot get that to happen. Once upon a time, when I clicked "Add remaining tracks" all of the remaining subtitles would be added and I would remove the ones I didn't want. Now NOTHING is added. As stated earlier, I can change the burn-in selection to one of the other tracks and then the "Add remaining tracks" will add the next track only. But that is wrong, because I want the burn-in to remain foreign audio scan. I miss this feature greatly, and my hearing impaired users are unhappy that there seem to be no subtitles on anything added in the past few weeks (since one of the recent Handbrake updates, but not sure which -- it was working so well, I foolishly started to trust it and stopped checking every. single. file. that I converted. Sigh. I need to remember that updates often break as much as they fix.

[EDIT: Sorry. Somehow I completely misread the line @galad87 quoted to me as meaning the exact opposite. I guess the question becomes: Is there any way (or tool) to convert the PGS subtitles into something Handbrake can use?]

galad87 commented 2 years ago

From the docs: "You can not pass-through PGS into MP4 as this file format does not support it."

sr55 commented 2 years ago

Agreed @KWierso

I've put a message box prompt in. It's not the nicest thing but it's probably better than a silent failure. Doesn't apply to automatically adding tracks so it shouldn't be overly obnoxious but I may revisit with a nicer Ui at some point.

nurbles commented 2 years ago

Thanks for the message, at least there will be a reminder.

This is probably out of the question, but just in case... The Subtitle Edit program can do OCR on the PGS subtitles to convert them to SRT and it has a library [LibSe.dll] available to allow the function to be integrated into other packages (like Handbrake?) At least, that's the way I understood it. You can take a look at it here: https://www.nikse.dk/subtitleedit. Unfortunately, it appears to be only for Windows (but the source is available) which is probably a dealbreaker, even if the handbrake developers were interested. FWIW, I've tried it on a few movies so far and I've seen only one OCR character mistake and many extra spaces within/around words, but it is far, far better than just having nothing. If nothing else, maybe the new message handbrake provides could include a link to a page on the handbrake website with some options for converting subtitles to help people get started?

sr55 commented 2 years ago

We'd consider that out of scope for the project.