Answers.Body: <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>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-18T18:52:13.970Z
Answers.Text: 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.
Answers.UserDisplayName: HDL
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-06-17T02:20:13.450Z
Answers.Text: With this it seems like the spectrum visualization has a bit of a delay on it.  Any tips for improving that?
Answers.UserDisplayName: Chris
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2018-01-18T17:45:05.890Z
Answers.LastActivityDate: 2018-01-18T17:45:05.890Z
Answers.UserDisplayName: Gyan
Body: <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>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2018-01-18T19:00:22.203Z
Comments.Text: Depending on what your user case is, you may want to have a look at [QCTools](https://github.com/bavc/qctools).
Comments.UserDisplayName: Michael Liebman
Tags: <video><ffmpeg><audio>
Title: ffplay - Is there a way to display a video and spectrogram in the same output?
UserDisplayName: HDL
ThreadText: # 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:
  
  [![enter image description here](https://i.sstatic.net/JfWSR.jpg)](https://i.sstatic.net/JfWSR.jpg)
  
  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/HDLS3K.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/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]'
  
  ```
  
  `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?  
  
  ---
  
  