AME Failing To Mux h265 Properly without Error when Low On Disk Space
Afternoon.
I've been encountering encoding errors on AME when trying to encode in any of the HEVC (H.265) presets.
If the output file size is going to be nearly (but not quite) half of the disk space remaining on my hard drive then the encode appears to complete but with a warning. 
The log is as follows:
06/21/2022 11:56:33 AM : Queue Started
- Source File: /var/folders/gx/pqtcctg16jdc7z217nlg4bx00000gn/T/Stane Street_5.prproj
- Output File: /Users/simon/Movies/Walking/Stane Street/Outputs/IMG_8675.mp4
- Preset Used: 4K UHD
- Video: 3840x2160 (1.0), 60 fps, 100 (63% HLG, 51% PQ), Hardware Encoding, 00:01:51:54
- Audio: AAC, 320 kbps, 48 kHz, Stereo
- Bitrate: VBR, 1 pass, Target 35.00 Mbps
- Encoding Time: 00:06:07
06/21/2022 12:02:40 PM : File Encoded with warning
------------------------------------------------------------
Adobe Media Encoder
Could not write XMP data in output file.
------------------------------------------------------------
06/21/2022 12:02:51 PM : Queue Stopped
There is no failure or indication that the encode failed inside AME but the output file is only a fraction of the expected file size. (This was a very short test clip in this example but I've also had this happen with hour long videos)
When the output file is played in VLC it shows the full expected time on the progress bar but will only play up to a certain point and then freezes. Attempting to seek beyond this point causes VLC to re-start the file from the beginning because the actual video data is missing.
The annoying thing is that if I catch it when encoding has finished and muxing has just started I can copy the two encoded parts to an external drive and then mux them manually without issue but because AME thinks it has succeeded it then deletes the encoded parts and I have to start all over from scratch with another full encode and on hour long 4K videos this can take ages.
I think AME needs some error checks in place so that this gets reported as an error in the UI or even better would be to keep the encoded parts, give me a chance to clear some space and then re-attempt the mux from the correctly encoded parts to avoid having to do a complete re-encode.
Thanks
Simon
cc: @Fergus H
