0

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

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]'
1
  • Depending on what your user case is, you may want to have a look at QCTools. Jan 18, 2018 at 19:00

1 Answer 1

1

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.

2
  • 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
    Jan 18, 2018 at 18:52
  • With this it seems like the spectrum visualization has a bit of a delay on it. Any tips for improving that?
    – Chris
    Jun 17, 2020 at 2:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.