Trimming a video (file) without changing it

General questions or discussion about HandBrake, Video and/or audio transcoding, trends etc.
Post Reply
k9393
Posts: 9
Joined: Tue Mar 07, 2023 1:35 am

Trimming a video (file) without changing it

Post by k9393 »

Description of problem or question:

I would like to use handbrake to extract a portion of a video (using Range:) without changing it - essentially a pass-thru for everything.

Is there a way to disable encoding - passing through video, audio and subtitles, etc as is?

If I need to select a preset what should I use (the original film is 1080p30 encoded in H.265, MKV Format)? And what additional selections should I make:
- turn off all filters
- Video Encoder: "H.265 (x265)"
- Encoder Preset: "Placebo"
- Quality: "Constant Quality: 0"
- Subtitles - Tracks: "Add All Remaining Tracks"

Thanks

Steps to reproduce the problem (If Applicable):

HandBrake version (e.g., 1.0.0):

1.6.1

Operating system and version (e.g., Ubuntu 16.04 LTS, macOS 10.13 High Sierra, Windows 10 Creators Update):

Windows 10, version 21H2

HandBrake Activity Log ***required*** (see How-to get an activity log)

Code: Select all

No log as I did not run handbrake.
Lostless
Bright Spark User
Posts: 155
Joined: Thu May 24, 2007 7:55 pm

Re: Trimming a video (file) without changing it

Post by Lostless »

Shutter encoder can do this. Handbrake always has to reencode.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Trimming a video (file) without changing it

Post by mduell »

No, and what you propose certainly isn't going to deliver output you're happy with.

Use LosslessCut.
k9393
Posts: 9
Joined: Tue Mar 07, 2023 1:35 am

Re: Trimming a video (file) without changing it

Post by k9393 »

I tried LosslessCut and it, like probably all others (including ffmpeg), cuts on keyframe boundaries NOT on frame boundaries. LosslessCut has an experimental "Smart Cut" that cuts on precise time (0.001 second resolution) boundaries, but according the LosslessCut it "Only works on some files." It did not work in my case. I think what LosslessCut "Smart Cut" does is to re-encode the short time between the actual time boundary and the nearest adjacent keyframe boundary. But again, it is experimental and only works in some cases.

Does anyone know of a application that can do a lossless cut on precise time boundaries without re-encoding.

If there are none, and the only way cut on precise time boundaries is to re-encode, then what settings in handbrake should one use to get as close to lossless as possible? Also, is there another application that can do this?
Woodstock
Veteran User
Posts: 4614
Joined: Tue Aug 27, 2013 6:39 am

Re: Trimming a video (file) without changing it

Post by Woodstock »

If you are looking at trimming OTHER THAN on key frames, you're going to need something that recodes at least PART of the video, because you need to start with a key frame. Handbrake can do that, but it's going to recode the whole thing.
mduell
Veteran User
Posts: 8187
Joined: Sat Apr 21, 2007 8:54 pm

Re: Trimming a video (file) without changing it

Post by mduell »

Any reasonable HQ settings should get you as close to lossless as possible.
Post Reply