Lossless Export, same as source

I just noticed the new project window says that source video settings are used for output! But I can’t add .mkv files to Shotcut. Do I need a plugin or something?

matroska files play just fine for me in Shotcut. What happens when you try to bring in an mkv file?

I didn’t take note of the settings I’m afraid, so I can’t go in depth with that. I abandoned that film and moved onto another due to it’s video jumping about which I hadn’t known about previously.

I’m just starting a new project with Heroes Two. When I export that I’ll upload the settings.

It just says “Failed to open: E:/pathtofile”

You’ve tried this with more than one mkv file?

Yes, but it’s only giving this message when trying to import files from the working folder of VSDC even though I’ve closed both VSDC and Shotcut, then restarted Shotcut.

I don’t understand. What’s wrong with letting LosslessCut be 100 frames early, then trim out those 100 frames when the clip is added to the Shotcut timeline? The final video is going to be re-encoded anyway, so it doesn’t hurt to trim in Shotcut.

Here’s the math that some other programs use to determine what export settings will generate a same-size file:

Let’s say the source video is one hour long and 1.0 GB in size for round numbers.

Convert hour to seconds: 1 h * 60 min * 60 sec = 3,600 sec

Convert GB to bits: 1.0 GB * 1,000 MB * 1,000 KB * 1,000 bytes * 8 bits = 8,000,000,000 bits

Divide bits by seconds to get total file data rate: 8,000,000,000 bits / 3,600 sec = 2,222,222 bits/sec

This is the total data rate of video and audio together.

Now let’s assume the audio was stored as stereo 448kbps per channel AC-3. The total data rate for audio becomes 448 kbps * 1,000 bits * 2 channels = 896,000 bits/sec. Subtract this from the total file data rate of 2,222,222 bps to get a remainder of 1,326,222 bps dedicated to video.

Source file statistics so far:

Video: 1.3 Mbps
Audio: 448 kbps per channel

These numbers can sometimes be found directly in a file properties page, like in Windows Explorer right-click Properties.

With these numbers, we can now set our values on the advanced Export page to have Shotcut create a file with the same size as the original. There are two ways to do this:

  1. On the Codec tab, use Average Bitrate rate control and set the video bitrate to the number above.
  2. On the Codec tab, use Constrained VBR with the video bitrate set to the number above, the buffer size set to whatever creates one second of buffer, and quality at 68%.

For both, use GOP at 240 and B-frames at 8 to help get the smallest resulting file size.

And naturally, set the Audio tab to whatever audio settings were used by the source.

Now, the exported file will be very close in size to the original. If the source file was a stream capture or a DVD/Blu-ray rip, then the quality will be similar (assuming the same codec is used), since those sources tend to be constant bitrate encodings just like our encoding.

Quality and size are opposing goals. More quality requires more size. Less size requires less quality.

Recent films are streamed or encoded to Blu-ray using pretty high constant bitrates. High quality streams are 6 GB per hour and Blu-ray maxes at around 17 GB per hour. I don’t think most people would classify these files as small.

Particularly with streaming, there are lower-quality settings available, usually around 1 GB per hour, but playback on a large TV reveals noticeable quality differences.

Regardless, the key difference is those mediums use Constant bitrate instead of Variable bitrate (the Shotcut default). If a Constant bitrate video is analyzed closely, the quality takes a very noticeable drop in scenes that have lots of movement where the data rate can’t keep up with all the changes in the image. Smearing, blockiness, banding, etc are readily visible if doing a freeze frame, but not so visible if frames flash by at real-time. These compression algorithms are aware of what the human eye can detect and they know the eye can’t study detail when objects are moving fast on the screen. Codecs save bitrate by allowing more artefacts to appear in areas the eye can’t study in time.

However, Variable bitrate mode (the Shotcut default) is not constrained to a bitrate like a physical Blu-ray disk that’s spinning and has an implied maximum bitrate due to the motor’s top speed. Variable bitrate is allowed to take all the disk space it needs to encode at a given quality target.

Summary: If the goal is to keep generational loss to a minimum, then VBR at a visually lossless setting like 64-68% is the way to go. If the goal is to be “good enough” and retain the same file size, then Average Bitrate is probably a better way to go.

The beauty of Shotcut and these codecs is that they can be customized exactly to a project’s needs. It’s an enormous amount of control given to the user that isn’t offered by a lot of other programs.

I’m guessing that you’re referring to the Export tab that determines what area of Shotcut is being exported. It’s possible to export directly from the Source window to do a direct transcode of a video without creating a timeline for it. This does not borrow export settings from the source file. Export settings are still set the same as with a timeline project.

Thanks Austin for the detailed reply…

Lossless cut - Why would you use this then import into Shotcut when the aim is Lossless? Why use one app to do imperfectly what can be done in another when you’re importing it into that lossless second app anyway! That makes no sense whatsoever! :crazy_face:
I asked if there was an app to perform lossless cutting of video without needing to import it into Shotcut.
The main purpose was as a file joiner rather than a cutter. For some reason, several films are cut into CD1 and CD2. So I needed a way to join them. Most cutting software provides a way to join also, hence my request :wink:

Math - I understand exactly what you are saying wrt filesize=quality, but there are thousands of examples of films that look similar to DVD quality whilst retaining small file sizes of around 1 or 2GB. But you’re saying this isn’t possible? So how do these people manage to achieve this? That, I don’t understand.
Lord of the Rings for example. I can’t tell the difference between my DVD version and the version I downloaded! There’s no blockiness, visual noise, or any other artifacts or issues with it, just a tiny amount of blurriness yet this 3hr 48m 11s film is only 1.4GB. If it can be done once with this film, it can be done again with any film, surely?

Source Settings - Nope, when I open Shotcut, there’s a Project panel that shows folder, name and video mode, which is Auto. Because it’s set to auto it says it’ll use the input settings. Sorry, I don’t know the app well enough to describe any better.

This topic was automatically closed after 90 days. New replies are no longer allowed.