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
519 stars 169 forks source link

[SVT-HEVC]different sizes of output files generated when encoding a specified YUV stream several times if tune=0 with ffmpeg and SvtHevcEncApp #178

Closed DanielOutlook closed 5 years ago

DanielOutlook commented 5 years ago

For this task the stream processed is "Fallout4_003_1920x1080_8bit_60Hz_P420.yuv", which can be accessed via this link: https://mega.nz/#!6OZEFKRJ!j_1TwlDc9gYW67dOrWo7u5Q8I2ZgghgJ0zgUfTZE0Ps When this stream is encoded with ffmpeg and SvtHevcEncApp, the sizes of output files are different almost every time it is encoded. This problem can be re-occurred on SKL machine. The "-vframes" should be larger than 150, if not, the problem would not appear. The command line for ffmpeg is: ffmpeg -r 60 -video_size 1920x1080 -f rawvideo -i /home/media/ws/msdk_validation/mediasdk_streams/YUV/Fallout4_003_1920x1080_8bit_60Hz_P420.yuv -c:v libsvt_hevc -rc 0 -preset 9 -r 60 -aspect 1 -chroma_sample_location 1 -tune 0 -f hevc 0004.hevc The sizes (in the unit of byte) of output files are : 4908055, 4908003, 4908055, 4907987, 4908083, 4907987. The command line for SvtHevcEncApp is: SvtHevcEncApp -i /home/media/ws/msdk_validation/mediasdk_streams/YUV/Fallout4_003_1920x1080_8bit_60Hz_P420.yuv -w 1920 -h 1080 -fps-num 60 -fps-denom 1 -irefresh-type 2 -rc 0 -encMode 9 -tune 0 -b 0004.hevc.svtapp Output file sizes are (unit: byte): 4597562, 4597544, 4597540, 4907994, 4907974, 4908042 Both original YUV stream and the output files can be played normally (tested on ffplay). If the parameter "tune" is assigned to 1 or 2, the same problem does not happen on ffmepg or SvtHevcEncApp. Some other YUV streams (sizes at 1920x1080) are also tested, and the same problem does not happen when tune is assigned to 0, 1, or 2.

intelmark commented 5 years ago

Pulled down the Fallout clip and verified similar results on our NUC (w/ Ubunutu) with current builds. There is a file size difference when encoding this clip and using tuning mode 0.

ffmpeg -r 60 -video_size 1920x1080 -f rawvideo -i Fallout4_003_1920x1080_8bit_60Hz_P420.yuv -c:v libsvt_hevc -rc 0 -preset 9 -r 60 -aspect 1 -chroma_sample_location 1 -tune 0 -f hevc 0004.hevc

Tune 0: 0001t0.hevc 4600557 0002t0.hevc 4600568 0003t0.hevc 4600594 0004t0.hevc 4600562

Tune 1: 0001t1.hevc 4678665 0002t1.hevc 4678665 0003t1.hevc 4678665 0004t1.hevc 4678665

Tune 2: 0001t2.hevc 4711611 0002t2.hevc 4711611 0003t2.hevc 4711611 0004t2.hevc 4711611

~/SVT-HEVC/Bin/Debug/SvtHevcEncApp -I Fallout4_003_1920x1080_8bit_60Hz_P420.yuv -w 1920 -h 1080 -fps_num 60 -fps-denom 1 -irefresh-type 2 -r 0 -encMode 9 -tune 0 -b 003.hevc.svtapp

Tune 0: 0001t0.hevc.svtapp 4909065 0002t0.hevc.svtapp 4909065 0003t0.hevc.svtapp 4909085 0004t0.hevc.svtapp 4909006

Tune 1: 0001t1.hevc.svtapp 4947085 0002t1.hevc.svtapp 4947085 0003t1.hevc.svtapp 4947085 0004t1.hevc.svtapp 4947085

Tune 2: 0001t2.hevc.svtapp 4999187 0002t2.hevc.svtapp 4999187 0003t2.hevc.svtapp 4999187 0004t2.hevc.svtapp 4999187

tianjunwork commented 5 years ago

@intelmark Thank you for checking the issue.

tianjunwork commented 5 years ago

-tune parameter is deprecated. Now encoder only has 1 tune mode which is the original -tune 1.