Mailing List Archive

50fps video playback on 30Hz display (4K on HDMI 1.4 output)
Hi,

I noticed that playback of videos with 50fps (for example HD 720p) on a
display using 30 Hz refresh rate does not work (results in slow motion
video with stuttering audio).
I agree that this sounds like something one does not want to achive
anyways, but I recently bought a 4K TV and I am using a mainboard with
only HDMI 1.4 output (Intel Coffee Lake processor with no LSPCon for DP
to HDMI 2.0 conversion), so I'm currently only able to use a maximum of
3840x2160@30 for 4K playback (I'm using VAAPI(2)).

Do you think there would there be an easy way to change mythplayer to
allow playback of videos with higher frame rate than the refresh rate of
the display (maybe using the new avsync2 code - have not tried that
yet), maybe by just dropping video frames if there is another frame that
has to be displayed until the next display refresh occurs?

I'm able to reproduce even with 1920x1080 by switching the display rate
to 30Hz when watching a 50fps video.

I would own a Nvidia GT1030 card as well (which has DP 1.4 and HDMI 2.0
outputs), but currently there is no HEVC Main 10 hardware accelerated
video playback available with Mythtv for Nvidia (VDPAU has no HEVC Main
10 support, currently there is no CUDA/NVDEV support available for
Mythtv, would be harder work to implent this one).

Any ideas, comments welcome ...

Thank you,
Andreas


_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: 50fps video playback on 30Hz display (4K on HDMI 1.4 output) [ In reply to ]
On 10/23/18 1:07 PM, Andreas Mayer wrote:
> Hi,
>
> I noticed that playback of videos with 50fps (for example HD 720p) on
> a display using 30 Hz refresh rate does not work (results in slow
> motion video with stuttering audio).
> I agree that this sounds like something one does not want to achive
> anyways, but I recently bought a 4K TV and I am using a mainboard with
> only HDMI 1.4 output (Intel Coffee Lake processor with no LSPCon for
> DP to HDMI 2.0 conversion), so I'm currently only able to use a
> maximum of 3840x2160@30 for 4K playback (I'm using VAAPI(2)).
>
> Do you think there would there be an easy way to change mythplayer to
> allow playback of videos with higher frame rate than the refresh rate
> of the display (maybe using the new avsync2 code - have not tried that
> yet), maybe by just dropping video frames if there is another frame
> that has to be displayed until the next display refresh occurs?
>
> I'm able to reproduce even with 1920x1080 by switching the display
> rate to 30Hz when watching a 50fps video.
>
> I would own a Nvidia GT1030 card as well (which has DP 1.4 and HDMI
> 2.0 outputs), but currently there is no HEVC Main 10 hardware
> accelerated video playback available with Mythtv for Nvidia (VDPAU has
> no HEVC Main 10 support, currently there is no CUDA/NVDEV support
> available for Mythtv, would be harder work to implent this one).
>
> Any ideas, comments welcome ...
>
> Thank you,
> Andreas
>
>

I set my 4K monitor to refresh rate 30 and played a 60 fps 720p video.
(I don't know if I have any 50 fps videos). The result is awful. There
was no audio problem but the picture was alternately slowing and jumping
ahead. I would get a headache very soon from watching that.  How has
nobody noticed this before?

I tried vaapi2 and opengl slim for playback profile. Both acted the same
way. This is not likely to be affected by the playback profile anyway.

With avsync2 it is almost perfect. Not as good as having the monitor at
refresh rate 60 but perfectly acceptable.

My suggestion is try to get the monitor to refresh rate 50 or 60, or use
avsync2 (or both). This is the best example of improvement with aysync2
I have seen.

You could change your monitor to run at 1920x1080 at 60fps.

I am using Display Port for the monitor to get refresh rate 60.

You can get HEVC accelerated video with vaapi2, if you use the intel
display rather than the nvidia. 10bit does not seem to work, at least
with my system.

I asked in the developer's irc about adding CUDA/NVDEV support to MythTV
and the response was not enthusiastic so I put it on the back burner.
People said they want their VDPAU.

Peter

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: 50fps video playback on 30Hz display (4K on HDMI 1.4 output) [ In reply to ]
On Wed, Oct 24, 2018 at 6:17 PM Peter Bennett <pb.mythtv@gmail.com> wrote:

> I asked in the developer's irc about adding CUDA/NVDEV support to MythTV
> and the response was not enthusiastic so I put it on the back burner.
> People said they want their VDPAU.

I think one issue is NVDEC does not support older nVidia GPUs
(kepler and newer required) in addition to only supporting the
proprietary driver. It is also the only (documented as supported)
solution for some next-gen nVidia GPUs (VDPAU has been on
life support in Linux for a while now with nVidia stating at some
point it will stop working with their newer drivers/GPUs and to
get your act together and support NVDEC (which projects such
as FFMpeg did) [nvidia stated it nicer, but that was the essence]).

No need today, but need tomorrow (and likely today for anyone
sporting a RTX2xxx GPU).
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: 50fps video playback on 30Hz display (4K on HDMI 1.4 output) [ In reply to ]
On 10/24/18 2:51 PM, Gary Buhrmaster wrote:
> I think one issue is NVDEC does not support older nVidia GPUs
> (kepler and newer required) in addition to only supporting the
> proprietary driver. It is also the only (documented as supported)
> solution for some next-gen nVidia GPUs (VDPAU has been on
> life support in Linux for a while now with nVidia stating at some
> point it will stop working with their newer drivers/GPUs and to
> get your act together and support NVDEC (which projects such
> as FFMpeg did) [nvidia stated it nicer, but that was the essence]).
Gary

I thought so too. I have a GT210 card which is about the oldest cheapest
Nvidia card and I ran a test with ffmpeg to decode with h264-cuvid, and
it worked. I think maybe the chart on the NVidia site does not show it
on the list because the chart is incomplete, not because it does not work?

Peter
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: 50fps video playback on 30Hz display (4K on HDMI 1.4 output) [ In reply to ]
On Wed, Oct 24, 2018 at 7:56 PM Peter Bennett <pb.mythtv@gmail.com> wrote:

> I thought so too. I have a GT210 card which is about the oldest cheapest
> Nvidia card and I ran a test with ffmpeg to decode with h264-cuvid, and
> it worked. I think maybe the chart on the NVidia site does not show it
> on the list because the chart is incomplete, not because it does not work?

Pretty sure the GT210 uses a legacy driver, which nvidia has
said is (at best) minimally supported, and may not continue
to work with all (any) new features/functions/capabilities, and
they certainly do not document its compatibility (if any). They
would, of course, prefer you bought something from this decade.
That it works is interesting, but unlikely to be something to
depend on.
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: 50fps video playback on 30Hz display (4K on HDMI 1.4 output) [ In reply to ]
On Wed, Oct 24, 2018 at 6:17 PM Peter Bennett <pb.mythtv at gmail.com
<http://lists.mythtv.org/mailman/listinfo/mythtv-dev>> wrote:

> With avsync2 it is almost perfect. Not as good as having the monitor at
> refresh rate 60 but perfectly acceptable.
avsync2 works well, but there are a couple of HD channels on Astra 19.2E
(720p, ARD, ZDF) where the prebuffer pause does not work anymore when
using VAAPI with avsync2 (works with VAAPI2/avsync2 and with
VAAPI/without avsync2), video is not able to catch up even if dropping
video frames all the time, audio is running with video still picture
until I'm pressing pause/unpause, after doing this both audio and video
are fine.
I would like use VAAPI2 with avsync2 for all channels but it looks like
VAAPI2 is needing more CPU resources than VAAPI at least for HEVC 2160p
(Astra UHD demo channel) decoding, VAAPI is able to keep up without
frame drops (at least on a display with 1920x1080@60, I think it would
not be worse on a 3840x2160@30 display).
I tried to create a video playback profile with VAAPI for HEVC and
VAAPI2 for anything else (and avsync2), but it looks like changing
between those decoders does not work when switching between channels.

> My suggestion is try to get the monitor to refresh rate 50 or 60, or use
> avsync2 (or both). This is the best example of improvement with aysync2
> I have seen.
Yes, I would prefer that too, but currently I have only a mainboard
(with a Coffee Lake processor) available with HDMI 1.4 (which is limited
to 3840x2160@30, DP would be able to use 3840x2160@60).
The other mainboard would have a DP (1.2?) output, but on this mainboard
there is a Skylake processor installed, which is not able to decode HEVC
main 10 profile (would need to buy a Kaby Lake for this mainboard to get
HEVC main 10 decoding support).
And as far as I know there currently is no mainboard available with DP
1.4 and/or HDMI 2.0b (even with Intel UHD grapics 630 processors) dor HDR.

> You could change your monitor to run at 1920x1080 at 60fps.
> I am using Display Port for the monitor to get refresh rate 60.
I'm after using 4K (at least as soon as there are more channels
available), so using 1920x1080@60 is not an option for the future (this
is what I'm currently using).

> You can get HEVC accelerated video with vaapi2, if you use the intel
> display rather than the nvidia. 10bit does not seem to work, at least
> with my system.
You need to have at least a Kaby Lake processor to get HEVC main 10
decoding support.

> I asked in the developer's irc about adding CUDA/NVDEV support to MythTV
> and the response was not enthusiastic so I put it on the back burner.
> People said they want their VDPAU.
As far as I know VDPAU will probably never be able to provide HEVC main
10 decoding support because of architectural limitations.

Thank you,
Andreas
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: 50fps video playback on 30Hz display (4K on HDMI 1.4 output) [ In reply to ]
On 10/30/18 11:42 AM, Andreas Mayer wrote:
> avsync2 works well, but there are a couple of HD channels on Astra
> 19.2E (720p, ARD, ZDF) where the prebuffer pause does not work anymore
> when using VAAPI with avsync2 (works with VAAPI2/avsync2 and with
> VAAPI/without avsync2), video is not able to catch up even if dropping
> video frames all the time, audio is running with video still picture
> until I'm pressing pause/unpause, after doing this both audio and
> video are fine.
> I would like use VAAPI2 with avsync2 for all channels but it looks
> like VAAPI2 is needing more CPU resources than VAAPI at least for HEVC
> 2160p (Astra UHD demo channel) decoding, VAAPI is able to keep up
> without frame drops (at least on a display with 1920x1080@60, I think
> it would not be worse on a 3840x2160@30 display).
> I tried to create a video playback profile with VAAPI for HEVC and
> VAAPI2 for anything else (and avsync2), but it looks like changing
> between those decoders does not work when switching between channels.
I have added some checkboxes in the video playback advanced settings to
disable certain pixel types. You can try disabling one or both of those
to see if the results are any better. These are mainly useful for
android and low powered systems but they may make a difference.

Please can you supply a sample video to test VAAPI and VAAPI2 issues. I
will see if there is a way to improve the CPU requirements so that
vaapi2 and avsync2 give a good result.

Peter
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: 50fps video playback on 30Hz display (4K on HDMI 1.4 output) [ In reply to ]
On/Tue Oct 30 16:19:39 UTC 2018/ Peter Bennett <pb.mythtv at gmail.com <http://lists.mythtv.org/mailman/listinfo/mythtv-dev>> wrote:

> I have added some checkboxes in the video playback advanced settings to
> disable certain pixel types. You can try disabling one or both of those
> to see if the results are any better. These are mainly useful for
> android and low powered systems but they may make a difference.
Disabling YV12(YUV 4:2:0) and UYVY(YUV 4:2:2) pixel format did not make
any difference for VAAPI2.

> Please can you supply a sample video to test VAAPI and VAAPI2 issues. I
> will see if there is a way to improve the CPU requirements so that
> vaapi2 and avsync2 give a good result.
Will send PM ...

mythffmpeg -i hevc_test.ts
Input #0, mpegts, from 'hevc_test.ts':
        Duration: 00:02:47.65, start: 44350.528844, bitrate: 4602 kb/s
        Stream #0:0[0x1ff]: Video: hevc (Main 10), yuv420p10le(tv,
bt2020nc/bt2020/arib-std-b67), 3840x2160 [SAR 1:1 DAR 16:9], 50 fps, 50
tbr, 90k tbn, 50 tbc
        Stream #0:1[0x200](DEU): Audio: aac (LC), 48000 Hz, stereo,
fltp, 192 kb/s

I'm using a playback profile with filters, OSD fading and deinterlacing
disabled, avsync2 enabled and mythavtest for playback (on a 1920x1080@50
display)

With VAAPI video and audio looks OK (although with -v playback you can
see frames being dropped), intel_gpu_top shows 90-98%
With VAAPI2 only a few video frames are shown every few seconds,
intel_gpu_top shows low gpu utilization.

Thank you,
Andreas

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: 50fps video playback on 30Hz display (4K on HDMI 1.4 output) [ In reply to ]
On 10/30/18 5:53 PM, Andreas Mayer wrote:
> On/Tue Oct 30 16:19:39 UTC 2018/  Peter Bennett <pb.mythtv at
> gmail.com <http://lists.mythtv.org/mailman/listinfo/mythtv-dev>> wrote:
>> I have added some checkboxes in the video playback advanced settings to
>> disable certain pixel types. You can try disabling one or both of those
>> to see if the results are any better. These are mainly useful for
>> android and low powered systems but they may make a difference.
> Disabling YV12(YUV 4:2:0) and UYVY(YUV 4:2:2) pixel format did not
> make any difference for VAAPI2.
>
>> Please can you supply a sample video to test VAAPI and VAAPI2 issues. I
>> will see if there is a way to improve the CPU requirements so that
>> vaapi2 and avsync2 give a good result.
> Will send PM ...
>
> mythffmpeg -i hevc_test.ts
> Input #0, mpegts, from 'hevc_test.ts':
>         Duration: 00:02:47.65, start: 44350.528844, bitrate: 4602 kb/s
>         Stream #0:0[0x1ff]: Video: hevc (Main 10), yuv420p10le(tv,
> bt2020nc/bt2020/arib-std-b67), 3840x2160 [SAR 1:1 DAR 16:9], 50 fps,
> 50 tbr, 90k tbn, 50 tbc
>         Stream #0:1[0x200](DEU): Audio: aac (LC), 48000 Hz, stereo,
> fltp, 192 kb/s
>
> I'm using a playback profile with filters, OSD fading and
> deinterlacing disabled, avsync2 enabled and mythavtest for playback
> (on a 1920x1080@50 display)
>
> With VAAPI video and audio looks OK (although with -v playback you can
> see frames being dropped), intel_gpu_top shows 90-98%
> With VAAPI2 only a few video frames are shown every few seconds,
> intel_gpu_top shows low gpu utilization.
>
> Thank you,
> Andreas
>
> _______________________________________________
> mythtv-dev mailing list
> mythtv-dev@mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-dev
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org

I tried your sample video and I see the same thing. VAAPI2 performs very
poorly. In fact, it plays way better using software decoding (opengl
slim with number of cpus increased to 4). Something strange is happening
with VAAPI2. I will look into that.

Another thing is that probably MythTV is losing some color information.
It is converting 10 bit color to 8 bit color. There needs to be some
change in the OpenGL codes that displays it, to support the 10 bit
color. I believe I can see a difference in colors between playing the
video with VLC and playing it with MythTV. I don't know what it takes to
support 10bit color with openGL.

Peter


_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: 50fps video playback on 30Hz display (4K on HDMI 1.4 output) [ In reply to ]
On Wed, 31 Oct 2018 15:26:46, Peter Bennet wrote:

> I tried your sample video and I see the same thing. VAAPI2 performs very
> poorly. In fact, it plays way better using software decoding (opengl
> slim with number of cpus increased to 4). Something strange is happening
> with VAAPI2. I will look into that.

I tried your last commit (ticket 13345) today and the results for VAAPI2 are much better than before (but still worse than for VAAPI)
I'm using a Gigabyte Z370M-D3H mainboard with a i3-8100 quad core processor and 8GB memory for testing.

VAAPI2:
top: mythfrontend 80%
intel_gpu_top: render busy 50%, GAM 75%, CS 50%, TSG 40%, VFE 35%, GAFS 20%

VAAPI:
top: mythfrontend 45%
intel_gpu_top: render busy 90%, GAM 97%, CS 90%, GAFS 12%

> Another thing is that probably MythTV is losing some color information.
> It is converting 10 bit color to 8 bit color. There needs to be some
> change in the OpenGL codes that displays it, to support the 10 bit
> color. I believe I can see a difference in colors between playing the
> video with VLC and playing it with MythTV. I don't know what it takes to
> support 10bit color with openGL.
I'm still unsure if the Intel driver for Linux currently supports 10bpc, although it looks like there are some changes in Mesa to support 10bpc.
https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/deep-color-support-graphics-paper.pdf
https://www.phoronix.com/scan.php?page=news_item&px=Mesa-Lands-10-bit-Color
Until now I was not able to get an Opengl test program working with 10bpc.
Gigabyte mainboard with i3-8100 has only HDMI 1.4 output (limited to 4K@30), my LG TV supports "HDMI UHD Deep Color" only at 4k@50-60 with YCbCr 4:2:0 or 4:2:2)
Tried an Asus mainboard with i5-6600 (no HEVC main 10 decoding) and external DP to HDMI 2.0b converter and Nvidia GT 1030(Pascal) card installed (DP 1.4 and HDMI 2.0b output, no Linux VDPAU decoding support for HEVC main 10), but had no success until now.
https://www.nvidia.com/docs/IO/40049/TB-04701-001_v02_new.pdf

Thank you,
Andreas

_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: 50fps video playback on 30Hz display (4K on HDMI 1.4 output) [ In reply to ]
On 11/6/18 4:25 PM, Andreas Mayer wrote:
> On Wed, 31 Oct 2018 15:26:46, Peter Bennet wrote:
>
>> I tried your sample video and I see the same thing. VAAPI2 performs
>> very poorly. In fact, it plays way better using software decoding
>> (opengl slim with number of cpus increased to 4). Something strange
>> is happening with VAAPI2. I will look into that.
>
> I tried your last commit (ticket 13345) today and the results for
> VAAPI2 are much better than before (but still worse than for VAAPI)
> I'm using a Gigabyte Z370M-D3H mainboard with a i3-8100 quad core
> processor and 8GB memory for testing.
>
> VAAPI2:
> top: mythfrontend 80%
> intel_gpu_top: render busy 50%, GAM 75%, CS 50%, TSG 40%, VFE 35%,
> GAFS 20%
>
> VAAPI:
> top: mythfrontend 45%
> intel_gpu_top: render busy 90%, GAM 97%, CS 90%, GAFS 12%
>
>> Another thing is that probably MythTV is losing some color
>> information. It is converting 10 bit color to 8 bit color. There
>> needs to be some change in the OpenGL codes that displays it, to
>> support the 10 bit color. I believe I can see a difference in colors
>> between playing the video with VLC and playing it with MythTV. I
>> don't know what it takes to support 10bit color with openGL.
> I'm still unsure if the Intel driver for Linux currently supports
> 10bpc, although it looks like there are some changes in Mesa to
> support 10bpc.
> https://www.intel.com/content/dam/www/public/us/en/documents/white-papers/deep-color-support-graphics-paper.pdf
>
> https://www.phoronix.com/scan.php?page=news_item&px=Mesa-Lands-10-bit-Color
>
> Until now I was not able to get an Opengl test program working with
> 10bpc.
> Gigabyte mainboard with i3-8100 has only HDMI 1.4 output (limited to
> 4K@30), my LG TV supports "HDMI UHD Deep Color" only at 4k@50-60 with
> YCbCr 4:2:0 or 4:2:2)
> Tried an Asus mainboard with i5-6600 (no HEVC main 10 decoding) and
> external DP to HDMI 2.0b converter and Nvidia GT 1030(Pascal) card
> installed (DP 1.4 and HDMI 2.0b output, no Linux VDPAU decoding
> support for HEVC main 10), but had no success until now.
> https://www.nvidia.com/docs/IO/40049/TB-04701-001_v02_new.pdf
>
> Thank you,
> Andreas
>
I have another change that I am testing, which provides further
improvement. At last, with this change I can play your sample on my
laptop and the video keeps up with the audio, there is no stuttering.
VAAPI2 is still using more CPU than VAAPI, but with baby steps I am
getting closer. I will commit this one after doing some more testing to
make sure it does not break anything.

Peter
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-dev
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org