ios - libffmpeg writes bad mp4 file if the RTSP stream loses packets -


i'm working libffmpeg in ios, using open rtsp stream , save data file.

i've been able save video files in both .mp4 , .mov formats, there problem.

if rtsp stream perfect -- is, if there no dropped packets -- resulting file fine. can play in player, , can transcode using avassetexportsession.

the problem is, i'm dealing wireless camera sends data on udp only, there dropped packets. when dropped packet occurs, resulting file has big glitch in it: if it's 1 or 2 packets, playback freezes 12 seconds. also, cannot use avassetexportsession these files. fails, reporting decoding problem.

i feel there must way can cause ffmpeg write valid mp4 file when packets missing. don't care happens, whether missing packets deleted file or if replaced something, don't want 12 second freeze.

for it's worth, if take file off of ios device , play on computer, plays fine. there's small glitch frame dropped, doesn't freeze 12 seconds or anything.

thanks.


Comments