I have got a WMV (v9 (WMV3), 960x720, 30.000030 fps, planar 4:2:0 YUV, produced by PowerPoint 2010) file and need to convert it to MPEG2 - the only format my TVset can read from an USB flash drive (I have also tried MP4/h.264, AVI/XVID - nothing but MPEG2 works).
I have managed to to the job with simple
ffmpeg -i "in.wmv" -c:v mpeg2video "out.mpg"
but the quality of the result is dreadful (clearly visible visual distortions are introduced) and the playback is not smooth (too slow at some moments).
I have also tried
ffmpeg -i "in.wmv" -c:v mpeg2video -pix_fmt yuv420p -me_method epzs -threads 4 -r 30.000030 -g 45 -bf 2 -trellis 2 -cmp 2 -subcmp 2 -s 960x720 -b 2500k -bt 300k -async 1 -y "out.mpg"
(I have found this somewhere in the Internet and modified a little bit - changed the resoultion, the refresh rate and the output format (from VOB to bare MPG)) succesfully but the quality is still too bad.
What parameters do I have to use to save as much quality as possible? Compression ratio doesn't matter at all, even increase in file size is acceptable.
Anther thing I actually need (I have chosen not to include it in the question title to avoid making it too specific but I'd appreciate it being considered in the answers) is adding pure silence as a sound track - there is no sound in the original but the TV set complains about it and I'd like to get rid of this complain. I have generated a same-length (second-precise) silence OGG Vorbis file using Audacity but I can't manage to merge it with the video:
ffmpeg -i in.mpg -i silence.ogg -c:v copy -c:a libmp3lame out.mpg
and even bare
ffmpeg -i in.mpg -c:v copy -out.mpg
gives "buffer underflow" and "packet too large" errors. (in.mpg are the files produced by the same FFMPEG binary and the same source WMV file using the first two commands in the question).
I am using a Zeranoe FFMPEG build on Windows 7.