Hello,
I read the export article here: Advanced Export
and I have read quite a lot of h264 “optimal settings”
How can I choose the best quality settings according to the original video, I am assuming that if the original video size is for example 300mb for 5minutes, I could re-encode and export the video (for applying filters) in h264 with the same parameter that the original video has. And the re-encoded video would be approximately the same size 300mb for 5minutes.
My point is how can I determine approximately what was the settings used to compress the original video so I could use the same quality % and the same CRF ?
Is it possible ? is there a tool or metadata I could use ?
It’s hard to get the original settings (sometimes they get embedded in the metadata but you’ll have like 50 parameters to look into) but you can get roughly the same quality by using average bitrate mode to get a file the same size as previously was using the same codec.
So the math is like this: divide the filesize by the legth in seconds then multiply by 8 to get the bitrate (or use MediaInfo or the View bitrate option in shotcut’s properties menu):
300 MB / (5 minutes * 60s) = 300 MB / 300s = 1 MB/s
but don’t forget to multiply by 8, bitrate is in lowercase b (which is 8 times the regular uppercase B that we get filesizes in) so:
1 MB * 8 = 8 mb/s
your video has been originally encoded to target 8 megabits per second (this is a very common value for smartphone 1080p video)
Now, you can now go into the export advanced settings, don’t change anything else but 2 values:
click on the codec tab and change Rate control to Average bitrate
and on the new box that appears called Bitrate, choose (or type) 8M
As a personal preference, if you really want to match the original quality I recommend you increase this number by 20-30% to account for any random details. So instead of 8M, I’d go for 10M in your example.
This gets compliated if you want to go further, but if you use a different codec (so x265 instead of the x264, or even av1) you could actually go for a lower bitrate and the quality will (probably) be the same. But this varies for every single video so do some tests and check the result.