Is avassetwriter possible to memory

I would like to write an iphone application that continuously captures videos, h.264 encodes them after 10 seconds and uploads them to the storage server. This can be done using avassetwriter, and I can continue to delete old files while creating new ones. However, since flash memory has a limited recording cycle, this circuit will destroy the flash after several thousand recording cycles through the flash. Is there a way to redirect avassetwriter to memory or create a ram drive on iphone?

Thanks!

+7
source share
2 answers

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.

+1
source

Why write data to a file at all? Could you just copy the capture data into memory and then bring it to the server from memory?

-one
source

All Articles