GithubHelp home page GithubHelp logo

Comments (5)

mifi avatar mifi commented on May 19, 2024 1

My experience is also that -ss both before and after -i is fast, so I don't understand why it's so slow for @umaar

from editly.

chapmanjacobd avatar chapmanjacobd commented on May 19, 2024

Slow trimming

I think it's definitely possible to use -ss -i -ss to quickly seek to let's say 4 seconds "before" (I guess ffmpeg seeks backwards and doesn't reverse if go too far) the calculated target duration (lossless), then slowly seek with keyframe accuracy (re-encode). but I'm not sure. maybe we would need to do a fast cut for the bulk of the clip and then do a re-encode for the start and end of the clip, (then concat those parts together...) It depends on the video codec and I'm not sure how ffmpeg handles this

related to: mifi/lossless-cut#126 which is related to mifi/lossless-cut#13

from editly.

mifi avatar mifi commented on May 19, 2024
  1. The reason why editly does scale all videos to the same size is because it has to be 100% sure of the output size (width x height x channels, rgba raw video out) when processing frames, or else it will lose sync in the data stream. It is also a technical impossibility to have multiple different resolutions in one video (afaik).

  2. how big is the output resolution of your project? and how slow is it? there are probably some performance optimizations that can be done in the way I handle raw frames, and in fabric.js (which is used to overlay and draw text), but I'm not sure where is the bottleneck

  3. Seeking should not be very slow, because it is using a fast seek (-ss ... -i ...) which AFAIK is now also accurate and fast at the same time. How long does it take to seek before it starts producing frames? (--verbose)

Out of curiosity, are you specifying duration of your video clips? if you are, that possibly means the clips are being sped up, which can slow things down.

from editly.

chapmanjacobd avatar chapmanjacobd commented on May 19, 2024

I think most of these comments aren't about editly specifically but about how we are handling ffmpeg which would help the video-everyday project.

Fast and accurate should be possible

https://superuser.com/a/704118/76968

Edit: hmmmm

https://www.reddit.com/r/ffmpeg/comments/aq98eu/help_frame_accurate_keyframe_seek_with_stream_copy/

Looks like the behavior changed in the last few years:

When used as an input option (before -i), seeks in this input file to position. Note that in most formats it is not possible to seek exactly, so ffmpeg will seek to the closest seek point before position. When transcoding and -accurate_seek is enabled (the default), this extra segment between the seek point and position will be decoded and discarded. When doing stream copy or when -noaccurate_seek is used, it will be preserved.
When used as an output option (before an output filename), decodes but discards input until the timestamps reach position.

So moving the -ss shouldn't make any difference

Maybe accurate seeking is just not possible in actuality. "in most formats it is not possible to seek exactly"

from editly.

umaar avatar umaar commented on May 19, 2024

Thanks for chiming in anyway! After some research it seems that a big reason is just the videos are so large, they are 4K videos for example. Other professional video editing tools use hardware acceleration which is why it appears faster when using them.

from editly.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.