Are there any known methods on how to guarantee rtmpdump's output to be fully corruption free? My understanding of the problem is that corruptions
sometimes happen when rtmpdump drops the connection and resumes (could someone clarify on this part?).
My current script uses the following algorithm to run rtmpdump:
Code:
while True:
rtmpdump //start a fresh rtmpdump download
rtmpdump --resume //resume if necessary
rtmpdump --resume //resume if necessary
output = rtmpdump --resume //do a final check with resume
if output contains "Already Completed":
break
So if a video cannot be completed in 4 resumes, it starts a fresh download. From personal experience, this prevents quite a bit of corruption; however, it's not perfect.
I was doing some research and I found K-S-V's FlvFixer.php script. I'm not sure exactly sure how it works, but I was wondering what if I used it to augment my current code to make it like this:
Code:
while True:
rtmpdump //start a fresh rtmpdump download
call FlvFixer.php on partially/fully completed file
rtmpdump --resume //resume if necessary
call FlvFixer.php on partially/fully completed file
rtmpdump --resume //resume if necessary
call FlvFixer.php on partially/fully completed file
output = rtmpdump --resume //do a final check with resume
if output contains "Already Completed":
break
Would this be able to prevent all corruptions? What do you think?
Thanks.