[FFmpeg-user] Poor quality output when converting avi to mp4
Ute Willmore
uwillmore at remotegeo.com
Mon Jul 24 21:26:32 EEST 2017
Hi everyone,
I am hoping someone on this list can help me with a problem I am having
when converting a .avi video to .mp4 using FFmpeg. The output I get starts
out looking good, but then degrades and by the time the 18 second video
finishes it is hard to recognize what's on the screen. The colors are all
off, some areas are just single color blobs where there used to be trees.
I am really hoping someone here will be able to help.
I have the latest version 20170718-012620a of ffmpeg. This is the static 64
bit version for Windows running on Windows 10 Pro.
I started out using the following command to convert the video:
ffmpeg -v verbose -i hd.avi -vf scale=640:480 scaledoutput.mp4
After some research and reading on various websites, I tried this:
ffmpeg -v verbose -i hd.avi -c:v h264 -crf 19 -preset slow
scaledoutput.mp4
I tried different crf and preset values but nothing made a difference.
Eventually I tried to just copy the video using this command:
ffmpeg -v verbose -i hd.avi -c copy -map 0 scaledoutput.mp4
and the result was just as bad.
Next I started looking for another converter to see if I could get better
results and found that Adobe and VLC work just fine. There are others as
well, but I need a converter is free and can be run from the command line,
because the conversion will be done in a .NET Desktop application. VLC
seems to fit the bill best, at least for now.
I really would like to do this with ffmpeg for a number of reasons,
including the speed of ffmpeg. It is so much faster and can do so much more
than any other media converter, but if I can't get it to produce a decent
quality video when converting avi to mp4 I may end up using something else.
BTW, when I run ffprobe on the output file produced by ffmpeg and on the
output file produced by VLC, I get get the same information for the video
stream. The video stream is stream 0, 0, the encode is h264 and pixel
format is yuv420p. Here is the relevant output from ffprobe:
For the output created by VLC:
Stream #0:1(eng): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720
[SAR 1:1 DAR 16:9], 6378 kb/s, 50 fps, 50 tbr, 1000k tbn, 100 tbc (default)
For the output created by ffmpeg:
Stream #0:0(und): Video: h264 (High) (avc1 / 0x31637661), yuv420p, 1280x720
[SAR 1:1 DAR 16:9], 8482 kb/s, 50 fps, 50 tbr, 12800 tbn, 100 tbc (default)
The meta data encode used by the 2 converters is different and audio is
handled differently as well, but that should not impact the video quality,
right?
The file produced by VLC looks great when I run it but the file produced by
ffmpeg is really very poor quality,
If you need to see the files I am working with, try getting them from
Dropbox.com
Here is the link to the input file:
dropbox.com/s/dw6ml8iwnnkmoz9/hd.avi?dl=0
<https://www.dropbox.com/s/dw6ml8iwnnkmoz9/hd.avi?dl=0>
and the output file is here:
dropbox.com/s/p19vsn9iasb99km/scaledoutput.mp4?dl=0
<https://www.dropbox.com/s/p19vsn9iasb99km/scaledoutput.mp4?dl=0>
If that does not work for you, let me know if I can post videos to the list
and I will try that. I have not found any method for doing so, but maybe I
overlooked something or I am too new to the list?
Anyway, if anyone can help figure this out, I would be very grateful. If
more details are needed, please let me know what I missed and I will try to
provide it.
TIA
urw
More information about the ffmpeg-user
mailing list