MKV converting to AAC instead of FLAC.

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
joesnameisgreg
Posts: 5
Joined: Mon Dec 05, 2022 2:54 pm

MKV converting to AAC instead of FLAC.

Post by joesnameisgreg »

Description of problem or question:
I am trying to compress MKV video with PCM audio to a smaller MKV video with FLAC audio, however when I add the videos to queue it changes my audio setting to AAC and will not let me output FLAC audio in MKV container.



Steps to reproduce the problem (If Applicable):
After adjusting the encode settings to my needs, when I click Queue > Add Multiple then check the Queue, all videos say AAC when they are supposed to output FLAC. If I add videos individually rather than using "Add Multiple" it will correctly queue the first video, then all following queues change the setting to AAC.



HandBrake version (e.g., 1.0.0):
1.5.1 (x86_64)



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



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

Code: Select all

[10:06:37] gtkgui: HandBrake 1.5.1 (2022021100) - Linux x86_64 - https://handbrake.fr
[10:06:37] Compile-time hardening features are enabled
Cannot load libnvidia-encode.so.1
Cannot load libnvidia-encode.so.1
Cannot load libnvidia-encode.so.1
Cannot load libnvidia-encode.so.1
[10:06:37] hb_init: starting libhb thread
[10:06:37] hb_init: starting libhb thread
[10:06:37] hb_init: starting libhb thread
[10:06:38] CPU: Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz
[10:06:38]  - logical processor count: 4
[10:06:38] hb_scan: path=/home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV, title_index=0
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
bluray.c:2602: nav_get_title_list(/home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV/) failed
[10:06:38] bd: not a bd - trying as a stream/file instead
libdvdread: Couldn't find device name.
libdvdread: DVDOpenFilePath:findDVDFile /VIDEO_TS/VIDEO_TS.IFO failed
libdvdnav: vm: vm: failed to read VIDEO_TS.IFO
[10:06:38] dvd: not a dvd - trying as a stream/file instead
[10:06:38] batch: scanning /home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV/INTERMISSION SPEECH.mkv
Input #0, matroska,webm, from '/home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV/INTERMISSION SPEECH.mkv':
  Metadata:
    ENCODER         : Lavf58.45.100
  Duration: 00:14:03.77, start: 0.000000, bitrate: 41707 kb/s
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 3840x1920 [SAR 1:1 DAR 2:1], 30.30 fps, 30 tbr, 1k tbn, 60 tbc (default)
    Metadata:
      DURATION        : 00:14:03.766000000
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, 2 channels, s32 (24 bit), 2304 kb/s (default)
    Metadata:
      DURATION        : 00:14:03.750000000
[10:06:38] batch: scanning /home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV/SET 1.mkv
Input #0, matroska,webm, from '/home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV/SET 1.mkv':
  Metadata:
    ENCODER         : Lavf58.45.100
  Duration: 00:49:00.77, start: 0.000000, bitrate: 28354 kb/s
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 3840x1920 [SAR 1:1 DAR 2:1], 30.30 fps, 30 tbr, 1k tbn, 60 tbc (default)
    Metadata:
      DURATION        : 00:49:00.766000000
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, 2 channels, s32 (24 bit), 2304 kb/s (default)
    Metadata:
      DURATION        : 00:49:00.750000000
[10:06:38] batch: scanning /home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV/SET 2.mkv
Input #0, matroska,webm, from '/home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV/SET 2.mkv':
  Metadata:
    ENCODER         : Lavf58.45.100
  Duration: 01:16:18.27, start: 0.000000, bitrate: 23044 kb/s
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 3840x1920 [SAR 1:1 DAR 2:1], 30.30 fps, 30 tbr, 1k tbn, 60 tbc (default)
    Metadata:
      DURATION        : 01:16:18.266000000
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, 2 channels, s32 (24 bit), 2304 kb/s (default)
    Metadata:
      DURATION        : 01:16:18.250000000
[10:06:38] scan: decoding previews for title 1 (/home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV/INTERMISSION SPEECH.mkv)
[10:06:38] scan: audio 0x1: pcm_s24le, rate=48000Hz, bitrate=2304000 Unknown (pcm_s24le) (2.0 ch) (2304 kbps)
[10:06:43] scan: 10 previews, 3840x1920, 30.303 fps, autocrop = 0/0/0/0, aspect 2.00:1, PAR 1:1, color profile: 1-1-1, chroma location: left
[10:06:43] scan: decoding previews for title 2 (/home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV/SET 1.mkv)
[10:06:43] scan: audio 0x1: pcm_s24le, rate=48000Hz, bitrate=2304000 Unknown (pcm_s24le) (2.0 ch) (2304 kbps)
[10:06:47] scan: 10 previews, 3840x1920, 30.303 fps, autocrop = 0/0/0/0, aspect 2.00:1, PAR 1:1, color profile: 1-1-1, chroma location: left
[10:06:47] scan: decoding previews for title 3 (/home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV/SET 2.mkv)
[10:06:47] scan: audio 0x1: pcm_s24le, rate=48000Hz, bitrate=2304000 Unknown (pcm_s24le) (2.0 ch) (2304 kbps)
[10:06:51] scan: 10 previews, 3840x1920, 30.303 fps, autocrop = 0/0/0/0, aspect 2.00:1, PAR 1:1, color profile: 1-1-1, chroma location: left
[10:06:51] libhb: scan thread found 3 valid title(s)
[10:06:52] decomb: deinterlaced 1 | blended 0 | unfiltered 0 | total 1
[10:06:52] decomb: deinterlaced 1 | blended 0 | unfiltered 0 | total 1
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: MKV converting to AAC instead of FLAC.

Post by Woodstock »

Your log does not show what choices handbrake made, just that your source had PCM encoding for the audio. This is where the encode log is helpful, to see how the choice was made.

Do you have the encode log? That normally shows what choices are enabled and are made for each audio channel.
joesnameisgreg
Posts: 5
Joined: Mon Dec 05, 2022 2:54 pm

Re: MKV converting to AAC instead of FLAC.

Post by joesnameisgreg »

Code: Select all

Handbrake Version: 1.5.1 (2022021100)
[23:57:31] gtkgui: Modified Preset: /General/Fast 1080p30
[23:57:31] Starting work at: Sat Dec  3 23:57:31 2022

[23:57:31] 1 job(s) to process
[23:57:31] 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": true,
        "ChapterList": [
            {
                "Duration": {
                    "Hours": 1,
                    "Minutes": 16,
                    "Seconds": 18,
                    "Ticks": 412043940
                },
                "Name": ""
            }
        ],
        "ChapterMarkers": false,
        "File": "/home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/1080 MP4/SET 2.mp4",
        "InlineParameterSets": false,
        "Mp4Options": {
            "IpodAtom": false,
            "Mp4Optimize": true
        },
        "Mux": "m4v"
    },
    "Filters": {
        "FilterList": [
            {
                "ID": 6,
                "Settings": {
                    "mode": 1
                }
            },
            {
                "ID": 13,
                "Settings": {
                    "crop-bottom": 0,
                    "crop-left": 0,
                    "crop-right": 0,
                    "crop-top": 0,
                    "height": 960,
                    "width": 1920
                }
            }
        ]
    },
    "Metadata": {
        "Name": "SET 2"
    },
    "PAR": {
        "Den": 1,
        "Num": 1
    },
    "SequenceID": 0,
    "Source": {
        "Angle": 0,
        "Path": "/home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV/SET 2.mkv",
        "Range": {
            "End": 1,
            "Start": 1,
            "Type": "chapter"
        },
        "Title": 3
    },
    "Subtitle": {
        "Search": {
            "Burn": true,
            "Default": false,
            "Enable": false,
            "Forced": false
        },
        "SubtitleList": []
    },
    "Video": {
        "ChromaLocation": 1,
        "ColorInputFormat": 0,
        "ColorMatrix": 1,
        "ColorOutputFormat": 0,
        "ColorPrimaries": 1,
        "ColorRange": 0,
        "ColorTransfer": 1,
        "Encoder": "x264",
        "Level": "4.0",
        "Options": "",
        "Preset": "fast",
        "Profile": "main",
        "QSV": {
            "AdapterIndex": 0,
            "AsyncDepth": 0,
            "Decode": false
        },
        "Quality": 24.0,
        "Tune": "",
        "Turbo": false,
        "TwoPass": false
    }
}
[23:57:31] CPU: Intel(R) Core(TM)2 Quad CPU    Q6600  @ 2.40GHz
[23:57:31]  - logical processor count: 4
[23:57:31] hb_scan: path=/home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV/SET 2.mkv, title_index=3
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:323: failed opening UDF image /home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV/SET 2.mkv
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
bluray.c:2602: nav_get_title_list(/home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV/SET 2.mkv/) failed
[23:57:31] 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
[23:57:31] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from '/home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV/SET 2.mkv':
  Metadata:
    ENCODER         : Lavf58.45.100
  Duration: 01:16:18.27, start: 0.000000, bitrate: 23044 kb/s
    Stream #0:0: Video: h264 (High), yuv420p(progressive), 3840x1920 [SAR 1:1 DAR 2:1], 30.30 fps, 30 tbr, 1k tbn, 60 tbc (default)
    Metadata:
      DURATION        : 01:16:18.266000000
    Stream #0:1: Audio: pcm_s24le, 48000 Hz, 2 channels, s32 (24 bit), 2304 kb/s (default)
    Metadata:
      DURATION        : 01:16:18.250000000
[23:57:31] scan: decoding previews for title 3
[23:57:31] scan: audio 0x1: pcm_s24le, rate=48000Hz, bitrate=2304000 Unknown (pcm_s24le) (2.0 ch) (2304 kbps)
[23:57:35] scan: 10 previews, 3840x1920, 30.303 fps, autocrop = 0/0/0/0, aspect 2.00:1, PAR 1:1, color profile: 1-1-1, chroma location: left
[23:57:35] libhb: scan thread found 1 valid title(s)
[23:57:35] Starting Task: Encoding Pass
[23:57:35] job configuration:
[23:57:35]  * source
[23:57:35]    + /home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/4K MKV/SET 2.mkv
[23:57:35]    + title 3, chapter(s) 1 to 1
[23:57:35]    + container: matroska,webm
[23:57:35]    + data rate: 23044 kbps
[23:57:35]  * destination
[23:57:35]    + /home/greg/Desktop/2022.11.12 Jimmy Dry Jaw/MASTERS/1080 MP4/SET 2.mp4
[23:57:35]    + container: MPEG-4 (libavformat)
[23:57:35]      + optimized for HTTP streaming (fast start)
[23:57:35]      + align initial A/V stream timestamps
[23:57:35]  * video track
[23:57:35]    + decoder: h264 8-bit (yuv420p)
[23:57:35]    + filters
[23:57:35]      + Framerate Shaper (mode=1)
[23:57:35]        + frame rate: 30.303 fps -> constant 30.303 fps
[23:57:35]      + Crop and Scale (width=1920:height=960:crop-top=0:crop-bottom=0:crop-left=0:crop-right=0)
[23:57:35]        + source: 3840 * 1920, crop (0/0/0/0): 3840 * 1920, scale: 1920 * 960
[23:57:35]    + Output geometry
[23:57:35]      + storage dimensions: 1920 x 960
[23:57:35]      + pixel aspect ratio: 1 : 1
[23:57:35]      + display dimensions: 1920 x 960
[23:57:35]    + encoder: H.264 (libx264)
[23:57:35]      + preset:  fast
[23:57:35]      + profile: main
[23:57:35]      + level:   4.0
[23:57:35]      + quality: 24.00 (RF)
[23:57:35]      + color profile: 1-1-1
[23:57:35]      + chroma location: left
[23:57:35]  * audio track 1
[23:57:35]    + decoder: Unknown (pcm_s24le) (2.0 ch) (2304 kbps) (track 1, id 0x1)
[23:57:35]      + bitrate: 2304 kbps, samplerate: 48000 Hz
[23:57:35]    + mixdown: Stereo
[23:57:35]    + encoder: AAC (libavcodec)
[23:57:35]      + bitrate: 160 kbps, samplerate: 48000 Hz
[23:57:35] sync: expecting 138735 video frames
[23:57:35] encx264: min-keyint: 30, keyint: 300
[23:57:35] encx264: encoding at constant RF 24.000000
[23:57:35] 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 Cache64 SlowShuffle
x264 [info]: profile Main, level 4.0, 4:2:0, 8-bit
[23:57:36] sync: first pts video is 0
[23:57:36] sync: Chapter 1 at frame 1 time 0
[23:57:36] sync: first pts audio 0x1 is 0
[03:25:36] reader: done. 1 scr changes
[03:25:43] work: average encoding speed for job is 11.078620 fps
[03:25:43] vfr: 138735 frames output, 0 dropped and 1387 duped for CFR/PFR
[03:25:43] vfr: lost time: 0 (0 frames)
[03:25:43] vfr: gained time: 0 (0 frames) (0 not accounted for)
[03:25:43] pcm_s24le-decoder done: 137348 frames, 0 decoder errors
[03:25:43] h264-decoder done: 137348 frames, 0 decoder errors
[03:25:44] sync: got 137348 frames, 138735 expected
[03:25:44] sync: framerate min 29.412 fps, max 30.303 fps, avg 30.000 fps
x264 [info]: frame I:580   Avg QP:21.32  size:135974
x264 [info]: frame P:35237 Avg QP:24.09  size: 34672
x264 [info]: frame B:102918 Avg QP:26.30  size: 10499
x264 [info]: consecutive B-frames:  0.6%  0.9%  2.1% 96.4%
x264 [info]: mb I  I16..4: 21.5%  0.0% 78.5%
x264 [info]: mb P  I16..4:  4.7%  0.0%  4.2%  P16..4: 46.8% 15.1%  8.8%  0.0%  0.0%    skip:20.4%
x264 [info]: mb B  I16..4:  2.3%  0.0%  0.4%  B16..8: 18.4%  5.9%  0.2%  direct:13.7%  skip:59.1%  L0:44.8% L1:49.1% BI: 6.1%
x264 [info]: coded y,uvDC,uvAC intra: 49.0% 62.5% 20.0% inter: 12.0% 24.3% 0.7%
x264 [info]: i16 v,h,dc,p: 35% 22% 28% 14%
x264 [info]: i4 v,h,dc,ddl,ddr,vr,hd,vl,hu: 21% 16% 26%  7%  7%  6%  6%  5%  5%
x264 [info]: i8c dc,h,v,p: 58% 18% 18%  5%
x264 [info]: Weighted P-Frames: Y:0.6% UV:0.3%
x264 [info]: ref P L0: 60.9% 39.1%
x264 [info]: ref B L0: 79.9% 20.1%
x264 [info]: ref B L1: 94.7%  5.3%
x264 [info]: kb/s:4160.70
[03:26:45] mux: track 0, 138735 frames, 2381069450 bytes, 4160.63 kbps, fifo 2048
[03:26:45] mux: track 1, 214606 frames, 92031467 bytes, 160.81 kbps, fifo 2048
[03:26:45] Finished work at: Sun Dec  4 03:26:45 2022

[03:26:45] libhb: work result = 0
joesnameisgreg
Posts: 5
Joined: Mon Dec 05, 2022 2:54 pm

Re: MKV converting to AAC instead of FLAC.

Post by joesnameisgreg »

I am really bad at describing the issue with proper terminology, but I have two short screen recordings of the exact steps that recreate the problem. Is it okay to post a YouTube link on this thread or is there a better way to share a short vid? Just checking before I post.
rollin_eng
Veteran User
Posts: 4840
Joined: Wed May 04, 2011 11:06 pm

Re: MKV converting to AAC instead of FLAC.

Post by rollin_eng »

You need to save your settings to a new preset, then set that preset as your default.

Then when you load files and “add all to queue” it should apply those settings.
joesnameisgreg
Posts: 5
Joined: Mon Dec 05, 2022 2:54 pm

Re: MKV converting to AAC instead of FLAC.

Post by joesnameisgreg »

I have actually tried that, Handbrake still forces AAC audio...

Please see this video: https://youtu.be/4TafXtZhpTM - This is me attempting to create a preset with FLAC audio, but when I save the preset Handbrake changes the audio to AAC. I didn't show it in the video but none of the other settings are changed, only audio.

Also if you have time: https://youtu.be/trsjnI4tbvQ - This is me recreating the original issue. If I follow these exact steps the same thing happens every time, resulting in Handbrake forcing AAC output.

Both videos together total about 2.5 minutes, I appreciate anyone taking the time to watch, as this is the only way I think I can clearly communicate the exact issue.

Thanks in advance for any replies/help/two cents.
joesnameisgreg
Posts: 5
Joined: Mon Dec 05, 2022 2:54 pm

Re: MKV converting to AAC instead of FLAC.

Post by joesnameisgreg »

Tweaking the "track selection behavior" seems to have solved the issue.
Thanks for pointing me in the right direction!
Post Reply