Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HandBrake does not properly recognize audio bitrate from MKV sources #3624

Closed
dbenjaminmiller opened this issue May 28, 2021 · 12 comments
Closed

Comments

@dbenjaminmiller
Copy link

Problem description:

When I open an MKV source using HandBrake, the bitrate of all audio sources (no matter what format they are in) is shown as 0.001kbps. Then if I use anything except for passthrough on the audio to produce an output, the result is a silent audio track (consistent with HandBrake not being able to read the audio of the original MKV). This happens no matter what codec is used in the original MKV.

HandBrake version (e.g., 1.3.0):

v 1.3.3, both Flatpak and rpmfusion versions tested

Operating system and version (e.g., Ubuntu 19.10, macOS 10.15 Catalina, Windows 10 1909):

Fedora 34

Error message text and/or screenshot:

image

HandBrake Activity Log:

Just one sample with a generic MKV file:

15:31:01] gtkgui: HandBrake 1.3.3 (2021032900) - Linux x86_64 - https://handbrake.fr
Cannot load libnvidia-encode.so.1
[15:31:01] hb_init: starting libhb thread
[15:31:01] hb_init: starting libhb thread
[15:31:01] hb_init: starting libhb thread
[15:31:02] CPU: 
[15:31:02]  - logical processor count: 16
[15:31:02] Intel Quick Sync Video support: no
[15:31:02] hb_scan: path=/mnt/ntex/VideoLibrary/Amadeus.mkv, title_index=0
udfread ERROR: ECMA 167 Volume Recognition failed
disc.c:323: failed opening UDF image /mnt/ntex/VideoLibrary/Amadeus.mkv
disc.c:424: error opening file BDMV/index.bdmv
disc.c:424: error opening file BDMV/BACKUP/index.bdmv
bluray.c:2585: nav_get_title_list(/mnt/ntex/VideoLibrary/Amadeus.mkv/) failed
[15:31:02] bd: not a bd - trying as a stream/file instead
libdvdnav: Using dvdnav version 6.0.1
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
[15:31:02] dvd: not a dvd - trying as a stream/file instead
Input #0, matroska,webm, from '/mnt/ntex/VideoLibrary/Amadeus.mkv':
  Metadata:
    title           : Amadeus
    CREATION_TIME   : 2018-03-26T00:48:13Z
    ENCODER         : Lavf57.7.2
  Duration: 02:40:07.03, start: 0.000000, bitrate: 2492 kb/s
    Chapter #0:0: start 0.083000, end 288.071000
    Metadata:
      title           : Chapter 1
    Chapter #0:1: start 288.071000, end 592.206000
    Metadata:
      title           : Chapter 2
    Chapter #0:2: start 592.206000, end 777.017000
    Metadata:
      title           : Chapter 3
    Chapter #0:3: start 777.017000, end 1230.236000
    Metadata:
      title           : Chapter 4
    Chapter #0:4: start 1230.236000, end 1425.873000
    Metadata:
      title           : Chapter 5
    Chapter #0:5: start 1425.873000, end 1565.345000
    Metadata:
      title           : Chapter 6
    Chapter #0:6: start 1565.345000, end 1841.814000
    Metadata:
      title           : Chapter 7
    Chapter #0:7: start 1841.814000, end 2197.436000
    Metadata:
      title           : Chapter 8
    Chapter #0:8: start 2197.436000, end 2555.795000
    Metadata:
      title           : Chapter 9
    Chapter #0:9: start 2555.795000, end 2677.317000
    Metadata:
      title           : Chapter 10
    Chapter #0:10: start 2677.317000, end 2952.458000
    Metadata:
      title           : Chapter 11
    Chapter #0:11: start 2952.458000, end 3425.397000
    Metadata:
      title           : Chapter 12
    Chapter #0:12: start 3425.397000, end 3519.382000
    Metadata:
      title           : Chapter 13
    Chapter #0:13: start 3519.382000, end 3785.565000
    Metadata:
      title           : Chapter 14
    Chapter #0:14: start 3785.565000, end 4121.125000
    Metadata:
      title           : Chapter 15
    Chapter #0:15: start 4121.125000, end 4324.396000
    Metadata:
      title           : Chapter 16
    Chapter #0:16: start 4324.396000, end 4555.193000
    Metadata:
      title           : Chapter 17
    Chapter #0:17: start 4555.193000, end 4952.232000
    Metadata:
      title           : Chapter 18
    Chapter #0:18: start 4952.232000, end 5230.303000
    Metadata:
      title           : Chapter 19
    Chapter #0:19: start 5230.303000, end 5360.891000
    Metadata:
      title           : Chapter 20
    Chapter #0:20: start 5360.891000, end 5545.384000
    Metadata:
      title           : Chapter 21
    Chapter #0:21: start 5545.384000, end 5809.757000
    Metadata:
      title           : Chapter 22
    Chapter #0:22: start 5809.757000, end 6193.324000
    Metadata:
      title           : Chapter 23
    Chapter #0:23: start 6193.324000, end 6407.880000
    Metadata:
      title           : Chapter 24
    Chapter #0:24: start 6407.880000, end 6541.647000
    Metadata:
      title           : Chapter 25
    Chapter #0:25: start 6541.647000, end 6789.328000
    Metadata:
      title           : Chapter 26
    Chapter #0:26: start 6789.328000, end 6915.395000
    Metadata:
      title           : Chapter 27
    Chapter #0:27: start 6915.395000, end 7126.998000
    Metadata:
      title           : Chapter 28
    Chapter #0:28: start 7126.998000, end 7455.258000
    Metadata:
      title           : Chapter 29
    Chapter #0:29: start 7455.258000, end 7611.548000
    Metadata:
      title           : Chapter 30
    Chapter #0:30: start 7611.548000, end 7855.392000
    Metadata:
      title           : Chapter 31
    Chapter #0:31: start 7855.392000, end 8186.013000
    Metadata:
      title           : Chapter 32
    Chapter #0:32: start 8186.013000, end 8513.256000
    Metadata:
      title           : Chapter 33
    Chapter #0:33: start 8513.256000, end 8691.683000
    Metadata:
      title           : Chapter 34
    Chapter #0:34: start 8691.683000, end 8947.414000
    Metadata:
      title           : Chapter 35
    Chapter #0:35: start 8947.414000, end 9149.399000
    Metadata:
      title           : Chapter 36
    Chapter #0:36: start 9149.399000, end 9278.210000
    Metadata:
      title           : Chapter 37
    Chapter #0:37: start 9278.210000, end 9606.973000
    Metadata:
      title           : Chapter 38
    Stream #0:0: Video: h264 (High), yuv420p(tv, smpte170m/smpte170m/bt709, progressive), 720x370 [SAR 740:621 DAR 160:69], SAR 244:205 DAR 17568:7585, 23.98 fps, 23.98 tbr, 1k tbn, 180k tbc (default)
    Stream #0:1(eng): Audio: aac (LC), 48000 Hz, stereo, fltp (default)
    Metadata:
      title           : Stereo
    Stream #0:2(fre): Audio: aac (LC), 48000 Hz, stereo, fltp
    Metadata:
      title           : Stereo
    Stream #0:3(eng): Audio: aac (LC), 48000 Hz, stereo, fltp
    Metadata:
      title           : Stereo
    Stream #0:4(eng): Subtitle: dvd_subtitle, 720x480
    Stream #0:5(fre): Subtitle: dvd_subtitle, 720x480
[15:31:02] scan: decoding previews for title 1
[15:31:02] scan: audio 0x1: aac, rate=48000Hz, bitrate=1 English (AAC LC) (2.0 ch)
[15:31:02] scan: audio 0x2: aac, rate=48000Hz, bitrate=1 Francais (AAC LC) (2.0 ch)
[15:31:02] scan: audio 0x3: aac, rate=48000Hz, bitrate=1 English (AAC LC) (2.0 ch)
[15:31:02] WARNING: Video PAR 740:621 != container PAR 244:205
[15:31:02] scan: 10 previews, 720x370, 23.976 fps, autocrop = 0/0/0/0, aspect 2.32:1, PAR 740:621
[15:31:02] scan: supported video decoders: avcodec qsv
[15:31:02] libhb: scan thread found 1 valid title(s)

@sr55
Copy link
Contributor

sr55 commented May 28, 2021

Do you have a sample source you can share that has reproduces this?

@dbenjaminmiller
Copy link
Author

Do you have a sample source you can share that has reproduces this?

Since all webms are mkvs, it applies to them too. See, for a public domain example: https://upload.wikimedia.org/wikipedia/commons/b/b4/Lady_Gaga_performs_%22The_Star-Spangled_Banner%22.webm

@galad87
Copy link
Contributor

galad87 commented May 29, 2021

Is the Flatpak version you tried the one on handbrake.fr or another one?
It could be a broken version linked to FFmpeg 4.4.

@dbenjaminmiller
Copy link
Author

dbenjaminmiller commented May 29, 2021

Is the Flatpak version you tried the one on handbrake.fr or another one?
It could be a broken version linked to FFmpeg 4.4.

I've tried both the handbrake.fr flatpak as well as the current flathub version. Same issue with both.

Ed.: And the same problem is present both on stable 1.3.3 and the current development snapshot flatpak.

@galad87
Copy link
Contributor

galad87 commented May 29, 2021

Can you post the entire activity log of an encode?

@dbenjaminmiller
Copy link
Author

So, actually, having deleted the flatpak install and redone it, it now works with the flatpak versions. The non-flatpak version packaged by rpmfusion is broken — it drops all the audio frames, per this log.
log1.txt

What the flatpak and development versions still have a problem with, however, is recognizing the actual bitrate --- they still show 0.001kbps for all audio sources in MKV files. Which is a bug, but less of a severe one.

@dbenjaminmiller dbenjaminmiller changed the title HandBrake does not properly recognize audio from MKV sources HandBrake does not properly recognize audio bitrate from MKV sources May 29, 2021
@dbenjaminmiller
Copy link
Author

So the actual encoding side should be fixed by #3537. But the problem of proper recognition remains, it seems.

@galad87
Copy link
Contributor

galad87 commented May 29, 2021

We have no control over rpmfusion or third party distributions, they often change dependencies without checking if it actually works or no.

Getting the actual bitrate of a MKV track is an expensive operation, and while some MKV contains some metadata (which can be wrong) of the track bitrate, FFmpeg does not write or read it yet.

But displaying 0.001kbps is a bug for sure.

@dbenjaminmiller
Copy link
Author

Yep, so I have revised the title to reflect the bug within HB.

@earlhansen
Copy link

Handbrake (version 20200613000000-012a0f1-unknown (x86_64)) was working under F33 with no problems noted, and when I upgraded to F34, I started having problems (video but no audio). The version I use is the RPM (installed) version, I tried Flatpak (installed) version and ended up with more problems, hit and miss video and the same with audio (just random sections encoded to the output file).

I also tested a theory to see if it was isolated to just Handbrake, the same happens with MakeMKV v1.16.3. My FFMpeg version is 4.4-2.fc34.src.rpm.

@sr55
Copy link
Contributor

sr55 commented Jul 11, 2021

There is no official RPM builds for Fedora. RPM Fusion is on our black list for known broken builds due to invalid linking of libraries.

Have either of you tried the flatpak nightly?

@earlhansen
Copy link

Yes I have. My problems have now been fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

4 participants