# Play video and sound

**URL:** https://discourse.julialang.org/t/play-video-and-sound/6498
**Category:** Visualization
**Tags:** question, video, sound
**Created:** [October 17, 2017, 11:02am UTC](https://discourse.julialang.org/t/play-video-and-sound/6498 "2017-10-17T11:02:02Z")
**Posts on this page:** 1
**Showing post:** 11

<div class="post-metadata">

### Author: ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)
#### Post date: [September 15, 2026, 8:23pm UTC](https://discourse.julialang.org/t/play-video-and-sound/6498/11 "2026-09-15T20:23:33Z")

</div>

> [@yakir12](#):
>
> Is there a way we can play a video _and_ its sound currently in Julia?

Yes and no, I could do it with:

```julia-auto
julia> video_path = ".vscode/extensions/openai.chatgpt-26.715.31925-linux-x64/webview/assets/appshot-demo-DcV9m9GT.mp4";

julia> # wait=false runs it in the background so your Julia REPL doesn't freeze!
       p = run(`mpv --vo=x11 --hwdec=no --autofit=1280x720 $video_path`, wait=false);

julia> # You can stop or kill the playback programmatically from Julia at any time:
       # kill(p)

```

[You might not actually need some options, like that `-vo=x11` (or `--hwdec=no`) for me without it I got a segfault “Aborted (core dumped)”); I was just using it for my broken Linux setup (apparently EGL and GLX is broken for me). I’m not sure what this does on non-Linux, hopefully ignored.]

needing first setup (this might be different across different Linux, even if you have apt-get):

```julia-auto
$ sudo apt install mpv libmpv-dev

```

Note the file I found and used above DOES have audio, just not much, so at first I though I also had audio issues… trying to debug `pulse`, for audio, that was never broken…

See (–ao=help and):  
$ mpv --vo=help

Apparently --vo=sixel might work for you, for me I could see the video in the terminal with (but not from within Julia):

```julia-auto
mpv --vo=tct .vscode/extensions/openai.chatgpt-26.715.31925-linux-x64/webview/assets/appshot-demo-DcV9m9GT.mp4

```

That will **decode and play the audio while not creating a video window** , which is also why it avoided my current (Linux) GLX graphics problem:

```julia-auto
ffplay -nodisp -autoexit video.mp4

```

Something like this might also work for you, please confirm and on which platform (probably works on all non-Linux, and Linux without my Nvidia userspace/kernel driver mismatch problems, that disabled GLX, ~~not~~ EGL):

```julia-auto
using FFplay_jll, FFMPEG_jll # the latter just for some workarounds I was trying for paths/dependencies

julia> env = Dict(
           "DISPLAY" => get(ENV, "DISPLAY", ""),
           "XAUTHORITY" => get(ENV, "XAUTHORITY", ""),
           "PULSE_SERVER" => get(ENV, "PULSE_SERVER", ""),
           "LD_LIBRARY_PATH" => joinpath(FFMPEG_jll.artifact_dir, "lib"),
       );

run(setenv(`$(FFplay_jll.ffplay()) -autoexit "vscode/extensions/openai.chatgpt-26.715.31925-linux-x64/webview/assets/appshot-demo-DcV9m9GT.mp4"`));

# Maybe just: run(setenv(`$(FFplay_jll.ffplay()) -autoexit ".vscode/extensions/openai.chatgpt-26.715.31925-linux-x64/webview/assets/appshot-demo-DcV9m9GT.mp4"`,
    "LD_LIBRARY_PATH" => joinpath(FFMPEG_jll.artifact_dir, "lib")))

```

Make sure it first works for you from the shell (the problems I had were not Julia problems, nor even arguably `ffplay` problems, which is cross-platform):

Since I get:

```julia-auto
$ glxinfo -B
name of display: :0
X Error of failed request: BadValue (integer parameter out of range for operation)
  Major opcode of failed request: 152 (GLX)
  Minor opcode of failed request: 24 (X_GLXCreateNewContext)
  Value in failed request: 0x0
  Serial number of failed request: 69
  Current serial number in output stream: 70

```

It also ruled out for me (since it uses GLX, not EGL, and I spent a lot of time how to look into fixing my GLX install…):

```julia-auto
ffplay -vn -autoexit \
  .vscode/extensions/openai.chatgpt-26.715.31925-linux-x64/webview/assets/appshot-demo-DcV9m9GT.mp4

```

Showing videos (with or without audio) is a can of worms. You can decode video separately with Julia or the audio, but what does it mean to get both (or only video), and to the screen? It implies a GUI application (or popup window from other process, just invoked by Julia as above). And that GUI application needs to work with Linux, EGL or GLX or whatever you have and can use, and ideally this application is cross-platform to e.g. Windows.

Out of the scope how to do a GUI (without or) with web tech. It might be simplest that way with something like Electron.jl or:

> [@\[ANN\] Webviews.jl - a tiny library for creating web-based desktop GUIs](https://discourse.julialang.org/t/ann-webviews-jl-a-tiny-library-for-creating-web-based-desktop-guis/91406):
>
> Hi there, I’d like to share with you [Webviews.jl](https://github.com/sunoru/Webviews.jl), a Julia implementation of webview for creating web-based desktop GUIs. Hope you find it interesting and useful. Its usage is very simple: # Julia v1.8+ on Windows/macOS or v1.9+ on Linux using Webviews w = Webview(320, 320, debug=true) navigate!(w, "https://julialang.org") run(w) A new window with a given size will be created and a Webview is attached/embedded in it. debug=true enables the dev tools, navigate! sets it to view Julia’s homepag…

---

_[View the full topic](https://discourse.julialang.org/t/play-video-and-sound/6498)._
