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

-c mkvmerge on Windows will break due to long command/paths #405

Closed n00mkrad closed 2 years ago

n00mkrad commented 3 years ago

From what I've gathered, mkvmerge will not work properly if there's more than 739 chunks as the command length exceeds 8192 chars.

This means on Windows there needs to be a workaround for this, especially when using --enable-keyframe-filtering=2 with aomenc as this breaks ffmpeg muxing, so mkvmerge is the only way to mux those.

silverbacknet commented 3 years ago

Oh, if that's the problem then the workaround (without going into the API) would be to just do them in sets of 100 chunks (or whatever) at a time, then append those superchunks in turn.

n00mkrad commented 3 years ago

Oh, if that's the problem then the workaround (without going into the API) would be to just do them in sets of 100 chunks (or whatever) at a time, then append those superchunks in turn.

This is exactly what I would've done and might implement in nmkoder unless av1an implements it directly, yes.

n00mkrad commented 2 years ago

Av1an just tried to run an mkvmerge command that was 139,904 chars long, and it failed without error.

Is it possible to use relative paths here? This would drastically cut down the length of the command.

Instead of mkvmerge -o $outpath/path/to/dir/000.ivf + /path/to/dir/001.ivf + /path/to/dir/002.ivf + ... use cd /path/to/dir && mkverge -o $outpath 000.ivf + 001.ivf + 002.ivf, you get the point.

n00mkrad commented 2 years ago

Reproduced once again, the console output:

Error: Failed to execute mkvmerge command for concatenation

Caused by:
    The filename or extension is too long. (os error 206)
redzic commented 2 years ago

Should be fixed as of #521