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

WebTorrent Desktop can't play media files that don't contain audio #759

Open
FluorescentHallucinogen opened this issue Aug 4, 2016 · 9 comments

Comments

@FluorescentHallucinogen
Copy link

What version of WebTorrent Desktop? (See the 'About WebTorrent' menu)

0.9.0 (0.95.2).

What operating system and version?

Microsoft Windows 7.

What did you do?

Play media files that contain only video stream and do not contain audio stream.

What did you expect to happen?

WebTorrent Desktop successfully plays the media files (video without audio).

What actually happened?

WebTorrent Desktop shows "Audio codec unsupported" message.

@feross
Copy link
Member

feross commented Aug 4, 2016

Ahh, yes. This is an artifact of the way that we detect that audio is not working. If we see that 0 bytes of audio are decoded, then we assume it's an error.

This is not ideal. cc @dcposch

@mathiasvr
Copy link
Contributor

It would be nice if we could use the HTMLMediaElement.audioTracks property, but it isn't widely supported yet. Here is an issue tracking it for chromium https://bugs.chromium.org/p/chromium/issues/detail?id=249427.

@dcposch
Copy link
Contributor

dcposch commented Aug 5, 2016

@feross ya, that sucks. I see two ways to fix it:

  1. Wait for Chromium to add support for audioTracks
  2. Parse the video stream in JS, like https://github.com/jhiesey/videostream .

Problem w/ #2 is we have to write code for each container type (MP4, MKV, etc), as far as I can tell.

@ghost
Copy link

ghost commented Aug 31, 2018

I ran into this bug today. Here's an example video, a short CC-licensed 4K animation with no audio track:

magnet:?xt=urn:btih:ebd69f7d7a9b7bd61c7f3afa49f7a8c5fefb2620&dn=Zen+Photon+Garden%2C+Expanding+Particles+%2312+(4K)+2304p.mp4&tr=https%3A%2F%2Fdiode.zone%2Ftracker%2Fannounce&tr=wss%3A%2F%2Fdiode.zone%3A443%2Ftracker%2Fsocket&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fdiode.zone%2Fstatic%2Fwebseed%2F6f111ebd-d595-4b01-97b1-903d9a694665-2304.mp4

@hicom150
Copy link
Contributor

It should be fixed with #1711

@hicom150
Copy link
Contributor

It would be nice if we could use the HTMLMediaElement.audioTracks property

I made an attempt with #1712 😉

@feross
Copy link
Member

feross commented Oct 1, 2019

@hicom150 Should both of those PRs (#1711 and #1712) be merged for this issue to be fixed?

@hicom150
Copy link
Contributor

hicom150 commented Oct 1, 2019

Unfortunately, although we have added support for audioTracks in #1711, audioTracks only exposes the tracks that have been successfully decoded. So we are not able to distinguish between unsupported audio track and no audio track 😭

As @dcposch commented earlier, the only way I see to know the exact number of tracks (supported and unsupported) is to parse MP4 and WebM video containers in JS to extract this info 😰

@hicom150
Copy link
Contributor

I've added #1731 with an experimental MP4 and WebM video container parser to solve this problem 😉
Please give it a try and of course any suggestions or improvement is more than welcome! 👍

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

No branches or pull requests

5 participants