Now your script / ffmpeg convert the flv to a mp4 file, but the video file is corrupted.
It took a very long time. About 45 minutes.
Have you tested the script/ffmpeg on a VPS?
What's the minimum System requirement for the Video conversion?
Or do you think the error has a different cause?
Please paste the contents of the FFmpeg log file that corresponds to the conversion that results in the corrupted mp4 file.
If mp4 download/conversion is taking a long time:
1) Are you converting a HD video? Those take longer to download and encode.
2) How long is the video? A full length tv show or movie is going to take awhile to download and encode.
3) What is your server's internet download speed? You'll want a minimum of 100 mbps to 1 gbps (somewhere in that range). If you expect to be downloading a lot of long, HD videos, then you'll want a faster connection speed.
4) Please set the 'maxDuration' key for each converted file type listed in Config::_convertedFileTypes in config.class.php to limit the length of YouTube videos that can be downloaded/converted.
This script will run on a dedicated, VPS, or shared host, as long as the server is configured correctly and has ample resources.
Why don't you start by telling me what the server specs are for your VPS? I can help you identify any potential problems there.
For a low traffic site, you don't need much in the way of server resources to facilitate video conversion. Of course, as your site traffic increases, you will need more server resources and a more powerful server.
Edit: By the way, the -vpre flag still works fine for me with the latest stable version of FFmpeg on Ubuntu 12.04. So your problems could stem from a faulty server installation and/or configuration. If you continue to have issues, please consider having a professional install the software's required dependencies on your server.