MP4, MOV & MKV Viewer, Video Player with Sound

MP4, MOV & MKV Viewer, Video Player with Sound, a VS Code extension by Zovo

Click an .mp4, .mov, .mkv, .webm or .avi file and it plays in a video player inside VS Code with its sound, which VS Code's own player leaves out for AAC audio.

Install in VS CodeOpen the Marketplace page

Free, MIT license. Needs VS Code 1.90.0 or newer. Extension ID zovo.video-preview-with-sound, version 0.2.5.

Version 0.2.5 plays AAC sound in MP4 and MOV with nothing to install, on Windows, Linux and macOS. A built-in decoder ships inside the extension. It also adds a picture-in-picture button (P).

Version 0.2.0 added three things. Videos VS Code can't decode, such as Apple ProRes, MPEG-4 Part 2 and AVI, are converted to H.264 with your ffmpeg and then play. Subtitles from an .srt or .vtt file next to the video show up by themselves. And each video opens where you stopped it last time.

talk.mp4 playing in VS Code with the subtitle line "Subtitles from talk.srt load by themselves." drawn at the bottom of the picture. The CC menu in the control bar shows "CC: Subtitles (SRT)", and the chip says "Sound: on (ffmpeg)"
An H.264 and AAC MP4 paused in Video Preview with Sound. The control bar shows frame 137 at 0:04.577, an A-B loop from 3.3 s to 6.0 s marked on the seek bar, and the chip "Sound: on (afconvert, 0.1 s)". The metadata panel lists H.264 1280 x 720 at 30 fps, 180 frames, AAC 48000 Hz stereo at 96 kb/s

Real output from VS Code 1.142 on macOS. The four new screenshots above and below come from the 0.2.0 VSIX installed in a clean VS Code profile, with test clips made by ffmpeg. scripts/e2e-vscode.mjs opened the 6-second sample from scripts/make-samples.js with this extension, clicked Play, set the loop with the A and B keys and took the window screenshot over the Chrome DevTools protocol. The webview measured the sound level at 0.12 RMS while it played. VS Code's own player gives 0 on the same file.

A 4-second Apple ProRes 422 .mov playing at 0:02.316. The chip reads "Converted (ffmpeg, libx264, 0.1 s)"
The same 20-second video opened again: the toast says "Resumed at 0:14. Home goes to the start."

Quick start

  1. Install Video Preview with Sound. MP4, MOV and M4V files with AAC sound play with no other install. For MKV, WebM, AVI and AC-3 sound, add ffmpeg: winget install ffmpeg on Windows, sudo apt install ffmpeg on Linux, brew install ffmpeg on macOS.
  2. Click a video in the Explorer and press Space.

If VS Code asks which editor to use for .mp4, pick "Video Preview with Sound" (VS Code has its own simple preview too). Run "Video Preview: Get Started" from the Command Palette for a short tour.

Questions people ask

Is MP4, MOV & MKV Viewer, Video Player with Sound free?

Yes. MP4, MOV & MKV Viewer, Video Player with Sound is free and MIT licensed.

How do I install MP4, MOV & MKV Viewer, Video Player with Sound?

Click "Install in VS Code" above, or search for zovo.video-preview-with-sound in the Extensions view.

Why VS Code mutes your videos

VS Code's built-in Chromium ships with the H.264 video decoder but without AAC. We tested this on VS Code 1.142 (Electron 43, Chrome 150) before writing any player code. canPlayType and WebCodecs both say AAC is supported, but decoding fails, and the audio element reports 0 decoded bytes. MP3, FLAC and WAV sound do play. VS Code 1.142 also has no Matroska demuxer: an .mkv or .webm in its video element fails with "FFmpegDemuxer: open context failed", even with VP9 and Opus inside. So the extension reads the codec from the file header and picks one of these paths.

The file hasWhat happensHelper
H.264, HEVC or VP9 video with MP3 or FLAC soundVS Code plays it directlynone
AAC (mono or stereo), ALAC, PCM or MP3 sound in MP4, M4V or MOVthe sound is decoded and plays next to the muted videonone (built-in decoder), or ffmpeg or afconvert if found
AC-3, E-AC-3, DTS, Opus or 5.1 AAC sound in MP4, M4V or MOVthe sound is decoded to FLAC and plays next to the muted videoafconvert (macOS) or ffmpeg
MKV or WebMvideo copied into MP4, sound converted to FLAC, one file. VP8, Theora, MPEG-4 Part 2 or MPEG-2 video is converted to H.264ffmpeg
no audio trackplays, and the chip says "No audio track"none
ProRes, MPEG-4 Part 2, DNxHD or other video VS Code can't decode, and .avi, .wmv, .flv, .mpg, .mpeg, .ogv, .m2tsconverted to H.264 (libx264, or VideoToolbox or Media Foundation if your ffmpeg has no libx264), sound to FLACffmpeg

The decoded sound (FLAC from ffmpeg or afconvert, WAV from the built-in decoder) goes into the extension's own storage folder and is reused next time, so a file is only decoded once. The cache keeps the newest 2 GB by default. "Video Preview: Clear Sound Cache" empties it.

An MKV file with H.264 and AAC, remuxed by ffmpeg in 0.1 s, playing with the metadata panel open

Controls

KeyAction
Space or K, or click the picturePlay or pause
, and .One frame back or forward
Left and Right5 s back or forward (with Shift, 1 s)
[ and ]Slower or faster, 0.1× to 4×
A, then BSet the loop start and end. The loop turns on and shows on the seek bar
LLoop on or off
MMute
SSave the current frame as a PNG at the video's full size
IShow or hide the metadata
CSubtitles on or off
HomeBack to the start

The metadata panel shows container brands, duration, codec, frame size, frame rate, frame count, bitrates, sample rate, channels and language, read by mp4box.js from the file header. "Copy info" puts it on the clipboard as plain text. Frame PNGs get a name like clip-00m12s345-f370.png, so you can tell later where they came from.

Light theme, paused at frame 82 at half speed after stepping back three frames
A VP9 and Opus WebM file remuxed by ffmpeg and playing with sound

Settings

SettingDefaultWhat it does
videoPreview.soundHelperautoauto uses ffmpeg if it's found, else afconvert on macOS, else the built-in decoder. ffmpeg, afconvert, builtin or off force one choice
videoPreview.ffmpegPathemptyFull path to ffmpeg. Empty means search PATH, /opt/homebrew/bin and /usr/local/bin
videoPreview.decodeSoundAutomaticallytrueOff means the helper waits for a click on "Turn on sound"
videoPreview.maxDecodeSizeMB4096Bigger files still play, without sound, and the chip says why
videoPreview.cacheSizeMB2048Disk space for decoded sound and remuxed files
videoPreview.helperTimeoutSeconds900The helper is stopped after this long
videoPreview.convertUnsupportedVideotrueConvert video VS Code can't decode to H.264 with ffmpeg by itself. Off means a Convert button
videoPreview.subtitles.autoLoadtrueLoad .srt and .vtt files with the same name as the video
videoPreview.rememberPositiontrueOpen each video where you stopped it, and keep the volume
videoPreview.autoplayfalseStart playing as soon as a video opens
videoPreview.askForRatingtrueAsk for a Marketplace rating after 3 files opened without an error on 2 different days. "Later" asks one more time after 7 days, "No thanks" never again. It never asks after an error. Turn it off with false.
videoPreview.showSupportLinkstrueShow the small Sponsor and More free viewers links under the player controls

Privacy and safety

The extension makes no network calls and has no telemetry. The webview runs under a strict Content Security Policy with no inline or remote scripts, and file names and metadata are only ever set as text. Nothing in a video file is run. The helper is started with an argument list and no shell, ffmpeg reads the input through file: so a crafted file name can't act as an option or protocol, and closing the tab stops it. In an untrusted workspace no helper starts until you click "Turn on sound". The built-in decoder still gives AAC sound there, because it starts no program: it is WebAssembly with no file or network access of its own, run in a worker thread that reads the one file in pieces. ffmpeg isn't bundled, so no GPL or LGPL code ships with this extension. The built-in decoder is Symphonia (MPL-2.0). Its source is in wasm/ in the repository.

Known limits

Without ffmpeg, a ProRes file shows "This video uses Apple ProRes 422, which VS Code cannot play. Install ffmpeg to convert it for playback." with Settings and Open in default app

License

MIT. mp4box.js is BSD-3-Clause, see THIRD-PARTY-NOTICES.md.

Guides

Install MP4, MOV & MKV Viewer, Video Player with Sound

Click the button to open VS Code and install it, or press Ctrl+P (Cmd+P on macOS) in VS Code and run ext install zovo.video-preview-with-sound.

Free, MIT license. Needs VS Code 1.90.0 or newer. Extension ID zovo.video-preview-with-sound, version 0.2.5.

Source code and issues are on GitHub.

All our VS Code extensions

Support this work

If this extension saves you time, you can support the work on GitHub Sponsors. Monthly tiers start at $5, and one-time tiers start at $15. Sponsorship is optional, and the tool works the same without it.