[FFmpeg-trac] #11126(undetermined:new): Using filter setpts=PTS-STARTPTS in 2 pass vp9 webm causes final video bitrate to be small
FFmpeg
trac at avcodec.org
Mon Aug 5 17:50:53 EEST 2024
#11126: Using filter setpts=PTS-STARTPTS in 2 pass vp9 webm causes final video
bitrate to be small
-------------------------------------+-------------------------------------
Reporter: Saul Baker | Type: defect
Status: new | Priority: normal
Component: | Version:
undetermined | unspecified
Keywords: | Blocked By:
Blocking: | Reproduced by developer: 0
Analyzed by developer: 0 |
-------------------------------------+-------------------------------------
Summary of the bug:
Converting an mp4 to vp9 webm displays a marked reduction in quality and
small final video bitrate when the filter "setpts=PTS-STARTPTS" is applied
during a 2 pass encode, 1 pass encodes do not display the same difference,
nor does an arbitrary old version.
How to reproduce:
{{{
ffmpeg -y -i "source.mp4" -filter_complex "setpts=PTS-STARTPTS" -pass 1
-passlogfile pass.log -c:v libvpx-vp9 -c:a libopus -pix_fmt yuv420p
-quality good -b:v 3271553 -an -sn -f null nul
ffmpeg -y -i "source.mp4" -filter_complex "setpts=PTS-STARTPTS" -pass 2
-passlogfile pass.log -c:v libvpx-vp9 -c:a libopus -pix_fmt yuv420p
-quality good -b:v 3271553 -ac 1 -ar 48k -b:a 65536 -sn
dest_2pass_setpts.webm
ffmpeg -y -i "source.mp4" -filter_complex "null" -pass 1 -passlogfile
pass.log -c:v libvpx-vp9 -c:a libopus -pix_fmt yuv420p -quality good
-b:v 3271553 -an -sn -f null nul
ffmpeg -y -i "source.mp4" -filter_complex "null" -pass 2 -passlogfile
pass.log -c:v libvpx-vp9 -c:a libopus -pix_fmt yuv420p -quality good
-b:v 3271553 -ac 1 -ar 48k -b:a 65536 -sn dest_2pass_nofilter.webm
ffmpeg -y -i "source.mp4" -filter_complex "setpts=PTS-STARTPTS" -c:v
libvpx-vp9 -c:a libopus -pix_fmt yuv420p -quality good -b:v 3271553
-ac 1 -ar 48k -b:a 65536 -sn dest_1pass_setpts.webm
}}}
ffprobe output for 2024-08-01-git-bcf08c1171
{{{
>> ffprobe dest_2pass_setpts.webm
Duration: 00:00:41.73, start: -0.007000, bitrate: 68 kb/s
>> ffprobe dest_2pass_nofilter.webm
Duration: 00:00:41.73, start: -0.007000, bitrate: 3268 kb/s
>> ffprobe dest_1pass_setpts.webm
Duration: N/A, start: -0.007000, bitrate: N/A
}}}
ffprobe output for 2023-01-30-git-2d202985b7
{{{
>> ffprobe dest_2pass_setpts.webm
Duration: 00:00:41.73, start: -0.007000, bitrate: 3268 kb/s
>> ffprobe dest_2pass_nofilter.webm
Duration: 00:00:41.73, start: -0.007000, bitrate: 3268 kb/s
>> ffprobe dest_1pass_setpts.webm
Duration: 00:00:41.73, start: -0.007000, bitrate: 2614 kb/s
}}}
{{{
ffmpeg version 2024-08-01-git-bcf08c1171-essentials_build-www.gyan.dev
Copyright (c) 2000-2024 the FFmpeg developers
built with gcc 13.2.0 (Rev5, Built by MSYS2 project)
configuration: --enable-gpl --enable-version3 --enable-static --disable-
w32threads --disable-autodetect --enable-fontconfig --enable-iconv
--enable-gnutls --enable-libxml2 --enable-gmp --enable-bzlib --enable-lzma
--enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-
avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265
--enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx
--enable-mediafoundation --enable-libass --enable-libfreetype --enable-
libfribidi --enable-libharfbuzz --enable-libvidstab --enable-libvmaf
--enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-
dxva2 --enable-d3d11va --enable-d3d12va --enable-ffnvcodec --enable-libvpl
--enable-nvdec --enable-nvenc --enable-vaapi --enable-libgme --enable-
libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-
libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-
amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-
librubberband
libavutil 59. 31.100 / 59. 31.100
libavcodec 61. 11.100 / 61. 11.100
libavformat 61. 5.101 / 61. 5.101
libavdevice 61. 2.100 / 61. 2.100
libavfilter 10. 2.102 / 10. 2.102
libswscale 8. 2.100 / 8. 2.100
libswresample 5. 2.100 / 5. 2.100
libpostproc 58. 2.100 / 58. 2.100
}}}
Patches should be submitted to the ffmpeg-devel mailing list and not this
bug tracker.
--
Ticket URL: <https://trac.ffmpeg.org/ticket/11126>
FFmpeg <https://ffmpeg.org>
FFmpeg issue tracker
More information about the FFmpeg-trac
mailing list