microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.44k stars 28.62k forks source link

Add support for AAC codec in webviews to read MP4 audio correctly #167685

Open pilattebe opened 1 year ago

pilattebe commented 1 year ago

Currently MP4 videos with an AAC audio codec don't play audio in VSCode.

AAC is currently the most popular audio codec, it is the default on many softwares like OBS and other capture softwares. As such it is used in screen recordings for documentations in many projects.

Supporting AAC in webviews would allow the user to preview documentation .md files containing videos. And also allow the user to use mp4s in python notebooks (eg: Machine learning / data science applications).

Currently it is impossible to make a video readable both by MacOS (QuickTime) and VSCode because there is no overlap in the supported audio formats. Supporting AAC is essential to make sure that the documentation is readable on all platforms.

VSCode includes FFMPEG as a dependency and it already includes the necessary AAC codecs. This proposal will not include new dependencies but only enable codecs already present in VSCode through FFMPEG.


Useful link: Release Notes: supported audio and video formats

After reading the release note above, I am curious as to why this hasn't been fixed at the same time.

isidorn commented 1 year ago

Duplicate of https://github.com/microsoft/vscode/issues/162062 But we can keep this one open to track user requests.

In short - we can not ship AAC as part of VS Code because we did not get approval from our Lawyers due to some codec rights and fees.

pilattebe commented 1 year ago

Every platform appears to support this: Windows, MacOS, most browsers.

Maybe using the system codec could fix this legal issue.

Or as an optional/extension, Ubuntu for exemple by default doesn't install proprietary codecs but lets the user do so via packages.

devgid commented 1 year ago

AAC is the audio format used in most MP4 video files so would really help if it can be supported.

If it cannot be supported in core vscode due to legal reasons then why not have one of the devs either release an extension with code that does or release it as a mp4 preview extension as vscode support having multiple video previewers. That way the extension does not have to be released under Microsoft. There are other Microsoft developers like lostintangent and mattbierner who release popular extensions in their own name.

There is currently another mp4 preview extension but doesn't support AAC due to webview audio restrictions https://marketplace.visualstudio.com/items?itemName=analytic-signal.preview-mp4

Not sure if the legal limitation is the webview itself that needs support for AAC.

pilattebe commented 1 year ago

As I understand it from the replies and other duplicate issues. It's not that there definitely is a legal problem with using AAC. It's that the dev team didn't get a response from their legal department. That means that for the time being, this issue is on Microsoft's side.

That said I don't think anyone here is opposed to a workaround. But it would be wise to first check if there is a problem before trying to solve it.

kupix commented 8 months ago

Not just a problem with .mp4 video files, this seems also to prevent playback of AAC audio files in browser views, internal live preview, etc. Any solution should fix audio-only playback and decoding.

devgid commented 7 months ago

Impossible to get full demand as issues are just closed with "as-design" as reason. Some issues had as many as 51 upvotes before closed. #158972 #167685 #179385 #72280 #162062 #187525

meds commented 2 weeks ago

Is this the same reason why if I embed an mp4 video in the vscode editor using the Custom CSS and JS loader extension the video won't play past the first frame if videoElement.muted is not set to true?