Subtitle problem

Support for HandBrake on Linux, Solaris, and other Unix-like platforms
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
Quasi72
Posts: 8
Joined: Mon Feb 13, 2023 5:11 pm

Subtitle problem

Post by Quasi72 »

Description of problem or question:
The subtitles are not in the center of screen (far left of the screen) and they have shadows.

[img]file:///home/alex/Afbeeldingen/test.png[/img]



Steps to reproduce the problem (If Applicable):
Add subtitle from .srt



HandBrake version (e.g., 1.0.0):
Flatpak 1.6.1 (and also 1.6.0)

When i use the PPA from ubuntu (handbrake 1.5.1) i don't have this issue. (but this one segfaults on a regular base)



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



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

Code: Select all

Handbrake Version: 1.6.1 (2023012300)
[17:57:42] gtkgui: Preset: /Matroska/H.264 MKV 720p30
[17:57:42] Starting work at: Mon Feb 13 17:57:42 2023

[17:57:42] 1 job(s) to process
[17:57:42] json job:
{
    "Audio": {
        "AudioList": [
            {
                "Bitrate": 160,
                "CompressionLevel": -1.0,
                "DRC": 0.0,
                "DitherMethod": "auto",
                "Encoder": "av_aac",
                "Gain": 0.0,
                "Mixdown": "stereo",
                "NormalizeMixLevel": false,
                "PresetEncoder": "av_aac",
                "Quality": -3.0,
                "Samplerate": 0,
                "Track": 0
            }
        ],
        "CopyMask": [
            "copy:aac"
        ],
        "FallbackEncoder": "av_aac"
    },
    "Destination": {
        "AlignAVStart": false,
        "ChapterList": [
            {
                "Duration": {
                    "Hours": 0,
                    "Minutes": 53,
                    "Seconds": 37,
                    "Ticks": 289548810
                },
                "Name": ""
            }
        ],
        "ChapterMarkers": false,
        "File": "/home/alex/Data/Gecodeerd/test (1).mkv",
        "InlineParameterSets": false,
        "Mp4Options": {
            "IpodAtom": false,
            "Mp4Optimize": false
        },
        "Mux": "mkv"
    },
    "Filters": {
        "FilterList": [
            {
                "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": 4,
                "Settings": {
                    "mode": "7"
                }
            },
            {
                "ID": 7,
                "Settings": {
                    "mode": 2,
                    "rate": "27000000/900000"
                }
            },
            {
                "ID": 14,
                "Settings": {
                    "crop-bottom": 0,
                    "crop-left": 0,
                    "crop-right": 0,
                    "crop-top": 0,
                    "height": 720,
                    "width": 1280
                }
            }
        ]
    },
    "Metadata": {
        "Name": "test"
    },
    "PAR": {
        "Den": 8,
        "Num": 9
    },
    "SequenceID": 0,
    "Source": {
        "Angle": 0,
        "Path": "/home/alex/Data/Coderen/test.mkv",
        "Range": {
            "End": 1,
            "Start": 1,
            "Type": "chapter"
        },
        "Title": 1
    },
    "Subtitle": {
        "Search": {
            "Burn": true,
            "Default": false,
            "Enable": false,
            "Forced": true
        },
        "SubtitleList": [
            {
                "Burn": false,
                "Default": true,
                "Forced": false,
                "Import": {
                    "Codeset": "UTF-8",
                    "Filename": "/home/alex/Data/Coderen/test.srt",
                    "Format": "SRT",
                    "Language": "nld"
                },
                "Name": "Nederlands",
                "Offset": 0,
                "Track": 0
            }
        ]
    },
    "Video": {
        "ChromaLocation": 1,
        "ColorInputFormat": 0,
        "ColorMatrix": 1,
        "ColorOutputFormat": 0,
        "ColorPrimaries": 1,
        "ColorRange": 1,
        "ColorTransfer": 1,
        "Encoder": "x264",
        "HardwareDecode": 0,
        "Level": "3.1",
        "Options": "",
        "Preset": "medium",
        "Profile": "main",
        "QSV": {
            "AdapterIndex": 0,
            "AsyncDepth": 0,
            "Decode": false
        },
        "Quality": 21.0,
        "Tune": "",
        "Turbo": false,
        "TwoPass": false
    }
}
[17:57:42] CPU: Intel(R) Core(TM) i7-6700 CPU @ 3.40GHz
[17:57:42]  - Intel microarchitecture Skylake
[17:57:42]  - logical processor count: 8
[17:57:42] Intel Quick Sync Video support: no
[17:57:42] hb_scan: path=/home/alex/Data/Coderen/test.mkv, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:333: failed opening UDF image /home/alex/Data/Coderen/test.mkv
disc.c:437: error opening file BDMV/index.bdmv
disc.c:437: error opening file BDMV/BACKUP/index.bdmv
[17:57:42] bd: not a bd - trying as a stream/file instead
libdvdread: DVDOpenFileUDF:UDFFindFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav: vm: vm: failed to read VIDEO_TS.IFO
[17:57:42] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from '/home/alex/Data/Coderen/test.mkv':
  Metadata:
    encoder         : libebml v1.4.2 + libmatroska v1.6.4
    creation_time   : 2022-03-31T06:41:12.000000Z
  Duration: 00:53:37.21, start: 0.000000, bitrate: 7474 kb/s
  Stream #0:0(eng): Video: h264 (High), yuv420p(tv, bt709, progressive), 1920x960 [SAR 1:1 DAR 2:1], 24 fps, 24 tbr, 1k tbn (default)
    Metadata:
      BPS             : 6832182
      DURATION        : 00:53:37.209000000
      NUMBER_OF_FRAMES: 77213
      NUMBER_OF_BYTES : 2747570022
      _STATISTICS_WRITING_APP: mkvmerge v66.0.0 ('Josie') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2022-03-31 06:41:12
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:1(eng): Audio: eac3, 48000 Hz, 5.1(side), fltp, 640 kb/s (default)
    Metadata:
      BPS             : 640000
      DURATION        : 00:53:37.184000000
      NUMBER_OF_FRAMES: 100537
      NUMBER_OF_BYTES : 257374720
      _STATISTICS_WRITING_APP: mkvmerge v66.0.0 ('Josie') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2022-03-31 06:41:12
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
  Stream #0:2(eng): Subtitle: subrip
    Metadata:
      title           : English
      BPS             : 52
      DURATION        : 00:51:39.661000000
      NUMBER_OF_FRAMES: 738
      NUMBER_OF_BYTES : 20524
      _STATISTICS_WRITING_APP: mkvmerge v66.0.0 ('Josie') 64-bit
      _STATISTICS_WRITING_DATE_UTC: 2022-03-31 06:41:12
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
[17:57:42] scan: decoding previews for title 1
[17:57:42] scan: audio 0x1: eac3, rate=48000Hz, bitrate=640000 English (E-AC3) (5.1 ch) (640 kbps)
[17:57:42] scan: 10 previews, 1920x960, 24,000 fps, autocrop = 0/0/0/0, aspect 2,00:1, PAR 1:1, color profile: 1-1-1, chroma location: left
[17:57:42] libhb: scan thread found 1 valid title(s)
[17:57:42] Starting Task: Encoding Pass
[17:57:42] job configuration:
[17:57:42]  * source
[17:57:42]    + /home/alex/Data/Coderen/test.mkv
[17:57:42]    + title 1, chapter(s) 1 to 1
[17:57:42]    + container: matroska,webm
[17:57:42]    + data rate: 7474 kbps
[17:57:42]  * destination
[17:57:42]    + /home/alex/Data/Gecodeerd/test (1).mkv
[17:57:42]    + container: Matroska (libavformat)
[17:57:42]  * video track
[17:57:42]    + decoder: h264 8-bit (yuv420p)
[17:57:42]    + filters
[17:57:42]      + 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)
[17:57:42]      + Decomb (mode=39)
[17:57:42]      + Framerate Shaper (mode=2:rate=27000000/900000)
[17:57:42]        + frame rate: 24,000 fps -> peak rate limited to 30,000 fps
[17:57:42]      + Crop and Scale (width=1280:height=720:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[17:57:42]        + source: 1920 * 960, crop (0/0/0/0): 1920 * 960, scale: 1280 * 720
[17:57:42]    + Output geometry
[17:57:42]      + storage dimensions: 1280 x 720
[17:57:42]      + pixel aspect ratio: 9 : 8
[17:57:42]      + display dimensions: 1440 x 720
[17:57:42]    + encoder: H.264 (libx264)
[17:57:42]      + preset:  medium
[17:57:42]      + profile: main
[17:57:42]      + level:   3.1
[17:57:42]      + quality: 21,00 (RF)
[17:57:42]      + color profile: 1-1-1
[17:57:42]      + chroma location: left
[17:57:42]  * subtitle track 1, Nederlands [SRT] (track 0, id 0xff000000, Text) -> Passthrough, Default, offset: 0, charset: UTF-8
[17:57:42]    + name: Nederlands
[17:57:42]  * audio track 1
[17:57:42]    + decoder: English (E-AC3) (5.1 ch) (640 kbps) (track 1, id 0x1)
[17:57:42]      + bitrate: 640 kbps, samplerate: 48000 Hz
[17:57:42]    + mixdown: Stereo
[17:57:42]    + encoder: AAC (libavcodec)
[17:57:42]      + bitrate: 160 kbps, samplerate: 48000 Hz
[17:57:42] sync: expecting 77213 video frames
[17:57:42] encx264: min-keyint: 24, keyint: 240
[17:57:42] encx264: encoding at constant RF 21,000000
[17:57:42] encx264: unparsed options: level=3.1:8x8dct=0:vbv-bufsize=14000:vbv-maxrate=14000
x264 [info]: using SAR=9/8
x264 [info]: using cpu capabilities: MMX2 SSE2Fast SSSE3 SSE4.2 AVX FMA3 BMI2 AVX2 UnalignedStack
x264 [info]: profile Main, level 3.1, 4:2:0, 8-bit
[17:57:42] sync: first pts video is 0
[17:57:42] sync: Chapter 1 at frame 1 time 0
[17:57:42] sync: first pts audio 0x1 is 0
[17:57:42] sync: first pts subtitle 0xff000000 is 65880
[17:58:07] work: average encoding speed for job is 58,857189 fps
[17:58:07] comb detect: heavy 7 | light 54 | uncombed 1388 | total 1449
[17:58:07] decomb: deinterlaced 7 | blended 54 | unfiltered 1383 | total 1444
[17:58:07] vfr: 1435 frames output, 0 dropped and 0 duped for CFR/PFR
[17:58:07] vfr: lost time: 0 (0 frames)
[17:58:07] vfr: gained time: 0 (0 frames) (0 not accounted for)
[17:58:07] eac3-decoder done: 1985 frames, 0 decoder errors
[17:58:07] h264-decoder done: 1512 frames, 0 decoder errors
[17:58:07] sync: got 1473 frames, 77213 expected
[17:58:07] sync: framerate min 24,000 fps, max 24,000 fps, avg 24,000 fps
x264 [info]: frame I:48    Avg QP:17,99  size: 74007
x264 [info]: frame P:409   Avg QP:21,03  size: 22855
x264 [info]: frame B:913   Avg QP:22,41  size:  7223
x264 [info]: consecutive B-frames:  8,5%  5,1%  8,1% 78,2%
x264 [info]: mb I  I16..4: 28,9%  0,0% 71,1%
x264 [info]: mb P  I16..4:  9,0%  0,0% 13,2%  P16..4: 35,4% 12,7%  7,9%  0,0%  0,0%    skip:21,9%
x264 [info]: mb B  I16..4:  0,7%  0,0%  2,0%  B16..8: 43,2%  4,8%  0,9%  direct: 3,0%  skip:45,4%  L0:43,5% L1:50,2% BI: 6,3%
x264 [info]: coded y,uvDC,uvAC intra: 61,9% 64,2% 30,0% inter: 10,5% 18,1% 0,7%
x264 [info]: i16 v,h,dc,p: 36% 23%  7% 34%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 20% 17% 17%  7% 11%  8%  8%  7%  5%
x264 [info]: i8c dc,h,v,p: 53% 19% 20%  8%
x264 [info]: Weighted P-Frames: Y:6,1% UV:5,1%
x264 [info]: ref P L0: 66,0% 14,1% 13,7%  5,9%  0,4%
x264 [info]: ref B L0: 91,3%  7,1%  1,6%
x264 [info]: ref B L1: 96,4%  3,6%
x264 [info]: kb/s:2732,13
[17:58:07] mux: track 0, 1368 frames, 19487354 bytes, 2557,47 kbps, fifo 1024
[17:58:07] mux: track 1, 2856 frames, 1253230 bytes, 164,47 kbps, fifo 4096
[17:58:07] mux: track 2, 15 frames, 1092 bytes, 0,14 kbps, fifo 16
[17:58:07] Finished work at: Mon Feb 13 17:58:07 2023

[17:58:07] libhb: work result = 1

mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Subtitle problem

Post by mduell »

Since HB is just passing through the text, your player is selecting location and font styling.
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Subtitle problem

Post by Woodstock »

Is your problem that the subtitles have shadows (which is based on the fact that your display system generates them) or that your system is crashing?

The log shows that the encode did not complete, and it reported an error in the subtitle stream just before it ended. Which are we supposed to be looking at?
User avatar
s55
HandBrake Team
Posts: 10350
Joined: Sun Dec 24, 2006 1:05 pm

Re: Subtitle problem

Post by s55 »

Error code 1 = User Cancelled. (Probably to generate that log)
Quasi72
Posts: 8
Joined: Mon Feb 13, 2023 5:11 pm

Re: Subtitle problem

Post by Quasi72 »

Hi,

thx for the reply's.

@mduell : If it's the player choosing the location and styling then why do i have a different result when using HB 1.5.1 ppa vs HB 1.6.1 flatpak (same system) ? Same source files are used, same player (VLC) to play the end result. That's what's bothering me.

@woodstock : i just stopped the encoding after a few moments, no crashes or anything weird going on. This behavior can be observed on different presets.

I do have a screenshot but i haven't figured out yet how to post this in my reply's.
Quasi72
Posts: 8
Joined: Mon Feb 13, 2023 5:11 pm

Re: Subtitle problem

Post by Quasi72 »

@mduell : i tried a burn into video and got the same result, subs in the far left bottom corner of the video and annoying shading beneath it so this has nothing to do with the player (unless i misunderstand the burn in to video part).
It feels like HB flatpak uses some other way to handle subs (just a feeling, could be way of :) )
Deleted User 11865

Re: Subtitle problem

Post by Deleted User 11865 »

Quasi72 wrote: Mon Feb 13, 2023 8:41 pm @mduell : If it's the player choosing the location and styling then why do i have a different result when using HB 1.5.1 ppa vs HB 1.6.1 flatpak (same system) ? Same source files are used
We need to see the encode logs for both 1.5.1 and 1.6.1 on the same source to see what's happening.
Quasi72
Posts: 8
Joined: Mon Feb 13, 2023 5:11 pm

Re: Subtitle problem

Post by Quasi72 »

Hi, I've done some sample encodes, zipped them up and wetransferred them to myself.

Download link : https://we.tl/t-iOcuVAdV0N

about 70MB and includes a few sample encodes using the 1.5.1 and 1.6.1, when i play this using VLC i get different views of the subs.
The test .srt and encode logs are also included....thx for looking in to this.
User avatar
Ritsuka
HandBrake Team
Posts: 1650
Joined: Fri Jan 12, 2007 11:29 am

Re: Subtitle problem

Post by Ritsuka »

It's a locale issue, it seems it's using a "," to separate the decimal numbers instead of "." at line https://github.com/HandBrake/HandBrake/ ... on.c#L5288

Anyone remember how printf locale works?
Quasi72
Posts: 8
Joined: Mon Feb 13, 2023 5:11 pm

Re: Subtitle problem

Post by Quasi72 »

Ok, i thought flatpak should use my systems locale....? To be honest i dabble a bit with linux but i'm no way near an experienced user.

System locale :

LANG=nl_BE.UTF-8
LANGUAGE=nl_BE:nl
LC_CTYPE="nl_BE.UTF-8"
LC_NUMERIC="nl_BE.UTF-8"
LC_TIME="nl_BE.UTF-8"
LC_COLLATE="nl_BE.UTF-8"
LC_MONETARY="nl_BE.UTF-8"
LC_MESSAGES="nl_BE.UTF-8"
LC_PAPER="nl_BE.UTF-8"
LC_NAME="nl_BE.UTF-8"
LC_ADDRESS="nl_BE.UTF-8"
LC_TELEPHONE="nl_BE.UTF-8"
LC_MEASUREMENT="nl_BE.UTF-8"
LC_IDENTIFICATION="nl_BE.UTF-8"
LC_ALL=


Flatpak setting was :

languages: *unset* (default: nl)
extra-languages: *unset*

is now

languages: be (default: nl)
extra-languages: *unset*

still the same issue...and i'm not even sure if this is something that i can remedy or is this something that should be fixed in the flatpak ?

Anyway thx again for helping.
User avatar
Ritsuka
HandBrake Team
Posts: 1650
Joined: Fri Jan 12, 2007 11:29 am

Re: Subtitle problem

Post by Ritsuka »

I think the issue is that it uses your locale, and so it's using the wrong separator when creating the subtitles header.
Quasi72
Posts: 8
Joined: Mon Feb 13, 2023 5:11 pm

Re: Subtitle problem

Post by Quasi72 »

Seems logical but if the ppa HB has no issue and the flatpak HB encounters this....i feel this is a flatpak issue and not something i can resolve...
I will try a clean install this weekend (try some other OS language/locale) unless someone has some pointers for me ?
User avatar
Ritsuka
HandBrake Team
Posts: 1650
Joined: Fri Jan 12, 2007 11:29 am

Re: Subtitle problem

Post by Ritsuka »

1.5.1 generated the subtitles SSA header in a different way, so it didn't have this issue.
I'll change it to use a locale independent conversion, hopefully making it in 1.6.2.
Quasi72
Posts: 8
Joined: Mon Feb 13, 2023 5:11 pm

Re: Subtitle problem

Post by Quasi72 »

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

Re: Subtitle problem

Post by Ritsuka »

Fixed in https://github.com/HandBrake/HandBrake/ ... 717803b7da
I don't know if the Linux snapshot has been updated yet.
Quasi72
Posts: 8
Joined: Mon Feb 13, 2023 5:11 pm

Re: Subtitle problem

Post by Quasi72 »

Hey Ritsuka,

The latest nightly snapshot has resolved the issue, thx for the quick fix :)
Post Reply