Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Waveform generation (speed etc.) #2035

Closed
DerGenaue opened this issue Aug 26, 2018 · 2 comments
Closed

Improve Waveform generation (speed etc.) #2035

DerGenaue opened this issue Aug 26, 2018 · 2 comments
Labels
💡 enhancement This issue describes an improvement, enhancement, or feature request for OpenShot

Comments

@DerGenaue
Copy link
Contributor

DerGenaue commented Aug 26, 2018

This issue exists to track the suggestions made in the comments of #2029;

Especially This comment:

I've dug quite a lot through the the code in the QT app (js, py), libopenshot (C++) and libopenshot-audio to see whether I could also improve the generation of the audio samples in their reduced form.

One thing I wanted to address is the samples_per_second constant, that is stored in two places (py and js).
I would have that constant transmitted together with the data in the JSON.

Also, the waveform data is based on Max-Values (see libopenshot-audio: AuidoSampleBuffer/getMagnitude)
That library also provides RMS values (Mean) which aren't exposed by the libopenshot Frame.
I learned that it is pretty useful to see visually both max peaks and average values, therefore I would propose to also expose this in libopenshot and rewrite the get_waveform python to provide both max and average values
While doing all this, I would also suggest to consistently use waveform_data as a name and not audio_data to make obvious this has a reduced sample rate.

One of the most confusing features imo is that the audio waveform contains the volumes animated on the clip; but only if they exist while the rendering is triggered.

All together, I would suggest to change the waveform JSON data to be changed to something like this:

{
    "sample_rate": 30,
    "maxData": [0.8, 0.5, ...],
    "rmsData": [0.6, 0.2, ...],
}

Which also isn't influenced by the volume values.
They should instead be rendered separately eg. as a red line on top of the waveform.

I wasn't able to implement these changes because of the dependency on the library and because I do not have a development setup right now (literally just edited the files in the installation folder).
Maybe someone of you guys can implement these changes (they should be pretty simple if you have a dev setup)

Other considerations

For speed improvements it also would make a lot of sense in my opinion, to move the generation of the waveform data completely to C++.
It should be integrated with the Clip class and also be cached, I think
I've created another issue for this on the libopenshot-repo:
OpenShot/libopenshot#156

@DylanC DylanC added the 💡 enhancement This issue describes an improvement, enhancement, or feature request for OpenShot label Aug 27, 2018
@DerGenaue
Copy link
Contributor Author

Did this get implemented?
Or what is the reason for closing?

@XanderLeaDaren
Copy link

[incomplete feature]
About generation: when changing the volume, there is no immediate change to the waveform height, however when right-click > Display > Show waveform (on an already waveform clip), the wave is updated to the corresponding height.

E.g. you have sound (100%)

  1. change it to 30 %.
  2. Volume is changed but waveform is not.
  3. right-click > Display > Show waveform
  4. Waveform is updated to less taller wave.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💡 enhancement This issue describes an improvement, enhancement, or feature request for OpenShot
Projects
None yet
Development

No branches or pull requests

4 participants