lisamelton / other_video_transcoding

Other tools to transcode videos.
MIT License
543 stars 24 forks source link

ER: Add frame rate qualifiers to bitrate targets, or scale bitrate based on frame rate. #138

Open cplr opened 2 years ago

cplr commented 2 years ago

Because the target bitrate is based on time, that means the per-frame quality is directly proportional to the source frame rate. So if you were to batch process a large folder of movies, some being 30fps and some 60fps, the 30fps files will have double the quality of the 60fps files.

I'm not sure if this is a bug, or a feature request, but it would be nice to be able to pass in a bitrate that is automatically scaled to the input frame rate. So maybe keep the same interface as it is, but add a feature where the bitrate is applicable to 30fps material, but scaled up or down based on the frame rate. So a target bitrate of 5000kbps will scale up to 10000 for 60fps material.

The other way would be to add frame rate qualifiers to the targets, so you could, for example, do this: other-transcode --target 1080p30=5000 --target 1080p60=10000 C:\Rips\*.mkv

lisamelton commented 2 years ago

@cplr Thanks for the suggestion and syntax proposal!

How often are you transcoding high-frame rate content? Because it might be better to just reduce frame rates rather than increase bitrates.

cplr commented 2 years ago

For rips - almost never :). But I found a treasure trove of family videos from a now-unused camcorder where I recoded everything at 60fps. The file sizes that were output by the camera are a little too big for my taste, so I'm looking to slim it down. So in my case, this is a one-time batch process. Because I think they are all at 60fps, it is easy for me to just set the bitrate once, but I realized that if I wasn't sure, I would want a feature like this.

lisamelton commented 2 years ago

@cplr Ah. This is essentially the same case that other users have encountered, i.e. they want to process some camcorder/phone video instead of their Blu-ray or DVD rips. And because it's almost always isolated a generalized feature is not really necessary.

BTW, I would not recommend doubling your bitrate to accommodate a doubled frame rate. A modest 20% increase in the target should be sufficient to maintain quality.

Also, you don't even need to worry about this at all if you're using the Nvidia encoder because --nvenc-cq is available to you. That's a quality-based rather than bitrate-based ratecontrol system. So you could use the same quality (I recommend something between 28 and 25 inclusive) to scale the output bitrate based on complexity.