//大小=》变小
ffmpeg -i 1.mp4 -b:v 2M -vcodec msmpeg4 -acodec wmav2 1_mp4.wmv
//大小=》变大
ffmpeg -i 1.mp4 -qscale 2 -vcodec msmpeg4 -acodec wmav2 2_mp4.wmv

ffmpeg -i 1.mp4 -q:a 2 -q:v 2 -vcodec msmpeg4 -acodec wmav2 3_mp4.wmv

ffmpeg -i 1.mp4 outputfile.wmv

ffmpeg -i 1.MP4 -c:v wmv2 -b:v 20M -c:a wmav2 -b:a 192k output.wmv

ffmpeg -i input.wmv -c:v libx264 -crf 23 -profile:v high -r 30 -c:a libfaac -q:a 100 -ar 48000 output.mp4

ffmpeg -i input.wmv -c:v libx264 -crf 23 -c:a libfaac -q:a 100 output.mp4

How to get better quality converting MP4 to WMV with ffmpeg?

I am converting MP4 files to WMV with these two rescaling commands:

ffmpeg -i test.mp4 -y -vf scale=-1:360 test1.wmv
ffmpeg -i test.mp4 -y -vf scale=-1:720 test2.wmv

I've also tried:

ffmpeg -g 1 -b 16000k -i test1.mp4 test1.wmv

However, the .wmv files that are produced are "blocky and grainy" as you can see here in a small section of a video screenshot:

ffmpeg mp4 to wmv   and wmv to mp4-LMLPHP

These are the sizes:

test.mp4 - 106 MB
test1.wmv - 6 MB
test2.wmv - 16 MB

How can I increase the quality/size of the resulting .wmv files (the size of the .wmv files is of no concern)?

asked Jun 18 '12 at 8:53
ffmpeg mp4 to wmv   and wmv to mp4-LMLPHP
Edward Tanguay

60.2k224572875
 
10

You can simply use the -sameq parameter ("use same quantizer as source") which produces a much larger sized video file (227 MB) but with excellent quality.

ffmpeg -sameq -i test.mp4 -y -vf scale=-1:360 test1.wmv
answered Jun 18 '12 at 9:23
ffmpeg mp4 to wmv   and wmv to mp4-LMLPHP
Edward Tanguay

60.2k224572875
 
7 
A better solution is to use -qscale (or -qscale:v or -q:v depending on your syntax preference); generally with a value of 2-5. A lower value is higher quality, and 2 can be considered "visually lossless". -sameq is not designed to be used between formats that do not share the same quantizer scale, and this may be the case for you. – LordNeckbeard Jun 18 '12 at 16:03
2 
Also you're applying -sameq as an input option (anything before -i). Probably works as expected, but keep in mind not all options applied to the input will be applied to the output. – LordNeckbeard Jun 18 '12 at 16:07
   
-sameq has been removed. When you try to use it ffmpeg offers "use -qscale 0 or an equivalent quality factor option", and it errors out with an invalid argument. – Robert Koernke Jan 6 at 17:04
 
3

One thing I discovered after many frustrating attempts of enhancing the final quality was that if you don't specify a bitrate, it'll use a quite low average. Try -b 1000k for a starting point, and experiment increasing or decreasing it until you reach the desired result. Your file will be quite bigger or smaller, accordingly.

answered Feb 7 '13 at 22:59
ffmpeg mp4 to wmv   and wmv to mp4-LMLPHP
Fabio Ceconello

11.2k42645
 
2

Consider the following command instead (some outdated commands in the final answer section):

ffmpeg -i test.mp4 -c:v wmv2 -b:v 1024k -c:a wmav2 -b:a 192k test1.wmv

REFERENCES

answered Jan 18 at 10:02
ffmpeg mp4 to wmv   and wmv to mp4-LMLPHP
 

http://stackoverflow.com/questions/11079577/how-to-get-better-quality-converting-mp4-to-wmv-with-ffmpeg

05-12 04:34