VidCoder icon indicating copy to clipboard operation
VidCoder copied to clipboard

Target size ignores audio streams

Open KawaiianPizza opened this issue 4 years ago • 5 comments

Encoding a video with a target size of 8mB results in slightly larger than the target file size if it has an audio stream. Original size: 9,115KB With sound: 8,410KB (over 8mB) Without sound: 8,162KB (perfectly under 8mB)

KawaiianPizza avatar Apr 08 '21 12:04 KawaiianPizza

It does have logic to take audio into account, but it doesn't work in all situations. What codec and audio encoding settings are you using?

RandomEngy avatar Apr 09 '21 00:04 RandomEngy

It does have logic to take audio into account, but it doesn't work in all situations. What codec and audio encoding settings are you using?

MP4 H.264 Preset: Very Slow Web optimized Align A/V start Target Size: 8MB 2-pass encoding Constant framerate: Same as source

Audio codec: AAC Sample rate: Same as source Passthrough if possible

Edit: Looks like it's because of audio passthrough, would it be possible to account for that?

KawaiianPizza avatar Apr 09 '21 03:04 KawaiianPizza

Maybe. It does try to calculate the audio size when using audio passthrough, but it could be that the bitrate information isn't available or it's using quality-based encoding. Check the encode log and you should see some messages that start with "Calculating bitrate". Can you paste that portion over here?

RandomEngy avatar Apr 09 '21 04:04 RandomEngy

Ahh, I see. I have some code that runs to determine passthrough and audio encoder auto-fallback, but that's not running where we calculate audio size. I'll work on a fix.

RandomEngy avatar Apr 09 '21 14:04 RandomEngy