Cannot add srt file to mp4 video.

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
MHHMHH
Posts: 34
Joined: Fri Jul 10, 2020 10:56 pm

Cannot add srt file to mp4 video.

Post by MHHMHH »

Description of problem or question:
I made a very short mp4 file and an associated srt file for testing. Both of these files play perfectly in VLC. In Handbrake I open the single mp4 file and import the srt file. Handbrake processes these files and the result is a file with an mp4 extension The plays but with only the first sub title appearing. I have done this successfully for years and it has suddenly stopped working. My aim is to produce a soft coded file, so I can use them in my Plex server.



Steps to reproduce the problem (If Applicable):




HandBrake version (e.g., 1.0.0):
1.2.0



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



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

Code: Select all

HandBrake 1.2.0 (2018121700)
OS: Microsoft Windows NT 10.0.19041.0
Ram: 8073 MB, 
GPU Information:
  Intel(R) HD Graphics 3000 - 9.17.10.4459
  NVIDIA NVS 4200M     - 10.18.13.5362
Screen: 1920x1080
Temp Dir: C:\Users\mhhac\AppData\Local\Temp\
Install Dir: C:\Program Files\HandBrake
Data Dir: C:\Users\mhhac\AppData\Roaming\HandBrake

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


# Starting Encode ...

[10:41:18] hb_init: starting libhb thread
[10:41:18] 1 job(s) to process
[10:41:18] json job:
{
  "Audio": {
    "AudioList": [
      {
        "Bitrate": 160,
        "DRC": 0.0,
        "Encoder": "av_aac",
        "Gain": 0.0,
        "Mixdown": 4,
        "NormalizeMixLevel": false,
        "Samplerate": 0,
        "Track": 0,
        "DitherMethod": 0
      }
    ],
    "CopyMask": [
      "copy:aac",
      "copy:ac3",
      "copy:dtshd",
      "copy:dts",
      "copy:eac3",
      "copy:flac",
      "copy:mp3",
      "copy:truehd"
    ],
    "FallbackEncoder": "ac3"
  },
  "Destination": {
    "ChapterList": [
      {
        "Name": "Chapter 1"
      }
    ],
    "ChapterMarkers": true,
    "AlignAVStart": true,
    "File": "C:\\Users\\mhhac\\Videos\\1280-1.mp4",
    "Mp4Options": {
      "IpodAtom": false,
      "Mp4Optimize": false
    },
    "Mux": "mp4"
  },
  "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": "0",
          "crop-left": "0",
          "crop-right": "0",
          "crop-top": "0",
          "height": "720",
          "width": "1280"
        }
      },
      {
        "ID": 6,
        "Settings": {
          "mode": "2",
          "rate": "27000000/900000"
        }
      }
    ]
  },
  "PAR": {
    "Num": 120,
    "Den": 91
  },
  "Metadata": {},
  "SequenceID": 0,
  "Source": {
    "Angle": 1,
    "Range": {
      "Type": "chapter",
      "Start": 1,
      "End": 1
    },
    "Title": 1,
    "Path": "C:\\Users\\mhhac\\Desktop\\1280.mp4"
  },
  "Subtitle": {
    "Search": {
      "Burn": true,
      "Default": false,
      "Enable": true,
      "Forced": true
    },
    "SubtitleList": [
      {
        "Burn": false,
        "Default": false,
        "Forced": false,
        "ID": 0,
        "Offset": 0,
        "Track": -1,
        "SRT": {
          "Codeset": "UTF-8",
          "Filename": "C:\\Users\\mhhac\\Desktop\\1280.srt",
          "Language": "eng"
        }
      }
    ]
  },
  "Video": {
    "Encoder": "x264",
    "Level": "4.0",
    "TwoPass": false,
    "Turbo": false,
    "ColorMatrixCode": 0,
    "Options": "",
    "Preset": "fast",
    "Profile": "main",
    "Quality": 22.0,
    "QSV": {
      "Decode": false,
      "AsyncDepth": 0
    }
  }
}
[10:41:18] CPU: Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
[10:41:18]  - Intel microarchitecture Sandy Bridge
[10:41:18]  - logical processor count: 8
[10:41:18] Intel Quick Sync Video support: no
[10:41:18] hb_scan: path=C:\Users\mhhac\Desktop\1280.mp4, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
src/libbluray/disc/disc.c:323: failed opening UDF image C:\Users\mhhac\Desktop\1280.mp4
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
[10:41:18] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.0
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
[10:41:18] dvd: not a dvd - trying as a stream/file instead
Input #0, mov,mp4,m4a,3gp,3g2,mj2, from 'C:\Users\mhhac\Desktop\1280.mp4':
  Metadata:
    major_brand     : isom
    minor_version   : 512
    compatible_brands: isomiso2avc1mp41
    encoder         : Lavf58.17.101
  Duration: 00:00:52.17, start: 0.000000, bitrate: 2271 kb/s
    Stream #0:0(und): Video: h264 (Constrained Baseline) (avc1 / 0x31637661), yuv420p, 1280x720 [SAR 120:91 DAR 640:273], 2139 kb/s, 24 fps, 24 tbr, 12288 tbn, 48 tbc (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc.
    Stream #0:1(und): Audio: aac (LC) (mp4a / 0x6134706D), 44100 Hz, stereo, fltp, 127 kb/s (default)
    Metadata:
      handler_name    : ISO Media file produced by Google Inc.
[10:41:18] scan: decoding previews for title 1
[10:41:18] scan: audio 0x1: aac, rate=44100Hz, bitrate=127860 Unknown (AAC LC) (2.0 ch)
[10:41:19] scan: 10 previews, 1280x720, 24.000 fps, autocrop = 0/0/0/0, aspect 2.34:1, PAR 120:91
[10:41:19] scan: supported video decoders: avcodec qsv
[10:41:19] libhb: scan thread found 1 valid title(s)
[10:41:19] Skipping subtitle scan.  No suitable subtitle tracks.
[10:41:19] starting job
[10:41:19] decomb filter thread started for segment 0
[10:41:19] decomb filter thread started for segment 1
[10:41:19] decomb filter thread started for segment 2
[10:41:19] decomb filter thread started for segment 3
[10:41:19] decomb filter thread started for segment 4
[10:41:19] decomb filter thread started for segment 5
[10:41:19] decomb filter thread started for segment 6
[10:41:19] decomb filter thread started for segment 7
[10:41:19] decomb check thread started for segment 0
[10:41:19] decomb check thread started for segment 1
[10:41:19] decomb check thread started for segment 2
[10:41:19] decomb check thread started for segment 3
[10:41:19] decomb check thread started for segment 4
[10:41:19] decomb check thread started for segment 5
[10:41:19] decomb check thread started for segment 6
[10:41:19] decomb check thread started for segment 7
[10:41:19] mask filter thread started for segment 0
[10:41:19] mask filter thread started for segment 1
[10:41:19] mask filter thread started for segment 2
[10:41:19] mask filter thread started for segment 3
[10:41:19] mask filter thread started for segment 4
[10:41:19] mask filter thread started for segment 5
[10:41:19] mask filter thread started for segment 6
[10:41:19] mask filter thread started for segment 7
[10:41:19] mask erode thread started for segment 0
[10:41:19] mask erode thread started for segment 1
[10:41:19] mask erode thread started for segment 2
[10:41:19] mask erode thread started for segment 3
[10:41:19] mask erode thread started for segment 4
[10:41:19] mask erode thread started for segment 5
[10:41:19] mask erode thread started for segment 6
[10:41:19] mask erode thread started for segment 7
[10:41:19] mask dilate thread started for segment 0
[10:41:19] mask dilate thread started for segment 1
[10:41:19] mask dilate thread started for segment 2
[10:41:19] mask dilate thread started for segment 3
[10:41:19] mask dilate thread started for segment 4
[10:41:19] mask dilate thread started for segment 5
[10:41:19] mask dilate thread started for segment 6
[10:41:19] mask dilate thread started for segment 7
[10:41:19] yadif thread started for segment 0
[10:41:19] yadif thread started for segment 1
[10:41:19] yadif thread started for segment 2
[10:41:19] yadif thread started for segment 3
[10:41:19] yadif thread started for segment 4
[10:41:19] yadif thread started for segment 5
[10:41:19] yadif thread started for segment 6
[10:41:19] yadif thread started for segment 7
[10:41:19] work: only 1 chapter, disabling chapter markers
[10:41:19] job configuration:
[10:41:19]  * source
[10:41:19]    + C:\Users\mhhac\Desktop\1280.mp4
[10:41:19]    + title 1, chapter(s) 1 to 1
[10:41:19]    + container: mov,mp4,m4a,3gp,3g2,mj2
[10:41:19]    + data rate: 2271 kbps
[10:41:19]  * destination
[10:41:19]    + C:\Users\mhhac\Videos\1280-1.mp4
[10:41:19]    + container: MPEG-4 (libavformat)
[10:41:19]      + align initial A/V stream timestamps
[10:41:19]  * video track
[10:41:19]    + decoder: h264
[10:41:19]      + bitrate 2139 kbps
[10:41:19]    + filters
[10:41:19]      + 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)
[10:41:19]      + Decomb (mode=39)
[10:41:19]      + Framerate Shaper (mode=2:rate=27000000/900000)
[10:41:19]        + frame rate: 24.000 fps -> peak rate limited to 30.000 fps
[10:41:19]      + Crop and Scale (width=1280:height=720:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[10:41:19]        + source: 1280 * 720, crop (0/0/0/0): 1280 * 720, scale: 1280 * 720
[10:41:19]    + Output geometry
[10:41:19]      + storage dimensions: 1280 x 720
[10:41:19]      + pixel aspect ratio: 120 : 91
[10:41:19]      + display dimensions: 1687 x 720
[10:41:19]    + encoder: H.264 (libx264)
[10:41:19]      + preset:  fast
[10:41:19]      + profile: main
[10:41:19]      + level:   4.0
[10:41:19]      + quality: 22.00 (RF)
[10:41:19]      + color profile: 1-1-1
[10:41:19]  * subtitle track 1, English [SRT] (track 0, id 0xff, Text) -> Passthrough, offset: 0, charset: UTF-8
[10:41:19]  * audio track 1
[10:41:19]    + decoder: Unknown (AAC LC) (2.0 ch) (track 1, id 0x1)
[10:41:19]      + bitrate: 127 kbps, samplerate: 44100 Hz
[10:41:19]    + mixdown: Stereo
[10:41:19]    + dither: none
[10:41:19]    + encoder: AAC (libavcodec)
[10:41:19]      + bitrate: 160 kbps, samplerate: 44100 Hz
[10:41:19] sync: expecting 1252 video frames
[10:41:19] encx264: min-keyint: 24, keyint: 240
[10:41:19] encx264: encoding at constant RF 22.000000
[10:41:19] 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=120/91
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX
x264 [info]: profile Main, level 4.0, 4:2:0, 8-bit
[10:41:19] sync: first pts video is 0
[10:41:19] sync: "Chapter 1" (1) at frame 1 time 0
[10:41:19] sync: first pts audio 0x1 is 0
[10:41:31] sync: first pts subtitle 0xff is 2583360
[10:41:41] reader: done. 1 scr changes
[10:41:42] work: average encoding speed for job is 50.560013 fps
[10:41:42] comb detect: heavy 0 | light 2 | uncombed 1250 | total 1252
[10:41:42] decomb: deinterlaced 0 | blended 2 | unfiltered 1250 | total 1252
[10:41:42] vfr: 1252 frames output, 0 dropped and 0 duped for CFR/PFR
[10:41:42] vfr: lost time: 0 (0 frames)
[10:41:42] vfr: gained time: 0 (0 frames) (0 not accounted for)
[10:41:42] aac-decoder done: 2246 frames, 0 decoder errors
[10:41:42] h264-decoder done: 1252 frames, 0 decoder errors
[10:41:42] sync: got 1252 frames, 1252 expected
[10:41:42] sync: framerate min 15.414 fps, max 24.000 fps, avg 23.989 fps
x264 [info]: frame I:27    Avg QP:13.10  size: 15301
x264 [info]: frame P:472   Avg QP:18.41  size: 10611
x264 [info]: frame B:753   Avg QP:18.15  size:  4499
x264 [info]: consecutive B-frames: 15.5%  8.8% 12.5% 63.3%
x264 [info]: mb I  I16..4: 77.5%  0.0% 22.5%
x264 [info]: mb P  I16..4: 28.1%  0.0%  6.3%  P16..4: 27.1%  6.5%  2.0%  0.0%  0.0%    skip:30.0%
x264 [info]: mb B  I16..4:  9.5%  0.0%  0.6%  B16..8: 20.0%  3.8%  0.1%  direct:11.9%  skip:54.1%  L0:57.2% L1:35.9% BI: 6.9%
x264 [info]: coded y,uvDC,uvAC intra: 11.3% 35.0% 4.9% inter: 5.9% 21.2% 0.1%
x264 [info]: i16 v,h,dc,p: 48% 25% 13% 14%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 29% 17% 28%  5%  5%  5%  4%  5%  2%
x264 [info]: i8c dc,h,v,p: 64% 15% 17%  3%
x264 [info]: Weighted P-Frames: Y:36.2% UV:22.2%
x264 [info]: ref P L0: 86.2% 13.8%
x264 [info]: ref B L0: 87.5% 12.5%
x264 [info]: ref B L1: 97.4%  2.6%
x264 [info]: kb/s:1350.37
[10:41:42] mux: track 0, 1252 frames, 8808664 bytes, 1349.77 kbps, fifo 2048
[10:41:42] mux: track 1, 2247 frames, 1031685 bytes, 158.09 kbps, fifo 4096
[10:41:42] mux: track 2, 1 frames, 25 bytes, 0.00 kbps, fifo 8
[10:41:42] libhb: work result = 0

# Encode Completed ...


MHHMHH
Posts: 34
Joined: Fri Jul 10, 2020 10:56 pm

Re: Cannot add srt file to mp4 video.

Post by MHHMHH »

Formerly when this was working the output file was an MPV file.
Silent_Strider
Posts: 26
Joined: Tue Dec 17, 2019 9:31 pm

Re: Cannot add srt file to mp4 video.

Post by Silent_Strider »

I'm not sure if MP4 natively can even work with SRT subtitles.

At least it seems not written in the specifications on Wiki: https://en.wikipedia.org/wiki/MPEG-4_Pa ... ta_streams
User avatar
Rodeo
HandBrake Team
Posts: 12626
Joined: Tue Mar 03, 2009 8:55 pm

Re: Cannot add srt file to mp4 video.

Post by Rodeo »

MHHMHH wrote: Sat Jul 11, 2020 2:59 pm

Code: Select all

[10:41:42] mux: track 2, 1 frames, 25 bytes, 0.00 kbps, fifo 8
Looks like there's only one subtitle packet in the output. My guess is your SRT file isn't UTF-8 encoded.
MHHMHH
Posts: 34
Joined: Fri Jul 10, 2020 10:56 pm

Re: Cannot add srt file to mp4 video.

Post by MHHMHH »

Thanks all. I've got it working - had to make two changes. First, I made surfe that the srt file was utf-8 encoded (checked it online), and second, when I loaded the mp4 file I had the choice of mp4 or mkv. This time I chose mkv, and it all worked - I had a soft coded file as output.

Thanks again for pointing me in the right direction.
MHHMHH
MHHMHH
Posts: 34
Joined: Fri Jul 10, 2020 10:56 pm

Re: Cannot add srt file to mp4 video.

Post by MHHMHH »

I don't remember having to choose MKV when I input the mp4 file. Is it possible that a newer version would do this automatically, or can i set it in preferences?
THANKS
mduell
Veteran User
Posts: 7266
Joined: Sat Apr 21, 2007 8:54 pm

Re: Cannot add srt file to mp4 video.

Post by mduell »

The selection of output container has nothing to do with solving your subtitle problem. You can put text subs in MP4, but you have to choose the text encoding correctly for any container.
Post Reply