205
submitted 3 months ago by aprnu@feddit.ch to c/opensource@lemmy.ml
you are viewing a single comment's thread
view the rest of the comments
[-] eceforge@iusearchlinux.fyi 13 points 3 months ago

I suppose that makes sense given that information is encoded as a series of key frames interspersed by 'I-frames" that simply encode the delta to the previous key-frame when using most compressed video algorithms. So cutting in-between key-frames doesn't really make sense since the I-frame would no longer have anything to reference it's delta to.

[-] ryannathans@aussie.zone 2 points 3 months ago* (last edited 3 months ago)

Except if it's lossless so there's no harm in reencoding to accurately clip files

[-] mudeth@lemmy.ca 3 points 3 months ago

You're confusing cause and effect. It's lossless because it cuts at keyframes and does not re-encode.

If it did what you're suggesting it wouldn't be lossless anymore.

[-] ReversalHatchery@beehaw.org 1 points 3 months ago* (last edited 3 months ago)

I think they were talking about a special kind of media file, that is not compressed but instead stored losslessly. I think H264 can do that too.

[-] ryannathans@aussie.zone 0 points 3 months ago

Lossless codecs can be decoded and reencoded without effect

[-] mudeth@lemmy.ca 2 points 3 months ago

LosslessCut doesn't only use lossless codecs. It losslessly cuts video files encoded in lossy codecs.

[-] Hadriscus@lemm.ee 1 points 3 months ago

This has always bothered me, I suspect it's the same underlying reason most video players can't do reverse frame-by-frame. But Quicktime allowed it twenty years ago, so it's possible. I suppose you'd have to actually decode the entire keyframe interval and use the resulting frames as new "baked-in" keyframes so to say. I suppose that's more or less what djv and other frame checkers do under the hood. But I don't know what I'm talking about so...

[-] gila@lemm.ee 2 points 3 months ago* (last edited 3 months ago)

That's what I've always assumed it does since back when quicktime player barely even ran on my PC yet for timeline operations it was significantly more responsive than WMP/MPC.

For Losslesscut I just get around this by encoding my input from source using keyint=n:scenecut=0 in ffmpeg where n is a manually set keyframe interval.

So e.g. if my expected cut occurs on a frame that occurs at t+10 seconds of footage, n can be the same as the fps and then there'll always be a keyframe exactly at timestamp 00:00:01, 00:00:02 and so on. I can then open it in losslesscut and easily snap to the frame I want and make the cut losslessly.

Yeah the first encode generally means a lossy transcode by the time I get to my final video but being realistic that'd be a part of my workflow either way and this way it's less

this post was submitted on 14 Mar 2024
205 points (97.2% liked)

Open Source

29014 readers
157 users here now

All about open source! Feel free to ask questions, and share news, and interesting stuff!

Useful Links

Rules

Related Communities

Community icon from opensource.org, but we are not affiliated with them.

founded 4 years ago
MODERATORS