How to use Handbrake to cut videos without re-encode

HandBrake for Windows support
Forum rules
An Activity Log is required for support requests. Please read How-to get an activity log? for details on how and why this should be provided.
Post Reply
usoquesto
Posts: 2
Joined: Wed Mar 07, 2018 4:36 pm

How to use Handbrake to cut videos without re-encode

Post by usoquesto »

Description of problem or question
Dear Everyone, there is not really a problem in my request. It is just a HOW-TO question. I Promise i checked in the forum already and on the community, and on google....but i could find nothing that can help me.
I have an MKV file and i only need to cut out a part of it. I need a SECOND precise program that can cut the part I need without re-encoding, but i don't know how to do with HandBrake.
Of course, i tried already the following programs to do that:
-MKVmerge
-MKVToolNix
-Avidemux
-MPEG_Streamclip
-LosslessCut

However, they are all unprecise and they cut always 2 seconds before or after the time i give (i did so many tries with each that it is ridiculous). The only program that really cuts the seconds i need is HandBrake, but as i said it re-encodes all the time.

Question: Can Handbrake cut without re-encoding at all? If not, does anybody know a free program that can do what i need?

Best regards and thank you all

Luca

Steps to reproduce the problem (If Applicable)
N/A

HandBrake version (e.g., 1.0.0)
1.0.7

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

Error message text or screenshot (If Applicable)
No error

Provide a URL from any image hosting site.

HandBrake Activity Log ***required*** (see How-to get an activity log)
There is no error, so no activity log necessary

Use any pastebin website and provide the URL it generates
- or -

Code: Select all

Paste log text between these markers.
[code][/i]
User avatar
JohnAStebbins
HandBrake Team
Posts: 5726
Joined: Sat Feb 09, 2008 7:21 pm

Re: How to use Handbrake to cut videos without re-encode

Post by JohnAStebbins »

You can't do this with HandBrake. HandBrake *always* re-encodes.

If you had provided an activity log showing a scan of your source video I could be more definitive. But it's likely you won't be able to do what you want even with a tool that is specifically designed to do this. Video is often encoded in such a way that long sequences are indivisible. A sequence begins with a key frame and every other frame in the sequence depends on the key frame. You can't decode an arbitrary frame in the sequence without all the frames before it up to the key frame.
usoquesto
Posts: 2
Joined: Wed Mar 07, 2018 4:36 pm

Re: How to use Handbrake to cut videos without re-encode

Post by usoquesto »

YES! you are exactly right! I found out that too and i was hoping that was existing something like that. Yes it is exactly the previous key frame that takes. Unfortunately. I am sorry for the short answer: what "RF" should be used for MKV files to keep the original quality and file size as similar as possible to the original? do you need an activity log in this case?

thx for your precious answer!!
User avatar
JohnAStebbins
HandBrake Team
Posts: 5726
Joined: Sat Feb 09, 2008 7:21 pm

Re: How to use Handbrake to cut videos without re-encode

Post by JohnAStebbins »

You can't keep the original quality when re-encoding. There will always be some loss of quality. You can get very close to the original quality, but depending on the source the file may be smaller or *larger*. If the source is using a codec that is less efficient that the encoder you re-encode with and the original source quality is good, you will most likely end up with a smaller file with good quality. If the source is using a codec that is already efficient or the source quality is poor, it may be hard to re-encode to the same size with acceptable quality.

But try starting with the x264 encoder and RF 20. If the file size is too big, try a higher RF value. If the quality isn't acceptable, try a lower RF value.
Post Reply