OpenVisualCloud / SVT-HEVC

SVT HEVC 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-HEVC encoder, it is possible to spread video encoding processing across multiple Intel® Xeon® processors to achieve a real advantage of processing efficiency.
Other
516 stars 172 forks source link

-hdr not working in SVT ffmpeg-plugin #546

Closed LSC527 closed 4 years ago

LSC527 commented 4 years ago

ffmpeg -y -s 1920x1080 -pix_fmt yuv420p10le -i xx.yuv -c:v libsvt_hevc -rc 1 -b:v 15M -preset 5 -hdr 1 xx.mp4

LSC527 commented 4 years ago

It seems that there is no difference in my out put file whether I set -hrd 1 or not

LSC527 commented 4 years ago

link to param -hdr in svt ffmpeg_plugin

https://github.com/OpenVisualCloud/SVT-HEVC/blob/master/ffmpeg_plugin/0001-lavc-svt_hevc-add-li

intelmark commented 4 years ago

Are the bitstreams the same when compared using a binary byte comparison or running md5sum? "-hdr 1" should result in VUI parameters being written to the SPS (sequence parameter set) within the HEVC file structure and thus the bitstreams should be different. The encoded frames may still be the same content as the HDR informative is basically metadata and would not have an effect on the encoding.

LSC527 commented 4 years ago

./SvtHevcEncApp -i xx.yuv -w 1920 -h 1080 -b xx.mp4 -bit-depth 10 -encMode 5 -fps 25 -rc 1 -vid-info 1 -hdr 1 I tried the same command in SVT using '-hdr 1' and '-hdr 0', and can see clear difference in color when I play the output file in a video player. But in SVT ffmpeg-plugin, I saw no difference.

tianjunwork commented 4 years ago

Hi @LSC527 , -hdr is exposed in https://github.com/OpenVisualCloud/SVT-HEVC/issues/430. which according to the submitter, it works fine with HDR10 input. And if you use -hdr 1, VideoUsabilityInfo is forced to 1. https://github.com/OpenVisualCloud/SVT-HEVC/blob/master/Source/Lib/Codec/EbEncHandle.c#L2036. -vid-info is not needed.

LSC527 commented 4 years ago

Thanks, @tianjunwork @intelmark . I compare the output file with md5sum which shows that the files are different. But I still wonder why using SVT can cause difference in a video player while using SVT cannot. Now I want to try this way mentioned in https://github.com/OpenVisualCloud/SVT-HEVC/blob/master/README.md image but how do I output a file using this way?

tianjunwork commented 4 years ago

Thanks, @tianjunwork @intelmark . I compare the output file with md5sum which shows that the files are different. But I still wonder why using SVT can cause difference in a video player while using SVT cannot.

what is the context? which two cli output different bitstream with md5sum? Do do you have a bitstream parser to see if the vui is inserted for both bitstream?

Now I want to try this way mentioned in https://github.com/OpenVisualCloud/SVT-HEVC/blob/master/README.md image but how do I output a file using this way?

Use -b xxx.bin to output hevc bitstream by SvtHevcEncApp. If you want to use mp4, please stick to ffmpeg.

guojiansheng0925 commented 4 years ago

Hi @LSC527 , I have tried to reproduce the issue with following command:

ffmpeg -y -s 1280x720 -pix_fmt yuv420p10le -i ~/content/Suzie_ProRes_1280x720_50f.p010.yuv -c:v libsvt_hevc -rc 1 -b:v 15M -preset 5 -hdr 1 out.h265

And there are vui parameters in the output stream: image

Could you please try to output the h265 stream to see whether it works well? Note: try h265 stream first not mp4

Which video player did you use? And please check your software version of FFmpeg and SVT-HEVC.

Thanks.

LSC527 commented 4 years ago

Thanks a lot for your attention @guojiansheng0925 ! I built SVT-HEVC ffmpeg_plugin following the instructions in https://github.com/OpenVisualCloud/SVT-HEVC/blob/master/ffmpeg_plugin/README.txt . I used master branch of SVT-HEVC and release/4.2 of ffmpeg according to the instructions. I used video player named PotPlayer which can be found in https://potplayer.org/. So how can I cheak vui parameters in the output stream?

guojiansheng0925 commented 4 years ago

Hi @LSC527 , you can use a bitstream parser to check if there is vui parameters. For hevc, you can try the following tools: Elecard HEVC Analyzer, ViCue Video Codec Analyzer

LSC527 commented 4 years ago

Thanks, I try to output the h265 stream rather than mp4, and it works fine now.