I found this problem with all ffmpeg-based editors...does anybody know of an editor capable of cutting between inter-frames? The same happens with sound files, which is inconvenient.
I found this problem with all ffmpeg-based editors...does anybody know of an editor capable of cutting between inter-frames? The same happens with sound files, which is inconvenient.
This is how it's been done traditionally, since basically forever as far as I can remember. To be honest, I think modern tools could do better. If you happen to want a cut just 20 frames after a keyframe, those 20 frames could be computed (decoded) in order to create a new keyframe right in the spot you wanted. There are a myriad tools to do the typical lossless easy cut, but no idea of one that goes the extra mile to do this more advanced technique.
UPDATE: Navigating the GitHub issues I found out that this is indeed an in-progress experimental feature! That's amazing -- https://github.com/mifi/lossless-cut/issues/126
All the P-frames and B-frames in between two I-frames have to be recomputed. That’s by definition re-encoding and not lossless.
You could re-encode just that small segment though.
It is possible, it will just be a ridiculously large video.
> Mentally, I think of P frames as containing "changes" in the frame. The changes would be the same regardless of whether or not the previous frame was an I or P frame.
P-frames in modern codecs use multiple previously decoded frames, not just the previous frame. And I'm not getting into the complexity of frame ordering (decoded frames and presented frames can be ordered differently).
You can do that, but it’s container format-dependent (e.g. mov edit list) and player support is uneven. If the player doesn’t support it you get extended cut and A/V desync.
Ha true, I guess you could encode every P/B frame after the cut as an I-frame.
These algorithms had methods have existed for 20 years - nearly that long ago, I held in my hand a single DVD with thirty full-length movies on it - all compressed losslessly using such an codec on a laptop. I actually accepted a job with the company (they even sent tickets for the flight out to Seattle for my first day on Monday) before calling me on Friday afternoon to tell me that the company had been acquired by a government-related entity and my role (being public-facing) was not needed. (Pissing me off because I'd turned down another good offer to take theirs!) It's the only time I've ever even heard of getting laid off before you start. The company vanished from the face of the earth that week...
That's an extraordinary claim, I presume you can present the requisite extraordinary evidence?
>single DVD with thirty full-length movies on it - all compressed *losslessly* using such an codec on a laptop
But at what resolution, fps, color space ? Storing the same gray scale image over and over again, as in most old security camera footage, takes up very little space.
Besides that the only way to losslessly re-encode frames is to use lossless encoding, which would easily be a 50-100x size bloat.
You end up with a tiny bit of wasted data, but it's happy middle ground compared to having to give up the key selling point
You can also leave out the B-frames prior to the new start time.
Some containers such as Matroska are able to store an offset (and ffmpeg does that), so it starts playing from exact wanted position even though the actual stream contains data since the last keyframe. Some players ignore that though.
What happens is that every so often it sends a complete image - the intra frame - and then sends differences to show what changes from frame to frame. This is a complete and utter pain in the tits to edit with, so most people transcode to an intraframe codec like DNxHR or ProRes although there's absolutely nothing wrong with MJPEG or MPEG2 intra-only.
If you don't re-encode, you're limited to cutting at an intra frame because that's where it starts drawing from. If you don't you get all this weird "ghost trail" stuff happening.
Costs $18.99 on App Store!
brew install losslesscut
is free :-)