Yes avassetwriter is the only way to get to the hardware decoder. and just reading the file while writing it does not give you moov atoms, so players based on attack or mpmediaplayer will not be able to read it. you only have a couple of options, periodically stop asassetwriter and write the file to the background stream, effectively segmenting your movie into smaller, more complete files. or you can deal with incomplete mp4 on the server side, you will have to decode the raw nalu and recreate the missing moov atoms. If you use ffmpeg mov.c, you can take a look. It was also an incomplete mp4 file that would fail.
Michelle cannon
source share