@blimey
i didn't noticed your corrected debug log you posted in your previous post. you should have mentioned it in new post. anyway i have analyzed your new log and it's obvious why total time of joined file is increased. it's due to wrong interleaving of audio video packets at the point of separation.
End of first flv:
Code:
VIDEO 11976 11936 5228 1966536
AUDIO 11981 11958 360 1971779
VIDEO 12016 11976 3091 1972154
VIDEO 12056 12016 5407 1975260
VIDEO 12096 12056 3229 1980682
VIDEO 12136 12096 6156 1983926
VIDEO 12176 12136 3393 1990097
VIDEO 12216 12176 6204 1993505
VIDEO 12256 12216 3546 1999724
VIDEO 12296 12256 4681 2003285
VIDEO 12336 12296 6716 2007981
VIDEO 12376 12336 3715 2014712
Start of second flv:
Code:
AUDIO 12004 -1 4 13
AUDIO 12004 12004 389 32
AUDIO 12027 12004 395 436
AUDIO 12051 12027 346 846
AUDIO 12074 12051 395 1207
AUDIO 12097 12074 376 1617
AUDIO 12120 12097 396 2008
AUDIO 12144 12120 383 2419
AUDIO 12167 12144 376 2817
AUDIO 12190 12167 372 3208
AUDIO 12213 12190 356 3595
AUDIO 12236 12213 388 3966
AUDIO 12260 12236 374 4369
AUDIO 12283 12260 389 4758
AUDIO 12306 12283 354 5162
AUDIO 12329 12306 380 5531
AUDIO 12353 12329 353 5926
AUDIO 12376 12353 357 6294
AUDIO 12399 12376 383 6666
VIDEO 12416 -1 44 7064
VIDEO 12416 12416 64234 7123
AUDIO 12422 12399 383 71372
due to non monotonically increasing timestamps ffmpeg's concat filter rebases second file's timestamp starting from 12376. this results in increased total length of file.
Solution:
i have modified my BeatConvert script to generate single flv file instead of one file per fragment so we don't have to use concat filter at all avoiding this whole mess. use the updated script with following batch file and report. it should create flv file with proper sync and length.
BeatConvert.bat:
Code:
if exist "Final.flv" del "Final.flv"
for %%a in (*.beat) do php BeatConvert.php %%a
php FlvFixer.php --in Final.flv --out Final_fixed.flv --nometa
FFMpeg.exe -y -i Final_fixed.flv -c copy Final.mkv