converting mkv to mp4 resulted in bigger output file

Discussion of the HandBrake command line interface (CLI)
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
kima
Posts: 1
Joined: Mon Dec 21, 2020 2:50 pm

converting mkv to mp4 resulted in bigger output file

Post by kima »

Description of problem or question:
I tried to convert a mkv file into mp4 for reducing size and I got a bigger file than the original.

I also have problem trying to keep the subtitles. I'd like to keep both the spanish and english ones, but I didn't succeed with the options I used.

The scan of the original file:

Code: Select all

HandBrakeCLI -i Test_file.mkv --scan
[15:52:26] hb_init: starting libhb thread
[15:52:26] thread 7fa168ce7700 started ("libhb")
HandBrake 1.1.0 (2018042400) - Linux x86_64 - https://handbrake.fr
8 CPUs detected
Opening Test_file.mkv...
[15:52:26] CPU: Intel(R) Xeon(R) W-2123 CPU @ 3.60GHz
[15:52:26]  - logical processor count: 8
[15:52:26] hb_scan: path=Test_file.mkv, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:323: failed opening UDF image 1x01 - Piloto (Parte 1).mkv
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
[15:52:26] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.0
libdvdread: Encrypted DVD support unavailable.
************************************************
**                                            **
**  No css library available. See             **
**  /usr/share/doc/libdvdread4/README.css     **
**  for more information.                     **
**                                            **
************************************************
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
[15:52:26] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from 'Test_file.mkv':
  Metadata:
    encoder         : libebml v1.3.4 + libmatroska v1.4.5
    creation_time   : 2017-01-07T17:50:36.000000Z
  Duration: 00:42:20.58, start: 0.000000, bitrate: 3267 kb/s
    Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
    Metadata:
      BPS             : 2497707
      BPS-eng         : 2497707
      DURATION        : 00:42:20.538000000
      DURATION-eng    : 00:42:20.538000000
      NUMBER_OF_FRAMES: 60912
      NUMBER_OF_FRAMES-eng: 60912
      NUMBER_OF_BYTES : 793190003
      NUMBER_OF_BYTES-eng: 793190003
      _STATISTICS_WRITING_APP: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-01-07 17:50:36
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-01-07 17:50:36
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(spa): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
    Metadata:
      title           : Castellano AC3 5.1 @ 384 kbps
      BPS             : 384000
      BPS-eng         : 384000
      DURATION        : 00:42:20.480000000
      DURATION-eng    : 00:42:20.480000000
      NUMBER_OF_FRAMES: 79390
      NUMBER_OF_FRAMES-eng: 79390
      NUMBER_OF_BYTES : 121943040
      NUMBER_OF_BYTES-eng: 121943040
      _STATISTICS_WRITING_APP: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-01-07 17:50:36
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-01-07 17:50:36
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
    Metadata:
      title           : Inglés AC3 5.1 @ 384 kbs
      BPS             : 384000
      BPS-eng         : 384000
      DURATION        : 00:42:20.576000000
      DURATION-eng    : 00:42:20.576000000
      NUMBER_OF_FRAMES: 79393
      NUMBER_OF_FRAMES-eng: 79393
      NUMBER_OF_BYTES : 121947648
      NUMBER_OF_BYTES-eng: 121947648
      _STATISTICS_WRITING_APP: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-01-07 17:50:36
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-01-07 17:50:36
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:3(spa): Subtitle: subrip (default) (forced)
    Metadata:
      title           : Forzados
      BPS             : 0
      BPS-eng         : 0
      DURATION        : 00:41:56.501000000
      DURATION-eng    : 00:41:56.501000000
      NUMBER_OF_FRAMES: 8
      NUMBER_OF_FRAMES-eng: 8
      NUMBER_OF_BYTES : 174
      NUMBER_OF_BYTES-eng: 174
      _STATISTICS_WRITING_APP: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-01-07 17:50:36
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-01-07 17:50:36
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:4(spa): Subtitle: subrip
    Metadata:
      title           : Castellano Completo
      BPS             : 29
      BPS-eng         : 29
      DURATION        : 00:41:56.501000000
      DURATION-eng    : 00:41:56.501000000
      NUMBER_OF_FRAMES: 293
      NUMBER_OF_FRAMES-eng: 293
      NUMBER_OF_BYTES : 9428
      NUMBER_OF_BYTES-eng: 9428
      _STATISTICS_WRITING_APP: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-01-07 17:50:36
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-01-07 17:50:36
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:5(eng): Subtitle: subrip
    Metadata:
      title           : Subtitulo Inglés
      BPS             : 33
      BPS-eng         : 33
      DURATION        : 00:39:08.491000000
      DURATION-eng    : 00:39:08.491000000
      NUMBER_OF_FRAMES: 286
      NUMBER_OF_FRAMES-eng: 286
      NUMBER_OF_BYTES : 9693
      NUMBER_OF_BYTES-eng: 9693
      _STATISTICS_WRITING_APP: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-01-07 17:50:36
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-01-07 17:50:36
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:6: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 215x300 [SAR 1:1 DAR 43:60], 90k tbr, 90k tbn, 90k tbc
    Metadata:
      filename        : Cover.jpg
      mimetype        : image/jpeg
    Stream #0:7: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 215x300 [SAR 1:1 DAR 43:60], 90k tbr, 90k tbn, 90k tbc
    Metadata:
      filename        : Cover.jpg
      mimetype        : image/jpeg
[15:52:26] add_ffmpeg_subtitle: unknown subtitle stream type: 0x17808
[15:52:26] add_ffmpeg_subtitle: unknown subtitle stream type: 0x17808
[15:52:26] add_ffmpeg_subtitle: unknown subtitle stream type: 0x17808
[15:52:26] scan: decoding previews for title 1
[15:52:26] scan: audio 0x2: ac3, rate=48000Hz, bitrate=384000 English (AC3) (5.1 ch)
[15:52:26] scan: audio 0x1: ac3, rate=48000Hz, bitrate=384000 español (AC3) (5.1 ch)
Scanning title 1 of 1, preview 8, 80.00 %[15:52:26] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[15:52:26] libhb: scan thread found 1 valid title(s)
+ title 1:
  + stream: 1x01 - Piloto (Parte 1).mkv
  + duration: 00:42:20
  + size: 1920x1080, pixel aspect: 1/1, display aspect: 1.78, 23.976 fps
  + autocrop: 0/0/0/0
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 00:42:20
  + audio tracks:
    + 1, español (AC3) (5.1 ch) (iso639-2: spa), 48000Hz, 384000bps
    + 2, English (AC3) (5.1 ch) (iso639-2: eng), 48000Hz, 384000bps
  + subtitle tracks:

HandBrake has exited.

Steps to reproduce the problem (If Applicable):
I used the CLI with these parameters:

Code: Select all

HandBrakeCLI -i "Test_file.mkv" -Z "Fast 1080p30" -o "test.mp4" --all-audio --all-subtitles -E av_aac -B 160 -e x264 -q 23

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



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



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

The log:

Code: Select all

[14:56:21] hb_init: starting libhb thread
[14:56:21] thread 7fafb9c89700 started ("libhb")
HandBrake 1.1.0 (2018042400) - Linux x86_64 - https://handbrake.fr
8 CPUs detected
Opening 1x01 - Piloto (Parte 1).mkv...
[14:56:21] CPU: Intel(R) Xeon(R) W-2123 CPU @ 3.60GHz
[14:56:21]  - logical processor count: 8
[14:56:21] hb_scan: path=Test_tile.mkv, title_index=1
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:323: failed opening UDF image Test_file.mkv
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
[14:56:21] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.0
libdvdread: Encrypted DVD support unavailable.
************************************************
**                                            **
**  No css library available. See             **
**  /usr/share/doc/libdvdread4/README.css     **
**  for more information.                     **
**                                            **
************************************************
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
[14:56:21] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from 'Test_file.mkv':
  Metadata:
    encoder         : libebml v1.3.4 + libmatroska v1.4.5
    creation_time   : 2017-01-07T17:50:36.000000Z
  Duration: 00:42:20.58, start: 0.000000, bitrate: 3267 kb/s
    Stream #0:0: Video: hevc (Main 10), yuv420p10le(tv), 1920x1080, SAR 1:1 DAR 16:9, 23.98 fps, 23.98 tbr, 1k tbn, 23.98 tbc (default)
    Metadata:
      BPS             : 2497707
      BPS-eng         : 2497707
      DURATION        : 00:42:20.538000000
      DURATION-eng    : 00:42:20.538000000
      NUMBER_OF_FRAMES: 60912
      NUMBER_OF_FRAMES-eng: 60912
      NUMBER_OF_BYTES : 793190003
      NUMBER_OF_BYTES-eng: 793190003
      _STATISTICS_WRITING_APP: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-01-07 17:50:36
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-01-07 17:50:36
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:1(spa): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s (default)
    Metadata:
      title           : Castellano AC3 5.1 @ 384 kbps
      BPS             : 384000
      BPS-eng         : 384000
      DURATION        : 00:42:20.480000000
      DURATION-eng    : 00:42:20.480000000
      NUMBER_OF_FRAMES: 79390
      NUMBER_OF_FRAMES-eng: 79390
      NUMBER_OF_BYTES : 121943040
      NUMBER_OF_BYTES-eng: 121943040
      _STATISTICS_WRITING_APP: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-01-07 17:50:36
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-01-07 17:50:36
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:2(eng): Audio: ac3, 48000 Hz, 5.1(side), fltp, 384 kb/s
    Metadata:
      title           : Inglés AC3 5.1 @ 384 kbs
      BPS             : 384000
      BPS-eng         : 384000
      DURATION        : 00:42:20.576000000
      DURATION-eng    : 00:42:20.576000000
      NUMBER_OF_FRAMES: 79393
      NUMBER_OF_FRAMES-eng: 79393
      NUMBER_OF_BYTES : 121947648
      NUMBER_OF_BYTES-eng: 121947648
      _STATISTICS_WRITING_APP: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-01-07 17:50:36
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-01-07 17:50:36
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:3(spa): Subtitle: subrip (default) (forced)
    Metadata:
      title           : Forzados
      BPS             : 0
      BPS-eng         : 0
      DURATION        : 00:41:56.501000000
      DURATION-eng    : 00:41:56.501000000
      NUMBER_OF_FRAMES: 8
      NUMBER_OF_FRAMES-eng: 8
      NUMBER_OF_BYTES : 174
      NUMBER_OF_BYTES-eng: 174
      _STATISTICS_WRITING_APP: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-01-07 17:50:36
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-01-07 17:50:36
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:4(spa): Subtitle: subrip
    Metadata:
      title           : Castellano Completo
      BPS             : 29
      BPS-eng         : 29
      DURATION        : 00:41:56.501000000
      DURATION-eng    : 00:41:56.501000000
      NUMBER_OF_FRAMES: 293
      NUMBER_OF_FRAMES-eng: 293
      NUMBER_OF_BYTES : 9428
      NUMBER_OF_BYTES-eng: 9428
      _STATISTICS_WRITING_APP: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-01-07 17:50:36
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-01-07 17:50:36
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:5(eng): Subtitle: subrip
    Metadata:
      title           : Subtitulo Inglés
      BPS             : 33
      BPS-eng         : 33
      DURATION        : 00:39:08.491000000
      DURATION-eng    : 00:39:08.491000000
      NUMBER_OF_FRAMES: 286
      NUMBER_OF_FRAMES-eng: 286
      NUMBER_OF_BYTES : 9693
      NUMBER_OF_BYTES-eng: 9693
      _STATISTICS_WRITING_APP: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_APP-eng: mkvmerge v9.4.2 ('So High') 64bit
      _STATISTICS_WRITING_DATE_UTC: 2017-01-07 17:50:36
      _STATISTICS_WRITING_DATE_UTC-eng: 2017-01-07 17:50:36
      _STATISTICS_TAGS: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
      _STATISTICS_TAGS-eng: BPS DURATION NUMBER_OF_FRAMES NUMBER_OF_BYTES
    Stream #0:6: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 215x300 [SAR 1:1 DAR 43:60], 90k tbr, 90k tbn, 90k tbc
    Metadata:
      filename        : Cover.jpg
      mimetype        : image/jpeg
    Stream #0:7: Video: mjpeg, yuvj420p(pc, bt470bg/unknown/unknown), 215x300 [SAR 1:1 DAR 43:60], 90k tbr, 90k tbn, 90k tbc
    Metadata:
      filename        : Cover.jpg
      mimetype        : image/jpeg
[14:56:21] add_ffmpeg_subtitle: unknown subtitle stream type: 0x17808
[14:56:21] add_ffmpeg_subtitle: unknown subtitle stream type: 0x17808
[14:56:21] add_ffmpeg_subtitle: unknown subtitle stream type: 0x17808
[14:56:21] scan: decoding previews for title 1
[14:56:21] scan: audio 0x2: ac3, rate=48000Hz, bitrate=384000 English (AC3) (5.1 ch)
[14:56:21] scan: audio 0x1: ac3, rate=48000Hz, bitrate=384000 español (AC3) (5.1 ch)
Scanning title 1 of 1, preview 8, 80.00 %[14:56:21] scan: 10 previews, 1920x1080, 23.976 fps, autocrop = 0/0/0/0, aspect 16:9, PAR 1:1
[14:56:21] libhb: scan thread found 1 valid title(s)
+ Using preset: Fast 1080p30
+ title 1:
  + stream: Test_file.mkv
  + duration: 00:42:20
  + size: 1920x1080, pixel aspect: 1/1, display aspect: 1.78, 23.976 fps
  + autocrop: 0/0/0/0
  + chapters:
    + 1: cells 0->0, 0 blocks, duration 00:42:20
  + audio tracks:
    + 1, español (AC3) (5.1 ch) (iso639-2: spa), 48000Hz, 384000bps
    + 2, English (AC3) (5.1 ch) (iso639-2: eng), 48000Hz, 384000bps
  + subtitle tracks:
[14:56:22] 1 job(s) to process
[14:56:22] json job:
{
    "Audio": {
        "AudioList": [
            {
                "Bitrate": 160,
                "CompressionLevel": -1.0,
                "DRC": 0.0,
                "DitherMethod": "auto",
                "Encoder": "av_aac",
                "Gain": 0.0,
                "Mixdown": "dpl2",
                "NormalizeMixLevel": false,
                "PresetEncoder": "av_aac",
                "Quality": -3.0,
                "Samplerate": 0,
                "Track": 0
            },
            {
                "Bitrate": 160,
                "CompressionLevel": -1.0,
                "DRC": 0.0,
                "DitherMethod": "auto",
                "Encoder": "av_aac",
                "Gain": 0.0,
                "Mixdown": "dpl2",
                "NormalizeMixLevel": false,
                "PresetEncoder": "av_aac",
                "Quality": -3.0,
                "Samplerate": 0,
                "Track": 1
            }
        ],
        "CopyMask": [
            "copy:aac"
        ],
        "FallbackEncoder": "av_aac"
    },
    "Destination": {
        "AlignAVStart": true,
        "ChapterList": [
            {
                "Name": ""
            }
        ],
        "ChapterMarkers": false,
        "File": "test.mp4",
        "InlineParameterSets": false,
        "Mp4Options": {
            "IpodAtom": false,
            "Mp4Optimize": false
        },
        "Mux": "m4v"
    },
    "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": 6,
                "Settings": {
                    "mode": 2,
                    "rate": "27000000/900000"
                }
            },
            {
                "ID": 11,
                "Settings": {
                    "crop-bottom": 0,
                    "crop-left": 0,
                    "crop-right": 0,
                    "crop-top": 0,
                    "height": 1080,
                    "width": 1920
                }
            }
        ]
    },
    "Metadata": {},
    "PAR": {
        "Den": 1,
        "Num": 1
    },
    "SequenceID": 0,
    "Source": {
        "Angle": 0,
        "Path": "Test_file.mkv",
        "Range": {
            "End": 1,
            "Start": 1,
            "Type": "chapter"
        },
        "Title": 1
    },
    "Subtitle": {
        "Search": {
            "Burn": true,
            "Default": false,
            "Enable": false,
            "Forced": false
        },
        "SubtitleList": []
    },
    "Video": {
        "ColorMatrixCode": 0,
        "Encoder": "x264",
        "Level": "4.0",
        "Options": "",
        "Preset": "fast",
        "Profile": "main",
        "QSV": {
            "AsyncDepth": 4,
            "Decode": false
        },
        "Quality": 23.0,
        "Tune": "",
        "Turbo": false,
        "TwoPass": false
    }
}
[14:56:22] starting job
[14:56:22] decomb filter thread started for segment 0
[14:56:22] decomb filter thread started for segment 2
[14:56:22] decomb filter thread started for segment 3
[14:56:22] decomb filter thread started for segment 1
[14:56:22] decomb filter thread started for segment 5
[14:56:22] decomb filter thread started for segment 4
[14:56:22] decomb check thread started for segment 5
[14:56:22] decomb filter thread started for segment 7
[14:56:22] decomb check thread started for segment 1
[14:56:22] decomb check thread started for segment 2
[14:56:22] decomb check thread started for segment 0
[14:56:22] mask filter thread started for segment 5
[14:56:22] decomb check thread started for segment 4
[14:56:22] decomb filter thread started for segment 6
[14:56:22] decomb check thread started for segment 6
[14:56:22] decomb check thread started for segment 7
[14:56:22] mask filter thread started for segment 0
[14:56:22] mask filter thread started for segment 1
[14:56:22] mask filter thread started for segment 2
[14:56:22] mask filter thread started for segment 3
[14:56:22] mask filter thread started for segment 4
[14:56:22] mask erode thread started for segment 5
[14:56:22] mask erode thread started for segment 6
[14:56:22] mask filter thread started for segment 7
[14:56:22] mask erode thread started for segment 1
[14:56:22] mask erode thread started for segment 0
[14:56:22] mask erode thread started for segment 2
[14:56:22] mask erode thread started for segment 3
[14:56:22] mask erode thread started for segment 4
[14:56:22] decomb check thread started for segment 3
[14:56:22] mask filter thread started for segment 6
[14:56:22] mask erode thread started for segment 7
[14:56:22] yadif thread started for segment 1
[14:56:22] mask dilate thread started for segment 1
[14:56:22] mask dilate thread started for segment 2
[14:56:22] mask dilate thread started for segment 3
[14:56:22] mask dilate thread started for segment 4
[14:56:22] mask dilate thread started for segment 5
[14:56:22] mask dilate thread started for segment 7
[14:56:22] yadif thread started for segment 7
[14:56:22] mask dilate thread started for segment 6
[14:56:22] yadif thread started for segment 2
[14:56:22] mask dilate thread started for segment 0
[14:56:22] yadif thread started for segment 3
[14:56:22] yadif thread started for segment 5
[14:56:22] yadif thread started for segment 4
[14:56:22] yadif thread started for segment 6
[14:56:22] yadif thread started for segment 0
[14:56:22] job configuration:
[14:56:22]  * source
[14:56:22]    + Test_file.mkv
[14:56:22]    + title 1, chapter(s) 1 to 1
[14:56:22]    + container: matroska,webm
[14:56:22]    + data rate: 3267 kbps
[14:56:22]  * destination
[14:56:22]    + test.mp4
[14:56:22]    + container: MPEG-4 (libavformat)
[14:56:22]      + align initial A/V stream timestamps
[14:56:22]  * video track
[14:56:22]    + decoder: hevc
[14:56:22]    + filters
[14:56:22]      + 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)
[14:56:22]      + Decomb (mode=39)
[14:56:22]      + Framerate Shaper (mode=2:rate=27000000/900000)
[14:56:22]        + frame rate: 23.976 fps -> peak rate limited to 30.000 fps
[14:56:22]      + Crop and Scale (width=1920:height=1080:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[14:56:22]        + source: 1920 * 1080, crop (0/0/0/0): 1920 * 1080, scale: 1920 * 1080
[14:56:22]    + Output geometry
[14:56:22]      + storage dimensions: 1920 x 1080
[14:56:22]      + pixel aspect ratio: 1 : 1
[14:56:22]      + display dimensions: 1920 x 1080
[14:56:22]    + encoder: H.264 (libx264)
[14:56:22]      + preset:  fast
[14:56:22]      + profile: main
[14:56:22]      + level:   4.0
[14:56:22]      + quality: 23.00 (RF)
[14:56:22]  * audio track 1
[14:56:22]    + decoder: español (AC3) (5.1 ch) (track 1, id 0x1)
[14:56:22]      + bitrate: 384 kbps, samplerate: 48000 Hz
[14:56:22]    + mixdown: Dolby Pro Logic II
[14:56:22]    + encoder: AAC (libavcodec)
[14:56:22]      + bitrate: 160 kbps, samplerate: 48000 Hz
[14:56:22]  * audio track 2
[14:56:22]    + decoder: English (AC3) (5.1 ch) (track 2, id 0x2)
[14:56:22]      + bitrate: 384 kbps, samplerate: 48000 Hz
[14:56:22]    + mixdown: Dolby Pro Logic II
[14:56:22]    + encoder: AAC (libavcodec)
[14:56:22]      + bitrate: 160 kbps, samplerate: 48000 Hz
[14:56:22] sync: expecting 60912 video frames
[14:56:22] encavcodecaInit: Unknown avcodec option stereo_mode
[14:56:22] encavcodecaInit: Unknown avcodec option stereo_mode
[14:56:22] encx264: min-keyint: 24, keyint: 240
[14:56:22] encx264: encoding at constant RF 23.000000
[14:56:22] 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 AVX512
x264 [info]: profile Main, level 4.0
[14:56:22] sync: first pts video is 0
[14:56:22] sync: Chapter 1 at frame 1 time 0
[14:56:22] sync: first pts audio 0x1 is 0
[14:56:22] sync: first pts audio 0x2 is 0
Encoding: task 1 of 1, 99.90 % (60.50 fps, avg 34.72 fps, ETA 00h00m02s)[15:25:34] reader: done. 1 scr changes
Encoding: task 1 of 1, 99.93 % (48.36 fps, avg 34.73 fps, ETA 00h00m01s)[15:25:35] work: average encoding speed for job is 34.726635 fps
[15:25:36] comb detect: heavy 2734 | light 1887 | uncombed 56291 | total 60912
[15:25:36] decomb: deinterlaced 2734 | blended 1887 | unfiltered 56291 | total 60912
[15:25:36] vfr: 60912 frames output, 0 dropped and 0 duped for CFR/PFR
[15:25:36] vfr: lost time: 0 (0 frames)
[15:25:36] vfr: gained time: 0 (0 frames) (0 not accounted for)
[15:25:36] ac3-decoder done: 79390 frames, 0 decoder errors
[15:25:36] ac3-decoder done: 79393 frames, 0 decoder errors
[15:25:36] hevc-decoder done: 60912 frames, 0 decoder errors
[15:25:36] sync: got 60912 frames, 60912 expected
[15:25:36] sync: framerate min 23.981 fps, max 23.981 fps, avg 23.976 fps
x264 [info]: frame I:1284  Avg QP:19.01  size: 55870
x264 [info]: frame P:20756 Avg QP:22.07  size: 26125
x264 [info]: frame B:38872 Avg QP:23.14  size: 12702
x264 [info]: consecutive B-frames: 13.3%  3.1%  5.1% 78.5%
x264 [info]: mb I  I16..4: 56.4%  0.0% 43.6%
x264 [info]: mb P  I16..4: 21.7%  0.0%  6.3%  P16..4: 38.2%  8.0%  4.3%  0.0%  0.0%    skip:21.4%
x264 [info]: mb B  I16..4:  9.5%  0.0%  0.7%  B16..8: 26.5%  4.6%  0.2%  direct:14.9%  skip:43.6%  L0:45.7% L1:49.9% BI: 4.4%
x264 [info]: coded y,uvDC,uvAC intra: 17.7% 53.6% 4.7% inter: 8.9% 25.7% 0.1%
x264 [info]: i16 v,h,dc,p: 39% 21% 15% 24%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 25% 17% 27%  6%  7%  6%  5%  4%  3%
x264 [info]: i8c dc,h,v,p: 60% 17% 19%  4%
x264 [info]: Weighted P-Frames: Y:2.6% UV:1.6%
x264 [info]: ref P L0: 70.8% 29.2%
x264 [info]: ref B L0: 84.7% 15.3%
x264 [info]: ref B L1: 95.6%  4.4%
x264 [info]: kb/s:3488.24
Muxing: this may take awhile...[15:25:36] mux: track 0, 60912 frames, 1107714272 bytes, 3488.01 kbps, fifo 2048
[15:25:36] mux: track 1, 119087 frames, 51302870 bytes, 161.54 kbps, fifo 4096
[15:25:36] mux: track 2, 119090 frames, 51245092 bytes, 161.36 kbps, fifo 4096
[15:25:36] libhb: work result = 0

Encode done!

HandBrake has exited.

So my questions are:
- How to decrease the size of this file, preserving quality?
- Which CLI parameters use to keep both subtitles (and discard the forced ones)?

Thanks in advance.
rollin_eng
Veteran User
Posts: 3705
Joined: Wed May 04, 2011 11:06 pm

Re: converting mkv to mp4 resulted in bigger output file

Post by rollin_eng »

Select the slowest encoder preset you can tolerate then increase the RF.

Try slow or very slow and an RF of 25, see what it looks like.
mduell
Veteran User
Posts: 7331
Joined: Sat Apr 21, 2007 8:54 pm

Re: converting mkv to mp4 resulted in bigger output file

Post by mduell »

Fast encoding isn't efficient (quality for size), so you need to pick a slower preset and/or a lower quality target (higher RF).
Post Reply