[FFmpeg-user] Low-quality transcode
Wouter Verhelst
wverhelst at fosdem.org
Mon Feb 17 09:27:26 EET 2020
Hi list,
I'm a member of the FOSDEM video team. I wrote a tool to automatically
review and transcode FOSDEM video recordings, written in Perl, which
simply calls ffmpeg and ffprobe to do all the hard work[1]. It works
well, but there's something that's a bit weird.
For one particular talk, the quality of the transcode from MP4 to WebM
is very low. I use VBR encoding, but in most cases I end up with a
transcoded file that is about 60-70% of the size of the original file.
In one particular case, however, the file ends up being less than 50% of
the original file, and the quality is very low; the transcoded file ends
up having very visible encoder artifacts:
https://video.fosdem.org/2020/AW1.125/ada_rad.webm
Note the camera PIP at the bottom right corner, where smears etc are
clearly visible.
The command line that was originally used is this one:
'ffmpeg' '-loglevel' 'warning' '-y' '-f' 'concat' '-safe' '0' '-i'
'/tmp/transSnsDON/concat.txt' '-c:v' 'libvpx-vp9' '-b:v' '1024k'
'-minrate' '512k' '-maxrate' '1484.8k' '-r:v' '25/1' '-crf' '32'
'-speed' '4' '-pass' '1' '-passlogfile'
'/srv/sreview/output/2020/AW1.125/ada_rad.webm-multipass' '-c:a'
'libopus' '-b:a' '128k' '-ar' '48000' '-t' '1331.934' '-pix_fmt'
'yuv420p' '-metadata' 'title=On Rapid Application Development in Ada'
'-metadata' 'event=FOSDEM 2020' '-metadata' 'speakers=Tomasz Maluszycki'
'-metadata' 'date=2020-02-01'
'/srv/sreview/output/2020/AW1.125/ada_rad.webm'
'ffmpeg' '-loglevel' 'warning' '-y' '-f' 'concat' '-safe' '0' '-i'
'/tmp/transSnsDON/concat.txt' '-c:v' 'libvpx-vp9' '-b:v' '1024k'
'-minrate' '512k' '-maxrate' '1484.8k' '-r:v' '25/1' '-crf' '32'
'-speed' '2' '-pass' '2' '-passlogfile'
'/srv/sreview/output/2020/AW1.125/ada_rad.webm-multipass' '-c:a'
'libopus' '-b:a' '128k' '-ar' '48000' '-t' '1331.934' '-pix_fmt'
'yuv420p' '-metadata' 'title=On Rapid Application Development in Ada'
'-metadata' 'event=FOSDEM 2020' '-metadata' 'speakers=Tomasz Maluszycki'
'-metadata' 'date=2020-02-01'
'/srv/sreview/output/2020/AW1.125/ada_rad.webm'
which are the same settings as used for all other videos (and those seem
to be fine).
I first thought I'd just tweak things a bit, and tried changing the
bitrate values in the above command line to '-b:v' '1800k' '-minrate'
'900k' '-maxrate' '2610k', with everything else remaining the same. That
didn't result in any visible difference.
Next, I bumped -minrate to '1500k', and left -b:v and -maxrate to the
1800 and 2610k settings. That also didn't result in any visible
difference.
I'm beginning to think that perhaps I've found a bug in ffmpeg. Any
thoughts?
The ffmpeg version used is the one packaged in Debian buster:
ffmpeg version 4.1.4-1~deb10u1 Copyright (c) 2000-2019 the FFmpeg
developers
built with gcc 8 (Debian 8.3.0-6)
configuration: --prefix=/usr --extra-version='1~deb10u1'
--toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu
--incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl
--disable-stripping --enable-avresample --disable-filter=resample
--enable-avisynth --enable-gnutls --enable-ladspa --enable-libaom
--enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca
--enable-libcdio --enable-libcodec2 --enable-libflite
--enable-libfontconfig --enable-libfreetype --enable-libfribidi
--enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame
--enable-libmysofa --enable-libopenjpeg --enable-libopenmpt
--enable-libopus --enable-libpulse --enable-librsvg
--enable-librubberband --enable-libshine --enable-libsnappy
--enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora
--enable-libtwolame --enable-libvidstab --enable-libvorbis
--enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265
--enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi
--enable-lv2 --enable-omx --enable-openal --enable-opengl --enable-sdl2
--enable-libdc1394 --enable-libdrm --enable-libiec61883
--enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libavutil 56. 22.100 / 56. 22.100
libavcodec 58. 35.100 / 58. 35.100
libavformat 58. 20.100 / 58. 20.100
libavdevice 58. 5.100 / 58. 5.100
libavfilter 7. 40.101 / 7. 40.101
libavresample 4. 0. 0 / 4. 0. 0
libswscale 5. 3.100 / 5. 3.100
libswresample 3. 3.100 / 3. 3.100
libpostproc 55. 3.100 / 55. 3.100
The input video files are removed at the end of the transcode process,
so I cannot produce those; however, the .mp4 files are created with
'-c:v copy -c:a copy', so I believe that should be enough for you to
reproduce the issue (if not, let me know and I can recreate them).
Any insights as to why this is happening would be appreciated.
Thanks,
[1] https://github.com/yoe/sreview, in case you care.
--
<Lo-lan-do> Home is where you have to wash the dishes.
-- #debian-devel, Freenode, 2004-09-22
More information about the ffmpeg-user
mailing list