webtorrent-desktop
webtorrent-desktop copied to clipboard
WebTorrent Desktop can't play media files that don't contain audio
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.
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
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.
@feross ya, that sucks. I see two ways to fix it:
- Wait for Chromium to add support for
audioTracks
- 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.
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
It should be fixed with #1711
It would be nice if we could use the HTMLMediaElement.audioTracks property
I made an attempt with #1712 😉
@hicom150 Should both of those PRs (#1711 and #1712) be merged for this issue to be fixed?
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 😰
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! 👍