You could get around the reduction in MPEG encoding quality at least by having a server thread working out the GOP ranges and encoding them in separate encoder threads. After that the resultant encoded GOPs just need to be assembled in the correct order.