cap export reports a path it didn't write when -o doesn't end in .mp4
Description
For an MP4 export (the default), cap export writes <name>.mp4 whatever extension -o has, but reports the path as given:
| command | reports | writes |
|---|---|---|
cap export rec.cap -o out.gif --json |
{"type":"Completed","path":"out.gif"} |
out.mp4 |
cap export rec.cap -o out.webm --json |
{"type":"Completed","path":"out.webm"} |
out.mp4 |
cap export rec.cap -o out --json |
{"type":"Completed","path":"out"} |
out.mp4 |
Without --json it prints Exported video to out.gif. The reported file doesn't exist, so a script or agent that opens or uploads it fails. GIF and MOV exports already report the file they write: --format gif -o out.mp4 reports and writes out.gif.
The cause: MP4File::init (crates/enc-ffmpeg/src/mux/mp4.rs:56) sets the .mp4 extension on the path it writes, but Mp4ExportSettings::export returns the path it was given. GifExportSettings::export sets .gif itself and returns that path.
Checked with a release build of main at de2cae74d on a 3-second recording.
I've opened a PR that fixes this; it's linked below.