AVAssetExportSession fails part way thru for long videos

as in the above note, shorter videos, say, less than 1 hour playing time seem to export ok. this is just a time clip operation we are doing not a composition.

but when we put videos longer than an hour and try to clip them to an hour, the export fails part way thru

we can see the .progress property proceeding

then we get the mysterious unknown error code:


An unknown error occurred (-12551)

as noted below in our console output

apple any hints besides unknown? surely your code knows why it failed. why not tell us?!

the "code = " listed below is the .status which shows as 4

waiting for trimmed movie file save 1 progress = 0.692948

2021-03-08 14:55:52.702278-0500 KargoCamera[1598:154227] Export failed: The operation could not be completed code = 4

2021-03-08 14:55:52.702412-0500 KargoCamera[1598:154227] Export recovidea: (null)

2021-03-08 14:55:52.702507-0500 KargoCamera[1598:154227] Export reason: An unknown error occurred (-12551)
Looks like there may be a problem with the source movie. If you file a bug report we can take a look. Please also report the less-than-helpful error code and we can investigate providing a more descriptive error.
hi, thanks for the response. the problem seems to be at some low level. example case is: get a movie longer than 1 hour into your camera roll. try to clip it to 1 hour with the built-in video tools in the iOS photo app. it clips it to something like 43 minutes instead of 1 hour. we have temporarily worked around the problem by only allowing 40 minute videos max in our app. it is interesting that you say there might be a problem w/ the video, i will try other videos when we get back to this issue.
AVAssetExportSession fails part way thru for long videos
 
 
Q