Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Some files have no sound, some can't play video. #146

Open
n1kk opened this issue May 25, 2021 · 11 comments
Open

Some files have no sound, some can't play video. #146

n1kk opened this issue May 25, 2021 · 11 comments

Comments

@n1kk
Copy link

n1kk commented May 25, 2021

I've tried to run the ugly demo project with prebuilt binaries under Linux (Ubuntu 21.04) and it has inconsistent playback behavior. Some files play fine, some have no sound, some have no video.

In logs I can see that it fails to find/load codecs, but the VLC itself is playing those videos just fine.

@RSATom Can you help me figure out how to solve this?

In logs for missing audio I can see Codec 'eac3' (A/52 B Audio (aka E-AC3)) is not supported

looking for video decoder module matching "any": 15 candidates
using ffmpeg Lavc58.91.100
CPU flags: 0x000fd3db
allowing 6 thread(s) for decoding
codec (h264) started
using frame thread mode with 6 threads
using video decoder module "avcodec"
looking for packetizer module matching "any": 25 candidates
using packetizer module "a52"
looking for audio decoder module matching "any": 20 candidates
reusing audio output
too low audio sample frequency (0)
keeping audio output
failed to create audio output
using ffmpeg Lavc58.91.100
CPU flags: 0x000fd3db
codec not found (A/52 B Audio (aka E-AC3))
no audio decoder modules matched
Codec `eac3' (A/52 B Audio (aka E-AC3)) is not supported.
Codec not supported
VLC could not decode the format "eac3" (A/52 B Audio (aka E-AC3))
killing decoder fourcc `    '
removing module "a52"

In logs for missing video I can find Codec 'hevc' (MPEG-H Part2/HEVC (H.265)) is not supported.

looking for video decoder module matching "any": 15 candidates
using ffmpeg Lavc58.91.100
CPU flags: 0x000fd3db
codec not found (MPEG-H Part2/HEVC (H.265))
no video decoder modules matched
Codec `hevc' (MPEG-H Part2/HEVC (H.265)) is not supported.
Codec not supported
VLC could not decode the format "hevc" (MPEG-H Part2/HEVC (H.265))
killing decoder fourcc `    '
looking for audio decoder module matching "any": 20 candidates
using audio decoder module "faad"
looking for meta reader module matching "any": 2 candidates
@RSATom
Copy link
Owner

RSATom commented May 25, 2021

Can you please provide those files for testing?

@n1kk
Copy link
Author

n1kk commented May 25, 2021

Oooh. Those are big files. But I'll see if I can encode some small samples with those codecs to reproduce the issue.

@n1kk
Copy link
Author

n1kk commented May 26, 2021

Here are 4 test files I've made with two video codecs and two audio

  • Spring_Blender_Open_Movie_20sec_1080p_h264_aac.mkv: plays video, plays audio
  • Spring_Blender_Open_Movie_20sec_1080p_h264_e-ac3.mkv: plays video, no audio
  • Spring_Blender_Open_Movie_20sec_1080p_h265_aac.mkv: no video, plays audio
  • Spring_Blender_Open_Movie_20sec_1080p_h265_e-ac3.mkv: no video, no audio

All files play in VLC if opened directly.

Spring_Blender_Open_Movie_20sec_1080p.zip

@RSATom
Copy link
Owner

RSATom commented May 31, 2021

FYI, I didn't find solution yet but atm I have a feeling Electron applies some restrictions to child process which libvlc doesn't like and can not load some plugins. I'm still trying to find the reason...

@n1kk
Copy link
Author

n1kk commented May 31, 2021

Thanks for looking into it!

Have you tried it on Linux or on other OS (Win/Mac) ?

Wondering if it's Linux specific issue.

@RSATom
Copy link
Owner

RSATom commented May 31, 2021

No, I didn't. But I'm sure 90% it's Linux specific.

@n1kk
Copy link
Author

n1kk commented Jun 1, 2021

I tried disabling sandbox in electron in every way they allow it in their docs but it doesn't help.

Found this MR to electron: electron/electron#15894 something about mixed sandboxing specifically for linux. I'm not skilled enough to figure out if that's related or any helpful at all :(

I also tried building mpvjs project, after eventually succeeding it ended up having exactly the same problem.

@RSATom
Copy link
Owner

RSATom commented Jun 2, 2021

Hm... interesting... Thanks for sharing this info.

@RSATom
Copy link
Owner

RSATom commented Jun 8, 2021

I think I've found the reason and it's old issue: #69 (comment)
In two words: Electron is shipping with its own version of libffmpeg.so and it exports some functions with the same name as libavcodec.so used by libvlc. So libvlc just uses function from wrong .so and it breaks everything...

@n1kk
Copy link
Author

n1kk commented Jun 10, 2021

Hm, interesting. So what can be a possible workaround here? I've seen some issues that asked how to use custom ffmpeg in electron instead of built in one. Would that be a possible course of actions?

@RSATom
Copy link
Owner

RSATom commented Jun 10, 2021

If you will be able rebuild ffmpeg with all required codecs - then you will not need WebChimera.js at all.
Other possible solution - hack .so import/export tables at runtime to workaround conflicts. But it's pretty complex solution and I don't sure how much effort it could take.

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

No branches or pull requests

2 participants