Your problem then is staying in sync while going through concat process. Rule of thumb, the less steps the better. This should solve your problem. First, use mpg instead of flv for intermediate format. Second, add -copyts to each command (copies timestamps to retain sync). Also, there's no need to go to the lowest framerate. You can retain the quality of the highest video through this process. Try this:
$ ffmpeg -i a.mp4 -qscale:v 1 -copyts a.mpg
$ ffmpeg -i b.flv -qscale:v 1 -copyts b.mpg
Now you should have two (large) intermediate files of compatible video quality (variable: -qscale:v 1
). You're ready to glue them together.
$ ffmpeg -i concat:"a.mpg|b.mpg" -c copy all.mpg
If you're on Windows, you'll be fine as is. On UNIX flavors, you'll need a backslash before the pipe. (On my version I get a flood of buffer underflow / packet too large, ignoring buffer limits to mux it
errors. They seem to be harmless.) Now you can convert to whatever more useful format you want with more realistic quality.
$ ffmpeg -i all.mpg -qscale:v 2 -copyts all.mp4
I've had success keeping the concatenated videos in sync but the quality does not seem as good as it should be. Maybe tweak the intermediate file parameters.