Of course it's faster if you're just copying the bitstream — with copy, you're not re-encoding anything. What hardware do you have, e.g. CPU? What's your OS and which version of FFmpeg is that?
–
slhck♦Aug 10 '12 at 8:44

@slhck: The computer is not very fast E5400 2.7GHz but why is it slow for mp4 while it is fast for avi?
–
GiorgiAug 10 '12 at 9:04

I don't see any AVI output in your question. Could you update it with the full output?
–
slhck♦Aug 10 '12 at 9:07

2 Answers
2

Stream copying

When you call -c:v:1 copy, FFmpeg will take the existing video bitstream and stream copy it. The video bitstream is just encapsulated in the outside container, e.g. WMV, AVI or MP4 – your actual video bitstream is msmpeg4 and will stay like this.

When copying the bitstream, FFmpeg doesn't need to actually decode and re-encode the actual video. It just needs to merge the video bitstream into a new container format, which is often a rather simple operation and therefore doesn't take long.

Encoding

In contrast to that, if you call -vcodec libx264 (or -c:v libx264, the syntax you should use because vcodec is deprecated), FFmpeg will be forced to decode the video bitstream from msmpeg4 to a raw format, then pipe it into x264, a H.264 encoder.

x264 is fast, but still, encoding video takes time – especially when it's 720p content. And it might take more than one hour, especially if your input is already longer than one hour. Also, your CPU might not be the fastest. This is the main reason older MPEG-4 Visual encoders like XviD are still around and very popular: They take less time to encode than H.264 codecs. They might not give you the best performance in terms of quality vs. file size, but they are fast.

That all being said: You can speed up x264 encoding by forcing a preset. Presets are encoder optimization settings and range from: ultrafast, superfast, veryfast, faster, fast, medium, slow, slower, veryslow. Your command could then look like this:

ffmpeg -i input.wmv -c:v libx264 -preset ultrafast out.mp4

It should run faster than without the preset. The only drawback is that it doesn't achieve as good quality for the same compression rates in comparison to, for example, -preset veryslow.

Apart from that, there's not much you can do except for investing in a speedy CPU, and making sure you're running a recent build of FFmpeg with x264 support.

Thanks for the answer. I'm not sure if I was clear or not but if I use copy it is still very slow. I tried your command and it has processed only 4 second after 5 minutes. My video is about 75 minutes long and converting to avi takes only 15 minutes but mp4 takes several hours.
–
GiorgiAug 10 '12 at 9:59

AS I was playing (endless hours) with WMV->MP4 conversion, I found a superfast way to do it. But it has a price: a storage price. If you convert WMV to lossless, then from lossless to MP4, it does the full conversion in no time. But you need 100 times HDD space to store the lossless version, which is painful.

So it turns out you can chose from very slow or very HDD intensive versions of WMV->MP4 conversion and you have no other choice.