Disable Audio or Video in FFplay
When using FFplay, the command-line media player included with the FFmpeg framework, you may occasionally need to play a file without its audio or video stream. This guide provides the exact command-line arguments required to disable audio or video playback in FFplay, helping you customize your media viewing and testing environment.
Disabling Audio Playback
To disable audio playback in FFplay, use the -an option.
This tells FFplay to ignore the audio streams within the container,
resulting in video-only playback.
Run the following command in your terminal:
ffplay -an input.mp4Replace input.mp4 with the path to your media file.
Disabling Video Playback
There are two ways to disable video in FFplay, depending on whether you want to disable the video stream decoding entirely or just suppress the display window.
Option 1: Disable the Video Stream completely
To completely disable video stream decoding and play only the audio,
use the -vn option:
ffplay -vn input.mp4Option 2: Disable the Graphical Display Window
If you want the audio to play but want to prevent the graphical
playback window from opening at all, use the -nodisp
option:
ffplay -nodisp input.mp4This is particularly useful when running FFplay in a headless environment or purely command-line interface where no X11 or GUI display is available.