master-of-zen / Av1an

Cross-platform command-line AV1 / VP9 / HEVC / H264 encoding framework with per scene quality encoding
GNU General Public License v3.0
1.51k stars 155 forks source link

[feature request] Output file size limit, split output. #340

Closed lastrosade closed 3 years ago

lastrosade commented 3 years ago

Say an encode would leave us with a 72MB file and we set a file size limit of 50MB and with -o outputfile.webm

Av1an should then produce two files outputfile_1.webm and outputfile_2.webm of about 36MB each.

Av1an should try to produce output files of roughly the same size, ie: avoid create one file of 50MB and one of 22MB.

This could have issues if we decide to copy the audio stream instead of re-encoding. Av1an may also not be able to produce chunks of sizes inferior to the specified file size limit if one was to use unreasonable settings.

redzic commented 3 years ago

What would the use case for this feature be?

lastrosade commented 3 years ago

Some services like discord have size limits, many of my vp9 encodes end up at sizes over 100MB. It would be perfect if I could get two or three separate videos without having to cut the videos with ffmpeg as this often produces broken audio/video.

lastrosade commented 3 years ago

Will use https://github.com/master-of-zen/rsplit