VidCutter: A program for lossless video cutting
github.com
github.com
That said, since I've been using an AI assisted terminal (warp.dev currently) my use of GUI wrappers for different tools has faded quite a bit. I like being able to "Clip 0:10 through 0:30 of file.mp4 and turn it into a web optimized gif", and this NLP workflow works as a "wrapper" for almost any CLI. It's a nice interface without the loss of any functionality.
vidcutter ultimately didn't help in this process. I built it from source and then tried the flatpak, but for all of its beauty, it hung or crashed when importing common but dated formats and containers, handling more than a few clips, and didn't allow precise jogging for splitting (when it didn't hang or crash). It's good for trimming up a smartphone video, but it's not on par with an NLE.
I ended up giving up and scripting out most of the project in ffmpeg and dvdauthor. If you know how to use core utilities, it's such an exercise in tedium struggling against underdeveloped front ends.
You could open the .VOB files directly, but that’s more cumbersome.
Why you'd want DVD menus in the first place, though...
I can't mount the file and also can't find any software that can make sense out of the raw CD sectors. Very strange.
I'd take Electron over that tbh.
I will take that over some stupid app cramming an entire instance of Chromium down my throat any day.
Perhaps I'm missing something, but I only care about the functionality and not whether the button should have round edges or the background having the right shade of grey. The consistent "feel" is nice to have (cough winform/wpf/uwp cough), but I would take "web-ish" applications over no application/crappy native application anytime (especially with Linux)
Web shit is fucking ugly, it eschews platform native conventions, and it just feels cheap.
But when I load up a winforms-esque app with toolbars and a statusbar and all the nice accoutrements we're accustomed too behaving in the way we are accustomed to... now I feel like I'm going to get shit done.
Literally the only electron app that feels serious is VSCode and the amount of optimizing MS has had to do has cut into seven figures
n.b. just because CPython exists doesn't mean Python is native.
n.b. native vs. web is colloquially a discussion from 00s macOS and 10s mobile about fidelity to the platform's standard UI toolkit.
n.b. when people shit on Electron its because of RAM use and lack of fidelity to the platform toolkit, and the waste of have a full JS engine compiled into an app, ideally they'd all use some base WebView from the system instead of Chromium
> ideally they'd all use some base WebView from the system instead of Chromium
Ideally they don't use any of that web trash and use something that favors the native platform conventions
And winforms labels have a selectable mode.
Here's a comparison of both apps with the same video file open and the same clip cut:
Startup time (time between double click and window appears and ready):
- Losslesscut: 2 seconds
- VidCutter: 12 seconds
Time to load the video file:
- Losslesscut: 1 second (to be fair it doesn't show thumbnails)
- VidCutter: 3 seconds
Memory usage:
- Losslesscut: 368MB
- VidCutter: 455MB
Idle CPU usage:
- Losslesscut: 0%
- VidCutter: 0%
Network requests:
- Losslesscut: 7
- VidCutter: 0
Installed size:
- Losslesscut: 455MB
- VidCutter: 178MB
Source, kinda (the memory shown is the sum of all subprocesses. taken when idle so no ffmpeg subprocess included.):
If the two apps were programmed identically then you might have a comparison.
????
I don't know if all the numbers are accurate but it's true that vidcutter does weird things. I think it extracts ffmpeg to the temp directory on every start for whatever reason (it's not like it's a portable executable, it requires installation so why not extract it then?).
I can't explain why it uses more memory or how they managed to make it look alien despite using QT (so much for accusing electron of not looking native).
- Losslesscut: 7
Whyyyy
That's frankly quite disturbing to see. A program like this has zero need to even touch the network.
2023-08-21 12:33:28 | losslesscut.exe | Block | Out | 140.82.112.5 | 443 | <-- Github, update check
2023-08-21 12:33:30 | losslesscut.exe | Block | Out | 54.192.51.72 | 443 | <-- https://losslesscut.mifi.no/config.json +
2023-08-21 12:33:30 | losslesscut.exe | Block | Out | 54.192.51.122 | 443 | <-- https://losslesscut.mifi.no/config.json +
2023-08-21 12:33:30 | losslesscut.exe | Block | Out | 54.192.51.66 | 443 | <-- https://losslesscut.mifi.no/config.json +
2023-08-21 12:33:30 | losslesscut.exe | Block | Out | 54.192.51.52 | 443 | <-- https://losslesscut.mifi.no/config.json +
2023-08-21 12:33:30 | losslesscut.exe | Block | Out | 172.217.13.206 | 443 | <-- Google, Unknown
In the code there is also: https://losslesscut-analytics.mifi.no/Typical.
I would love it if someone who knows more about this than I do would confirm/deny since this is something I've been curious about for a long time now. (Though I would also love a tool for near-lossless cutting that just re-encodes the cut GOP, please link such a thing if it exists)
Yes, but then you'd have to render the result into a truly uncompressed format and it would have to stay in that format perpetually. If you wanted to deliver in another lossy format, you'd actually lose quality across the entire file instead of just the one GOP.
What I'm curious about is whether you can cut in the middle of GOPs, recompress the afflicted ones, and then concatenate the stream back together without recompressing all GOPs. If the file specifies a 12-frame GOP, cutting any GOPs is going to break that cadence. So can you have, say, a few thousand 12-frame GOPs... then an 8-frame GOP... then go back to 12-frame GOPs?
Update: Did some research and you can have "adaptive" GOPs of varying lengths: https://docs.aws.amazon.com/mediaconvert/latest/ug/gop-struc...
But whatever you mean, the answer is probably VapourSynth. In fact, you can probably do whatever you are trying to do inside VapourSynth instead of ffmpeg.
Scope-creep would of course require that to expand to include dissolves, transitions, etc until you've got a whole editor/compositor engine running just to playback a single composition.
However this would be quite possible with technologies like WebCodecs+WebGPU.
Decoding two consecutive frames would obviously require two such cycles, which the hardware may or may not be spec’d for. With three, four or n skipped frames, you would require (at least) n frames prebuffering, rendering and graphics memory to guarantee smooth playback.
I think it makes sense to differentiate between mastering formats and consumption formats.
One does not, after all, ship studio masters of albums or songs people listen to.
Matroska supports a feature like this where it can link together multiple segments, letting you do something like having one file for a repeated opening sequence in a TV series.
There are a few caveats, though. Examples: (1) You're limited to cuts-only edits. (2) Because the base unit of video encoded for distribution is a GOP¹, edits either have to happen on GOP boundaries (i.e. at a keyframe) or the apps have to re-encode the GOP.
You cannot make frame-precise cuts within this sequence unless you wish to carry on the frames that won't be visible (and I don't think anyone tries to do these cuts by keeping some invisible frames), so you only get to make such edits that always include the first I-frame of the sequence.
Therefore if you want to make completely lossless edits your editing precision is lost. For frame-precise editing one usually ends up re-encoding the stream.
Of course, you could only re-encode only the GoPs that get broken while keeping the rest intact, and I guess this would be better and a lot faster than re-encoding everything. I don't know if any application tries to do this. But that is also a bit troublesome, as you'd like to use the same encoding parameters—and maybe the same encoder—as the other frames, to not have quality differences between the edits and original.
LosslessCut does have experimental support for this partial re-encode called "smart cut" [1]. Since it's using ffmpeg internally, the challenge become how to instruct ffmpeg to do this[2]?
It's far too fast to be re-encoding the whole video and is too precise to be cutting at the nearest keyframe.
It has limited codec and container support, though.
Correct! For example, if you trim the end of a video in the middle of a GOP, it includes the entire GOP as is, but only plays up to the point where you trimmed.
I'd for sure rather have tools that actually do what they claim to do. Using container metadata tricks feels to me as lazy and misleading to the user.
My experience shows that if you try, this confuses and breaks many (especially hardware) players trying to play that file.
That's exactly what VidCutter does.
The most popular tool in this category that I know of is https://mifi.no/losslesscut/.
¹ The object, vs. the QuickTime Movie file format ² https://en.wikipedia.org/wiki/Edit_decision_list
That's the way video editing in general has always worked.
1) Insert a few title slides in the video with a bit of text and image animation (like text and a logo showing up with some basic animation)
2) Add background music across various parts of the video
I used AviDemux in the past but that was a UX horror.