K-S-V / Scripts

Collection of my scripts
GNU General Public License v3.0
634 stars 226 forks source link

FlvFixer.php script doesn't handle files larger than 2GB #92

Open monsterru opened 8 years ago

monsterru commented 8 years ago

filesize function only works for files <2GB without a workaround as per

http://stackoverflow.com/questions/9346104/php-filesize-on-files-2-gb

http://us.php.net/manual/en/function.filesize.php#102135 gives a complete and correct means for finding the size of a file larger than 2GB in PHP, without relying on OS-specific interfaces.

The gist of it is that you first use filesize to get the "low" bits, then open+seek the file to determine how many multiples of 2GB it contains (the "high" bits).

For those that want a quick fix I have created a copy of script with custom file size function that works ok for large files. Please see attached.

Thanks for your great work!

FlvFixerLarge.zip

Dimitri