-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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 #260
Comments
The main issue for rendering the whole waveform for the whole file is that I'm not sure how to effectively run through a file of many GB in a few seconds to extract a rough "zoomed out" average of the audio waveform. Even extracting audio as raw frames takes similar time.
Basically here I'm resampling audio to 100Hz which somewhat speeds up but gives less detail when zoomed in. With a 400MB video file that is 1hr long, this operation takes about 10 seconds. |
Any reason why not to make lookup table/list of 30s fragments for whole video and use that as cache? |
No, just that it needs more logic implemented to handle properly the overlap etc |
I was wondering why I only saw parts of the waveform, that explains :D but definitely would be good to be able to get a full render for up to 1-2hrs max, if somebody wants a waveform I don't see why one wouldn't want to wait 10-20secs. :) Certainly for smaller videos would be good, mine was less then 2mins and still only showed parts. When clicking into different timeline areas other parts are loaded instead of the waveform being combined/kept, which would be nice to maintain (e.g. I click the beginning, middle and end and would have the full waveform timeline visible). |
Yea definitely could implement some longer waveform rendering some day |
👍 if loading the entire waveform is more difficult perhaps until then a stich together waveforms while clicking into different areas of the timeline (if that's easier to implement). |
@mifi Is it possible to tackle just this? I think this is a much lower hanging fruit than actively parsing the entire file. |
just keeping the already rendered segments and rendering them all shouldn't be too hard, but I'm afraid that it will cause losslesscut to slow down more and more, as it will have more and more waveforms to render |
@mifi How about a sane upper time limit for now? Something like 10 minutes. It covers most songs. |
I was using I did some research, here's what I found (timing on 1 Gig mp4 files with aac, 6 years old laptop with i5-6300u):
I set the commands to produce 10 numbers per second of audio. The resulting files are around 1 MB (for 3+ hours of video). I think it's more than reasonable to wait 20 seconds and spend 1 MB of drive space to get a nice zoomable waveform for the rest of your workflow (rendered via eg peaks.js or wavesurfer.js). Regrettably I don't have enough time to familiarize myself with the codebase of this project to create a meaningful PR. test commandsThe input audio rate is 48k.
|
Have now done a minor improvement:
|
Seria bueno poder tener una opcion para poder exportar todos los fotrogramas de uno o varios segmentos de un rango seleccionado del video. |
Do you think it is reasonable to adjust the Line 90 in 96ca159
Also, at many places I've encountered the waveform to be specified at 30 seconds while ffmpegExtractWindow says it is actually 60 seconds (up to 30 seconds before and up to 30 after the current time). Is this correct?
Thanks |
i'll add it to the list above |
yes it can be zoomed in, although resolution is limited |
Thanks for the update! I'm looking forward to a solution for using the waveform for the whole timeline. Currently I write down the cut times in Potplayer (mouse-over video-preview) or davinci resolve (full waveform) and cut afterwards in losslesscut. If I could see the silences of the long zoom conferences/courses, I could do everthing in losslesscut. |
@mandrael you mean this? |
Hi @mifi, "implement full screen audio waveform" you said. How? How to make the view larger? Also have a problem when trying to export segments in smartcut... |
I'm sorry, but I failed to find a way to view waveform in such full height mode, is there anything to update to the tutorial? @mifi This is 3.54: This is 3.45: |
@JokerQyou you double click on the waveform icon, then it will show full screen view. Or isn't double click working? Maybe it needs to be documented better.
Maybe I can have an option for whether the waveforms should be separated or merged together (it's an option for ffmpeg.) |
@Dean-Corso I'm not mad, but tbh when reading your comments it seems like you are furious. I'm a bit sad though that I have to spend so much time and energy reading your comments, because they contain 90% rant/negativity and 10% actual useful information, so when I see a 1000 word comment from you it doesn't make me want to read through all of it, and I will instead prioritise other issues. Also most of it is off-topic so it doesn't belong at all in the issue that you post it in. Please search for existing issue first before you comment and then comment in the respective issue: As stated quite clearly, smart cut it experimental, so you cannot expect it to work perfectly. However if you have an issue, please provide a reproducible case so I can work on fixing the issue. Your ranting is not helpful at all. as for why the title bar doesn't change color to match the dark/light mode, it's because you have to restart the app for the title bar to update.
I don't know where to start. |
@mifi Indeed it works! Although it's not double-clicking, feels more like clicking to open the waveform view and then clicking again to open the full-height waveform view. Some suggestions:
|
Not sure I understand, you mean double clicking doesn't work? as in you have to wait a certain time between your clicks, or else it registers as one click only? Which OS are you on?
Will add a TODO
I will add that. |
It worked but feels strange, and does not seem like a double click. I'm on macOS. Here's the steps:
Clicking quickly twice would work, of course. |
I also find the lower waveform now behaves differently, and feels a lot slower. Previously in 3.45, the lower waveform view would generate new waveform whenever:
But with 3.54, the waveform would only generate when:
This makes editing with waveform much slower, as I have to constantly pause and click to see new waveforms. Is this change intentional? Update It seems to only occur for files with very long duration (40 minutes to 1 hour). I'll do more testing. |
@mifi, is there a way to differentiate between a "this is a silent range" from "this is a range whose waveform was not rendered yet"? Being able to know it from a glance at the waveform bar would be a HUGE advantage. |
i will fix that |
#260 (comment) and fix dark mode for mini waveform
Waveform can currently only be rendered for a short section (now set to 30 sec), because rendering longer will take a lot of time. Need to find a way to quickly render a waveform of a long track. (hours long)
Inspiration:
The text was updated successfully, but these errors were encountered: