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

Bigger preloaded buffer for keyframe jumps #563

Open
3 tasks done
wow-rambler-project opened this issue Dec 20, 2020 · 9 comments
Open
3 tasks done

Bigger preloaded buffer for keyframe jumps #563

wow-rambler-project opened this issue Dec 20, 2020 · 9 comments

Comments

@wow-rambler-project
Copy link

wow-rambler-project commented Dec 20, 2020

I operate on key-frames only in quite big and long files (4K 60fps, 1-5 hours). LosslessCut handles them well being to me an ideal tool to label, cut, and export sections of interest.

I noticed when jumping through key-frames that only ~30 seconds are buffered. Let's say I've got a recording with 2s key-frames. This means I can jump forward 15 times till the buffer ends and another read from the disk is required. It would be OK, but this buffering takes time.

I would like to have an option to set a bigger buffer or to have the buffer be always pre-loaded with 30s of the recording. I mean after each key-frame another one is read from the disk.

@markusd1984
Copy link

This would be very good, especially as I discovered that MS teams recordings uses a whopping 16 seconds per keyframe (about 234 frames per keyframe @14fps)!

With the growing popularity of Teams vs zoom, editing these will become more popular too (especially at work), thus it would benefit of a greater buffer or custom buffer where one can specify the amount in seconds, or perhaps better specify the buffer in x amount of keyframes and by default have LC to increase this way the buffer accordingly.

@mifi
Copy link
Owner

mifi commented Jan 26, 2021

I think these kind of things should be as automatic as possible though, it should depend on the speed of your computer and the time it takes ffmpeg to extract keyframes (per second of video). But ther ecould be a separate function to extract all keyframes from the video, if the user wants to wait for that

@markusd1984
Copy link

How is the buffer actually defined? X amount of keyframes or seconds of video?

If LC automatically buffers more keyframes (or seconds) for videos that have more keyframes per seconds would that allow for a smoother keyframe seeking experience?

.i.e a 4 minute MS Teams recordings takes me more then 10 secs to cycle through keyframes keeping ALT+L/R pressed or keep clicking.

@mifi
Copy link
Owner

mifi commented Jan 26, 2021

llc just asks ffmpeg "give me all keyframes from time X to time Y (seconds)", where X and Y is defined as a fixed period around current cursor time.
the problem is we don't know how long ffmpeg is gonna take to do that operation. It depends mostly on how long the interval is (seconds), but also how big is the file, how easy to seek in it etc.

@Knud3
Copy link

Knud3 commented May 20, 2021

This is almost a must-have feature. Also, the waveform is shown only for that +-30s from the cursor.

Maybe add setting options like:

  • Buffer x seconds (ticked as default choice and x would be 30 in default)
  • Buffer x frames
  • Buffer whole clip

mifi added a commit that referenced this issue Jan 15, 2022
- allow up to 1000 keyframes in buffer before recycling #563
- buffer the last 100 rendered waveform segments #260

also:
- implement timeout/kill for ffprobe after 30 sec
@mifi
Copy link
Owner

mifi commented Jan 15, 2022

have now done a minor improvment:

@oliko-tk
Copy link

Seria bueno poder tener una opcion para poder exportar todos los fotrogramas de uno o varios segmentos de un rango seleccionado del video .

@tjdennis
Copy link

Could you maybe just add a menu option that could scan the entire file for keyframes at once instead of doing it only while you scroll through. I always seek and cut at keyframes all the time but have to keep stopping to wait for it to find the next ones. With a menu option, you wouldn't have to change how it works for everyone else currently.

Thanks!

@mifi
Copy link
Owner

mifi commented May 9, 2022

yes that would definitely make sense. i think i just need to adapt the code so that it only renders the keyframes that are in the current view, or else i'm afraid that if html renders hundreds of thousands of frames it will become very slow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants