16
5
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.
2Someone is going to ask you for a full output log. – dstob – 2014-11-04T18:01:10.743
What TV set exactly? It might be able to read H.264, just a different profile. – slhck – 2014-11-04T18:06:30.590
@slhck The TV set is
Philips 42PFL3606H/58
, I am encoding to H.264 withffmpeg -i "in.wmv" -sws_flags lanczos+accurate_rnd -c:v libx264 -crf 20 -preset slow -profile:v baseline -level 3.0 -pix_fmt yuv420p -tune fastdecode -x264-params keyint=240:min-keyint=20 "out.mp4"
- the profile is the lowest I know and even more tweaks are used to make playing the resulting file an easier task. – Ivan – 2014-11-04T18:29:49.7871According to the manual the TV supports MPEG-4 Visual and H.264. If Baseline profile doesn't work, I'm not sure what does. But TVs are very picky. – slhck – 2014-11-04T18:45:16.990