middlewayToF4m