News for hackers. Stuff that matters.
Re:LosslessCut: The Swiss army knife of lossless video/audio... by philsnow on Monday July 01, 2024 @02:18AM (#40843066)
> As long as you cut a compressed audio / video file at the groups / jumps, you can cut it losslessly.

If you had a video with keyframes 'd'K and delta frames 'd' like

  0           1  |<-->|   2
  KdddddddddddKdddddddddddKddddddddddd
and you wanted to cut out the indicated frames, could you create a new keyframe from the keyframe marked '1' + the two following delta frames, and then another new keyframe from K{1}dddddddd? Something like

  0           1  |<-->|   2
  KdddddddddddKdddddddddddKddddddddddd
              Kdd       = keyframe "L"
              Kdddddddd = keyframe "M"
  
  KdddddddddddKdLMddKddddddddddd
Or I guess if you're creating new frames that weren't in the original, could you just rewrite all the deltas in between K1 and K2 such that those 5 frames aren't there?

  0           1  |<-->|   2
  KdddddddddddKdddddddddddKddddddddddd
  KdddddddddddKddeeeKddddddddddd
(where 'e' marks recomputed deltas)
Re:LosslessCut: The Swiss army knife of lossless video/audio... by gwbas1c on Monday July 01, 2024 @10:11AM (#40846007)
You're speculating quite a bit about what the codecs support.

See https://news.ycombinator.com/item?id=40844633. Some container formats support metadata so you can cut without reencoding.