View Single Post
  #49  
Old 04-30-2014, 09:56 AM
ZeChico ZeChico is offline
Member
 
Join Date: Apr 2014
Posts: 31
ZeChico is on a distinguished road
Default

Re: FLV fixer script


Hi!

I'm sorry to necro this thread, but I have been using this script for a long time to repair my MFC recordings. I always notice that the videos, specially the long ones had a slow motion after a while and the audio was not synchronized.

Only now that I paid attention to it. It seems the problem was in the "FLV fixer.php" itself, the default value of FRAMEFIX_STEP of 40 was too high.

After many tests I found that the value of 22 is ideal so I changed the line on the script to:
define('FRAMEFIX_STEP', 22);

With this the sound seems fine and so is the motion.

To further repair the files I also created a small bat script (ex: FLVfixer.bat) to repair any FLV in the same folder, it calls the "FLV fixer.php" and uses the "yamdi.exe" (search the net for it) to recreate the metadata, so it needs this 2 files in the same folder. It first repairs the flv into a temporary file and then the yamdi uses the temporary file to rewrite the original one.

This is the DOS BAT script if anyone wants this easier way of repairing many MFC FLV files in the same folder:
Code:
@ECHO OFF
FOR %%A IN (*.flv) DO (
IF NOT "%%A"=="temp.flv" CALL :FIX "%%A"
)
GOTO END

:FIX
ECHO -------------------------------------------------------
ECHO - Fixing %1...
php "FLV fixer.php" --nometa --fixwindow 1000 --in %1 --out "temp.flv"
ECHO Injecting MetaData with yamdi...
yamdi.exe -i "temp.flv" -k -o %1
ECHO Done!
ECHO:
GOTO :eof

:END
ECHO -------------------------------------------------------
ECHO Deleting temporary file...
DEL /Q "temp.flv"
ECHO:
ECHO All done!
ECHO ON
@PAUSE
If instead of rewrite the file you instead want it to save into other folder (ex: into folder "OK") you need to edit the following line:
yamdi.exe -i "temp.flv" -k -o .\OK\\%1

To repair old flv repaired by "FLV fixer.php" that got this slow motion problem, you need to edit the "FLV fixer.php" and after editing the line:
define('FRAMEFIX_STEP', 22);

You also need to change the line:
if ($timeShift > $fixWindow)
to
if ($timeShift == 40)

Thank you KSV for this script.

Regards!
Reply With Quote