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

Stuttering with MKV file on blu ray player Panasonic #606

Closed luca2125 closed 2 years ago

luca2125 commented 2 years ago

Hi,

I have converted many MKV file using SVT-HEVC but I get micro stuttering and stuttering issue (only with Panasonic blu ray player, no any issue with my PC using VLC player).

Here a sample of command:

ffmpeg.exe -vsync 1 -i "G:\Film da ottimizzare per blu ray\Deep Space 9 (ffmpeg ori)\Disk3\Star Trek Season 2- Disc 1_t05_ori.mkv" -y -c:v libsvt_hevc -preset 5 -qp 21 -pix_fmt yuv420p10le -profile:v 2 -map 0:0 -map 0:s -map 0:6 -disposition:a:0 +default+forced -map 0:1 -disposition:a:1 -default-forced -map 0:2 -disposition:a:2 -default-forced -c:a copy -c:s copy -metadata:s:v:0 Language="rom" -t 60 "Star Trek Season 2- Disc 1_t05_ori.mkv_60_sec_vsync.mkv"

before I send this post I have compared A/B the result of LIbx265 and SVT-HEVC. While SVT-HEVC is more faster and better quality with my panasonic I get some issues.

To get sure that this issue not depend by compression I have do a test with: -qp 5 (for libsvt_hevc) and -CRF 5 (for LIbx265) and I get the some result: the issue not change.

if I encode a MKV file and I choose the Flac audio track there is remarkable random stuttering of 1/2 second. The 90% of problem is solved by run after mkvmerge without pass any special parameters:

mkvmerge -o "Star Trek Season 2- Disc 1_t05_libsvrt.mkv" "Star Trek Season 2- Disc 1_t05_60_sec_no_compres.mkv"

if I encode a MKV file and I choose the dolby digital track stuttering is very low but it still present (there is a bit lack of smooth).

The final result:

1) If I play any MKV (SVT-HEVC or LIbx265) with my PC using VLC player work perfectly I don't see smooth difference.

2) If I play any MKV with my panasonic using LIbx265 codec I don't see smooth difference / issues.

3) If I play any MKV with my panasonic using SVT-HEVC codec there is always lack of smooth that is very high if switch the FLAC track,

There is a way to solve ?

Thanks !

tianjunwork commented 2 years ago

Hi @luca2125 , is that possible to share a problematic mkv file encoded with SVT-HEVC? Also to compare with, could you also share a mkv file encoded with Libx265?

luca2125 commented 2 years ago

Many thanks for your response @tianjunwork !!

There the samples of only 60 seconds:

https://drive.google.com/drive/folders/1KX_YphHrDgHTKpiOo79xKBd2u9T87wav?usp=sharing

the result is the some of full length files.

Here you find:

1) The command lines that I have used. 2) The ffmpeg.exe binary that I have used. 3) The Mkv files (60 seconds of original, libx265 and SVT-HEVC with similar setting).

If need I can send the real (full length files) that need more space.

Please let me known if need other informations.

Thanks at advance !!

luca2125 commented 2 years ago

Hi @tianjunwork , please excuse me for disturb again, do you have had the possibility to look into ?

Thanks at advance

tianjunwork commented 2 years ago

I've examined the timestamp of those mkv files. Timestamps are correctly added. Playback issue should not come from file container. The decoder of Panasonic blu ray player may not handle bitstream from SVT-HEVC properly. Most of the important fields which may affect playback in VPS/SPS/PPS are the same between SVT-HEVC and libx265.

I don't have a Panasonic blu ray player, all I can do is guessing what may cause playback issue. Could you try on your side to see which works? Please try below step separately.

  1. Could you set hielevel to 0 or 1 or 2 instead of using the default 3? https://github.com/OpenVisualCloud/SVT-HEVC/blob/master/ffmpeg_plugin/n4.4-0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch#L573
  2. Set vid_info to 1. https://github.com/OpenVisualCloud/SVT-HEVC/blob/master/ffmpeg_plugin/n4.4-0001-lavc-svt_hevc-add-libsvt-hevc-encoder-wrapper.patch#L629
  3. Does title_t00_ori_60_sec.mkv playback properly on Panasonic blu ray player?
luca2125 commented 2 years ago

hi @tianjunwork,

Thank you for your response.

I can do this test, but to try I ask you the favour to re-compile ffmpeg (for windows please) with your plug-in becouse it is bit hard for me do it (last time I have tried without success and @1480c1 was sent me ffmpeg.exe already compiled that I have included on google drive).

about

title_t00_ori_60_sec.mkv title_t00_Libx265_60_sec_Slow.mkv

I confirm work good.

My impression it that the problem seem linked to audio:

I have inserted another 2 files in the some folder on drive:

https://drive.google.com/drive/folders/1KX_YphHrDgHTKpiOo79xKBd2u9T87wav?usp=sharing

title_t00_libsvrt_60_Sec_no_audio.mkv is similar to "title_t00_libsvrt_60_Sec.mkv" but I have not included the audio.

The result is that is more smooth than original file "title_t00_ori_60_sec.mkv" (I have the illusion like if was 60 FPS but is it not true).

There is a side effect: the playback is altered is more faster than original.

The file "title_t00_Libx265_60_sec_Slow_no_audio.mkv" play exacly like "title_t00_Libx265_60_sec_Slow.mkv" but there is no audio.

In short seem that the audio on SVT-HEVC influence the video playback , while in libx265 this not happen.

Hope this information can be useful.

Best Regards

Marco

tianjunwork commented 2 years ago

Hi @guojiansheng0925, using vicue to open these mkv file, the ts seems wrong. Do you think this is the root cause for playback stuttering? It may worth examine the PTS from the encoder. title_t00_libsvrt_60_Sec.mkv image

title_t00_libsvrt_60_Sec_no_audio.mkv image

tianjunwork commented 2 years ago

Hi @luca2125 , thanks for the information. Please hold on testing with additional encoder parameters. Could you use your phone to take a video on the stuttering issue with Panasonic blu ray player?

luca2125 commented 2 years ago

Today I will send a video with my camera.

guojiansheng0925 commented 2 years ago

Hi @tianjunwork , the pts in encoder looks good. The dts in the stream encoded by svt_hevc is a little different with x265 but I am not sure if it matters.

And I found the strange Timecode in MKV file may be related to the subtitle stream.

Hi @luca2125 , could you please try to remove subtitle info in your command and check if it can be played well with your Panasonic blu ray player?

ffmpeg.exe -i "title_t00_ori_60_sec.mkv" -y -c:v libsvt_hevc -preset 5 -qp 21 -pix_fmt yuv420p10le -profile:v 2 -metadata:s:v:0 Language="rom" -t 60 "title_t00_libsvrt_60_Sec_without_s.mkv"

Thanks Jiansheng

luca2125 commented 2 years ago

hi @tianjunwork , @guojiansheng0925 ,

I have added on drive 2 other files on google drive:

title_t00_libsvrt_60_Sec_without_s.mkv title_t00_libsvrt_60_Sec_without_s_no_audio.mkv

without subtitles don't change the situation.

with audio there is a micro stuttering, without audio no stuttering but play a little more faster (small difference but I see it).

Now I go to Gym, when I comeback I will create the videos and will send you.

Best Regards

Marco

luca2125 commented 2 years ago

hi @tianjunwork , @guojiansheng0925 ,

I have added 2 folders on google drive:

  1. Star Trek (with evident stuttering) - that contain another sample with more evident stuttering
  2. video camera - that contain the recording of my TV

Because my camera is low quality I have included another sample.

There is more stuttering in this sample becouse there is a flac track.

In the Flac track there is a 40ms of delay, probably for this reason there is more stuttering.

If I play the equivalent with libx265 there is not stuttering.

Wating for your response and please let me known if need more materials.

Best Regards

Marco

luca2125 commented 2 years ago

Only to let you known I have update about the stuttering on my Blu ray panasonic.

In short the processor on device like mine is slow and need more time to decode video and audio.

For what I have understand my device "stutteing" becouse don't have sufficent time to decode audio and video.

I have do this test: instead of copy the audio I have re-encoded it using: " -codec:a flac -compression_level 1" and the stuttering was reduced.

The flac is the worst case becouse need more time if the compression is high.

I suspect that your codec need more time to decode that while it is not a problem on a modern or old PC , can be a problem on CPU built it a blu ray player or TV (my panasonic BR is a 2017 model so it is now old).

Now I have find a better compromise with libx265 and I use it.

Hope this information can be useful.

Good luck with your codec !

tianjunwork commented 2 years ago

Thank you @luca2125 for the update. Sorry that we can't help much since we don't have a panasonic BR player to debug with. Stuttering issue is either from time stamp error of file container or decoding latency. Thanks for doing the experiments with us.

dpatel257 commented 2 years ago

Closing as we don't have the HW to debug with.