<p>Use</p>

<pre><code>ffplay -f lavfi 'amovie=/Users/hdl/Desktop/HDLS3K.mp4:s=dv+da[v][a];[a]asplit[asp][out1];
   [asp]showspectrum=size=1280x512:mode=separate:slide=scroll[spect];
   [v]scale=640:-1[v];[v][spect]vstack[out0]'
</code></pre>

<p><code>amovie</code> usually selects only one (audio) stream. <code>dv+da</code> gets it to extract the best video and the best audio stream. The video output is scaled so that the vstack works.</p>

CC BY-SA 3.0
2018-01-18T18:52:13.970Z
Thanks, this worked, but I did have to make a little change.  Apparently it wants the spectrum size and scale set to the same value, else it spits an error.  I set them both to 640 and that did it.
HDL
CC BY-SA 4.0
2020-06-17T02:20:13.450Z
With this it seems like the spectrum visualization has a bit of a delay on it.  Any tips for improving that?
Chris
CC BY-SA 3.0
2018-01-18T17:45:05.890Z
2018-01-18T17:45:05.890Z
Gyan
<p>I'm trying to analyze a spectrogram while simultaneously checking the video, without having to switch between them.  Something like this, but with the video combined in the same output:</p>

<p><a href="https://i.sstatic.net/JfWSR.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/JfWSR.jpg" alt="enter image description here"></a></p>

<p>The idea is to be able to scrub through both video and the spectrogram so that they're synced.  Most editing software only lets me see the waveforms.  The command I used for that is as follows:</p>

<pre><code>ffplay -f lavfi 'amovie=/Users/hdl/Desktop/HDLS3K.mp4, asplit [a][out1];
[a] showspectrum=size=1280x512:mode=separate:slide=scroll [out0]'
</code></pre>

CC BY-SA 3.0
2018-01-18T19:00:22.203Z
Depending on what your user case is, you may want to have a look at [QCTools](https://github.com/bavc/qctools).
Michael Liebman
<video><ffmpeg><audio>
ffplay - Is there a way to display a video and spectrogram in the same output?
HDL
# ffplay - Is there a way to display a video and spectrogram in the same output?

(Asked by: username_0 on 2018-01-18)

I'm trying to analyze a spectrogram while simultaneously checking the video, without having to switch between them.  Something like this, but with the video combined in the same output:

The idea is to be able to scrub through both video and the spectrogram so that they're synced.  Most editing software only lets me see the waveforms.  The command I used for that is as follows:
ffplay -f lavfi 'amovie=/Users/hdl/Desktop/username_0S3K.mp4, asplit [a][out1];
[a] showspectrum=size=1280x512:mode=separate:slide=scroll [out0]'

**Tags:** video, ffmpeg, audio

> **Comments:**
> **username_1**: Depending on what your user case is, you may want to have a look at [QCTools](https://github.com/bavc/qctools).  

---

## 1 answers

### Answer by username_2 on 2018-01-18. Score: 1 | Accepted answer

Use
ffplay -f lavfi 'amovie=/Users/hdl/Desktop/username_0S3K.mp4:s=dv+da[v][a];[a]asplit[asp][out1];
   [asp]showspectrum=size=1280x512:mode=separate:slide=scroll[spect];
   [v]scale=640:-1[v];[v][spect]vstack[out0]'

amovie usually selects only one (audio) stream. dv+da gets it to extract the best video and the best audio stream. The video output is scaled so that the vstack works.

> **Comments:**
> **username_0**: Thanks, this worked, but I did have to make a little change.  Apparently it wants the spectrum size and scale set to the same value, else it spits an error.  I set them both to 640 and that did it.  
> **username_3**: With this it seems like the spectrum visualization has a bit of a delay on it.  Any tips for improving that?  

---

