OpenVisualCloud / SVT-VP9

SVT VP9 encoder. Scalable Video Technology (SVT) is a software-based video coding technology that is highly optimized for Intel® Xeon® processors. Using the open source SVT-VP9 encoder, it is possible to spread video encoding processing across multiple Intel® Xeon® processors to achieve a real advantage of processing efficiency.
Other
215 stars 46 forks source link

Cannot set colorspace bt709 #173

Open mrp1no opened 2 months ago

mrp1no commented 2 months ago

I'm trying to convert a video to VP9 with libsvt_vp9 by using the following command:

$ sudo ffmpeg -i /home/amedeo/Scrivania/Bear.mp4 \
-ss 00:00:01 \
-t 00:00:20 \
-map_metadata -1 \
-map_chapters -1 \
-sn \
-c:v libsvt_vp9 \
-rc vbr \
-tune vmaf \
-preset 4 \
-b:v 6M \
-maxrate:v 7M \
-minrate:v 4M \
-bufsize:v 12M \
-r 30000/1001 \
-g 60 \
-keyint_min 30 \
-c:a libvorbis \
-ar 48000 \
-b:a 320k \
-ac 2 \
-pix_fmt yuv420p \
-colorspace:v 'bt709' \
-color_primaries:v 'bt709' \
-color_trc:v 'bt709' \
-color_range:v 'tv' \
1080.webm

The issue here is -colorspace is not being recognized - Codec AVOption colorspace (color space) has not been used for any stream. - and is leading to this:

$ ffprobe -v error -select_streams v:0 -show_entries stream=color_range,color_space,color_primaries,color_transfer -of default=noprint_wrappers=1:nokey=1 1080.webm
tv
unknown
bt709
bt709

Also when I run Shaka Packager I get some warnings:

$ shaka in=1080.webm,stream=audio,output=audio.webm in=1080.webm,stream=video,output=vp9_1080p.webm --mpd_output master.mpd
I0406 23:23:04.020563    8801 demuxer.cc:94] Demuxer::Run() on file '1080.webm'.
I0406 23:23:04.020594    8801 demuxer.cc:160] Initialize Demuxer for file '1080.webm'.
W0406 23:23:04.031989    8801 vp_codec_configuration_record.cc:46] VPx video full range flag is inconsistent, 1 vs 0
W0406 23:23:04.032006    8801 vp_codec_configuration_record.cc:46] VPx color primaries is inconsistent, 1 vs 2
W0406 23:23:04.032009    8801 vp_codec_configuration_record.cc:46] VPx transfer characteristics is inconsistent, 1 vs 2
W0406 23:23:04.032011    8801 vp_codec_configuration_record.cc:46] VPx matrix coefficients is inconsistent, 1 vs 2
I0406 23:23:04.067046    8801 webm_muxer.cc:61] WEBM file 'audio.webm' finalized.
I0406 23:23:04.076172    8801 webm_muxer.cc:61] WEBM file 'vp9_1080p.webm' finalized.
Packaging completed successfully.

And when casting to Chromecast HD (with Google TV) this is the result: IMG_20240405_235542

The same video re-encoded with libvpx-vp9 using the same settings outputs this and plays fine on Chromecast HD:

$ ffprobe -v error -select_streams v:0 -show_entries stream=color_range,color_space,color_primaries,color_transfer -of default=noprint_wrappers=1:nokey=1 1080.webm
tv
bt709
bt709
bt709

Even Shaka Packager gives less warnings on the file:

$ shaka in=1080.webm,stream=audio,output=audio.webm in=1080.webm,stream=video,output=vp9_1080p.webm --mpd_output master.mpd
I0406 23:24:40.562933    9608 demuxer.cc:94] Demuxer::Run() on file '1080.webm'.
I0406 23:24:40.562975    9608 demuxer.cc:160] Initialize Demuxer for file '1080.webm'.
W0406 23:24:40.573458    9608 vp_codec_configuration_record.cc:46] VPx video full range flag is inconsistent, 1 vs 0
I0406 23:24:40.606545    9608 webm_muxer.cc:61] WEBM file 'audio.webm' finalized.
I0406 23:24:40.616666    9608 webm_muxer.cc:61] WEBM file 'vp9_1080p.webm' finalized.
Packaging completed successfully.

(I still don't get what that "VPx video full range flag is inconsistent, 1 vs 0" should mean, but the libvpx-vp9 video plays fine).

Here's a zip file with the original file and the two converted files