webtorrent-desktop icon indicating copy to clipboard operation
webtorrent-desktop copied to clipboard

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

Open FluorescentHallucinogen opened this issue 8 years ago • 9 comments

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.

FluorescentHallucinogen avatar Aug 04 '16 08:08 FluorescentHallucinogen

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

feross avatar Aug 04 '16 22:08 feross

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.

mathiasvr avatar Aug 05 '16 00:08 mathiasvr

@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.

dcposch avatar Aug 05 '16 00:08 dcposch

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

ghost avatar Aug 31 '18 16:08 ghost

It should be fixed with #1711

hicom150 avatar Sep 28 '19 14:09 hicom150

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

I made an attempt with #1712 😉

hicom150 avatar Sep 28 '19 15:09 hicom150

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

feross avatar Oct 01 '19 04:10 feross

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 avatar Oct 01 '19 17:10 hicom150

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! 👍

hicom150 avatar Oct 22 '19 15:10 hicom150