Mailing List Archive

HEVC/H.265 playback
Hi,

I briefly did some experimenting with transcoding recordings using
libx265+ffmpeg in an mpegts container.

While the transcoding was fine and playback is fine over my lan using
ffplay on my (old, slow) laptop, on my dedicated frontend only cartoons
playback ok; other transcoded recordings have a lot of stutter and are
unwatchable. I will guess that this is because the dedicated frontend is
about 8 years old and has a slower cpu [*,**].

I wonder if anyone has experience in these matters? Would a graphics
card be an option (the frontend has a couple low profile pci-e slots
available)? I am using ubuntu 20.04 and v0.31/fixes from the mythbuntu
ppa, if that matters.

TIA,
Leo

[*] laptop$ cat /proc/cpuinfo
processor : 0
vendor_id : GenuineIntel
cpu family : 6
model : 37
model name : Intel(R) Core(TM) i7 CPU L 620 @ 2.00GHz
stepping : 2
microcode : 0x9
cpu MHz : 2516.729
cache size : 4096 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 2
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 11
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ht tm pbe syscall nx rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 popcnt aes lahf_lm pti tpr_shadow vnmi flexpriority ept vpid dtherm ida arat
vmx flags : vnmi preemption_timer invvpid ept_x_only flexpriority tsc_offset vtpr mtf vapic ept vpid unrestricted_guest
bugs : cpu_meltdown spectre_v1 spectre_v2 spec_store_bypass l1tf mds swapgs itlb_multihit
bogomips : 3989.72
clflush size : 64
cache_alignment : 64
address sizes : 36 bits physical, 48 bits virtual
power management:

[**] frontend$ cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 18
model : 1
model name : AMD A8-3870 APU with Radeon(tm) HD Graphics
stepping : 0
microcode : 0x3000027
cpu MHz : 803.502
cache size : 1024 KB
physical id : 0
siblings : 4
core id : 0
cpu cores : 4
apicid : 0
initial apicid : 0
fpu : yes
fpu_exception : yes
cpuid level : 6
wp : yes
flags : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ht syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm 3dnowext 3dnow constant_tsc rep_good nopl nonstop_tsc cpuid extd_apicid aperfmperf pni monitor cx16 popcnt lahf_lm cmp_legacy svm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw ibs skinit wdt hw_pstate vmmcall arat npt lbrv svm_lock nrip_save pausefilter
bugs : fxsave_leak sysret_ss_attrs null_seg spectre_v1 spectre_v2
bogomips : 6000.00
TLB size : 1536 4K pages
clflush size : 64
cache_alignment : 64
address sizes : 40 bits physical, 48 bits virtual
power management: ts ttp tm stc 100mhzsteps hwpstate
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: HEVC/H.265 playback [ In reply to ]
On Wed, 21 Apr 2021 11:45:27 -0500, you wrote:

>Hi,
>
>I briefly did some experimenting with transcoding recordings using
>libx265+ffmpeg in an mpegts container.
>
>While the transcoding was fine and playback is fine over my lan using
>ffplay on my (old, slow) laptop, on my dedicated frontend only cartoons
>playback ok; other transcoded recordings have a lot of stutter and are
>unwatchable. I will guess that this is because the dedicated frontend is
>about 8 years old and has a slower cpu [*,**].
>
>I wonder if anyone has experience in these matters? Would a graphics
>card be an option (the frontend has a couple low profile pci-e slots
>available)? I am using ubuntu 20.04 and v0.31/fixes from the mythbuntu
>ppa, if that matters.
>
>TIA,
>Leo

Playing H.265 using just the CPU takes a lot of CPU, and I suspect
that it needs to be mostly one core only doing the work. I had
similar problems to yours with my main MythTV box which was using an
Nvidia GT220 card, which is far too old to do H.265. After I upgraded
it to an Nvidia GT1030 which has native H.265 support, and also
upgraded MythTV to v31 which has the big rendering changes that
brought support for H.265 offloading to the GPU, I have no problems
with H.265 videos. And also as a bonus I found that playing 4K video
in H.264 and H.265 worked on my 1080p only screen - the GPU seems to
be doing the downscaling.

Depending on how old the frontend box is, it is likely to be only PCIe
2.0 or 2.1. Pretty much all modern graphics cards are now PCIe 3.0
(or better). The low end ones are typically PCIe 3.0 x4, even though
they still are built for a x16 socket. They just do not use the other
12 PCIe lanes - the pins are not connected. A rare exception is an
EVG card with an Nvidia GT1030 that I bought which uses a x4 socket
for its x4 connection, and can be used in any x16, x8 or x4 socket.

This has come about because with PCIe 3.0, a 4 lane (x4) connection is
fast enough to max out the transfer rate of the GPU. But if you plug
these cards into a PCIe 2.0 or 2.1 motherboard, since they have only 4
lanes, they can not max out their transfer rate at PCIe 2.0 or 2.1
speeds and so potentially will not perform as well as an older
graphics card that is PCIe 2.1 x16 and uses all 16 lanes. This only
matters for things other than MythTV though - heavy graphics programs
and games where there is a huge amount of data being sent to the GPU.
For MythTV where the rendering is being offloaded onto the GPU, the
data transfer rate is very low - the same rate as the video stream in
the recording or video file.

So, for upgrading your frontend, as long as it is not being used for
other graphics intensive things as well, I would recommend the
cheapest modern Nvidia card, a GT1030 model. There are several that
are fanless which is a bonus as they will last forever - I have yet to
have any fanless Nvidia card die. Cards with fans usually die much
earlier when the fan(s) fail. The downside of the GT1030 is that its
4K support is limited, but they are reasonably cheap. There is likely
a similar spec Radeon card available also, but I have never used
Radeons so I do not know anything about their current range.

The Asus and EVGA silent GT1030 cards I have all came with an low
profile bracket in the box.
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: HEVC/H.265 playback [ In reply to ]
Stephen Worthington <stephen_agent@jsw.gen.nz> writes:

> On Wed, 21 Apr 2021 11:45:27 -0500, you wrote:
>
>>Hi,
>>
>>I briefly did some experimenting with transcoding recordings using
>>libx265+ffmpeg in an mpegts container.
>>
>>While the transcoding was fine and playback is fine over my lan using
>>ffplay on my (old, slow) laptop, on my dedicated frontend only cartoons
>>playback ok; other transcoded recordings have a lot of stutter and are
>>unwatchable. I will guess that this is because the dedicated frontend is
>>about 8 years old and has a slower cpu [*,**].
>>
>>I wonder if anyone has experience in these matters? Would a graphics
>>card be an option (the frontend has a couple low profile pci-e slots
>>available)? I am using ubuntu 20.04 and v0.31/fixes from the mythbuntu
>>ppa, if that matters.
>>
>>TIA,
>>Leo
>
> Playing H.265 using just the CPU takes a lot of CPU, and I suspect
> that it needs to be mostly one core only doing the work. I had
> similar problems to yours with my main MythTV box which was using an
> Nvidia GT220 card, which is far too old to do H.265. After I upgraded
> it to an Nvidia GT1030 which has native H.265 support, and also
> upgraded MythTV to v31 which has the big rendering changes that
> brought support for H.265 offloading to the GPU, I have no problems
> with H.265 videos. And also as a bonus I found that playing 4K video
> in H.264 and H.265 worked on my 1080p only screen - the GPU seems to
> be doing the downscaling.
>
> Depending on how old the frontend box is, it is likely to be only PCIe
> 2.0 or 2.1. Pretty much all modern graphics cards are now PCIe 3.0
> (or better). The low end ones are typically PCIe 3.0 x4, even though
> they still are built for a x16 socket. They just do not use the other
> 12 PCIe lanes - the pins are not connected. A rare exception is an
> EVG card with an Nvidia GT1030 that I bought which uses a x4 socket
> for its x4 connection, and can be used in any x16, x8 or x4 socket.
>
> This has come about because with PCIe 3.0, a 4 lane (x4) connection is
> fast enough to max out the transfer rate of the GPU. But if you plug
> these cards into a PCIe 2.0 or 2.1 motherboard, since they have only 4
> lanes, they can not max out their transfer rate at PCIe 2.0 or 2.1
> speeds and so potentially will not perform as well as an older
> graphics card that is PCIe 2.1 x16 and uses all 16 lanes. This only
> matters for things other than MythTV though - heavy graphics programs
> and games where there is a huge amount of data being sent to the GPU.
> For MythTV where the rendering is being offloaded onto the GPU, the
> data transfer rate is very low - the same rate as the video stream in
> the recording or video file.
>
> So, for upgrading your frontend, as long as it is not being used for
> other graphics intensive things as well, I would recommend the
> cheapest modern Nvidia card, a GT1030 model. There are several that
> are fanless which is a bonus as they will last forever - I have yet to
> have any fanless Nvidia card die. Cards with fans usually die much
> earlier when the fan(s) fail. The downside of the GT1030 is that its
> 4K support is limited, but they are reasonably cheap. There is likely
> a similar spec Radeon card available also, but I have never used
> Radeons so I do not know anything about their current range.
>
> The Asus and EVGA silent GT1030 cards I have all came with an low
> profile bracket in the box.

Thank you, Stephen. I'll see how that Asus GT1030 card works out.

Leo
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: HEVC/H.265 playback [ In reply to ]
On 21/04/2021 17:45, Leo Butler via mythtv-users wrote:
> Hi,
>
> I briefly did some experimenting with transcoding recordings using
> libx265+ffmpeg in an mpegts container.
>
> While the transcoding was fine and playback is fine over my lan using
> ffplay on my (old, slow) laptop, on my dedicated frontend only cartoons
> playback ok; other transcoded recordings have a lot of stutter and are
> unwatchable. I will guess that this is because the dedicated frontend is
> about 8 years old and has a slower cpu [*,**].
>
> I wonder if anyone has experience in these matters? Would a graphics
> card be an option (the frontend has a couple low profile pci-e slots
> available)? I am using ubuntu 20.04 and v0.31/fixes from the mythbuntu
> ppa, if that matters.
>

Try transcoding to a format your existing hardware can accelerate.

You didn't say what graphics card / video playback profile you are
using. You will need to look at that first, to determine
"what formats" it'll support.

Given you are speculating about adding a graphics card, then I would
hazard a guess you have an embedded intel gpu. So try running `vainfo`

Regards
Stuart

_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: HEVC/H.265 playback [ In reply to ]
Am Sonntag, 25. April 2021, 11:15:14 CEST schrieb Stuart Auchterlonie:
> On 21/04/2021 17:45, Leo Butler via mythtv-users wrote:
> Given you are speculating about adding a graphics card, then I would
> hazard a guess you have an embedded intel gpu. So try running `vainfo`

Maybe I can jump in here and get some info for a similar problem. I have my
videos in H265 in mkv container. It works but sometimes (especially in fast
scenes) it stutters for some seconds.

vainfo says: VAProfileHEVCMain : VAEntrypointVLD

I guess I maybe can get rid of this by increasing the buffer a bit to get a
stable stream. Can this be done somewhere in the config, or is it hardcoded?

--
MfG usw.

Werner Mahr


_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: HEVC/H.265 playback [ In reply to ]
Stuart Auchterlonie <stuarta@squashedfrog.net> writes:

> On 21/04/2021 17:45, Leo Butler via mythtv-users wrote:
>> Hi,
>> I briefly did some experimenting with transcoding recordings using
>> libx265+ffmpeg in an mpegts container.
>> While the transcoding was fine and playback is fine over my lan
>> using
>> ffplay on my (old, slow) laptop, on my dedicated frontend only cartoons
>> playback ok; other transcoded recordings have a lot of stutter and are
>> unwatchable. I will guess that this is because the dedicated frontend is
>> about 8 years old and has a slower cpu [*,**].
>> I wonder if anyone has experience in these matters? Would a graphics
>> card be an option (the frontend has a couple low profile pci-e slots
>> available)? I am using ubuntu 20.04 and v0.31/fixes from the mythbuntu
>> ppa, if that matters.
>>
>
> Try transcoding to a format your existing hardware can accelerate.

Yes, I currently transcode to h264.

>
> You didn't say what graphics card / video playback profile you are
> using. You will need to look at that first, to determine
> "what formats" it'll support.
>
> Given you are speculating about adding a graphics card, then I would
> hazard a guess you have an embedded intel gpu. So try running `vainfo`

Thanks for the suggestion. You are right, I do not have a graphics card
installed at the moment. My current hardware gives:

# vainfo
error: XDG_RUNTIME_DIR not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.7.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/r600_drv_video.so
libva info: Found init function __vaDriverInit_1_7
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.7 (libva 2.6.0)
vainfo: Driver version: Mesa Gallium driver 20.2.6 for AMD SUMO (DRM 2.50.0 / 5.4.0-72-generic, LLVM 11.0.0)
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
#

Leo
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: HEVC/H.265 playback [ In reply to ]
On 26/04/2021 20:52, Leo Butler wrote:
> Stuart Auchterlonie <stuarta@squashedfrog.net> writes:
>
>> On 21/04/2021 17:45, Leo Butler via mythtv-users wrote:
>>> Hi,
>>> I briefly did some experimenting with transcoding recordings using
>>> libx265+ffmpeg in an mpegts container.
>>> While the transcoding was fine and playback is fine over my lan
>>> using
>>> ffplay on my (old, slow) laptop, on my dedicated frontend only cartoons
>>> playback ok; other transcoded recordings have a lot of stutter and are
>>> unwatchable. I will guess that this is because the dedicated frontend is
>>> about 8 years old and has a slower cpu [*,**].
>>> I wonder if anyone has experience in these matters? Would a graphics
>>> card be an option (the frontend has a couple low profile pci-e slots
>>> available)? I am using ubuntu 20.04 and v0.31/fixes from the mythbuntu
>>> ppa, if that matters.
>>>
>>
>> Try transcoding to a format your existing hardware can accelerate.
>
> Yes, I currently transcode to h264.
>
>>
>> You didn't say what graphics card / video playback profile you are
>> using. You will need to look at that first, to determine
>> "what formats" it'll support.
>>
>> Given you are speculating about adding a graphics card, then I would
>> hazard a guess you have an embedded intel gpu. So try running `vainfo`
>
> Thanks for the suggestion. You are right, I do not have a graphics card
> installed at the moment. My current hardware gives:
>
> # vainfo
> error: XDG_RUNTIME_DIR not set in the environment.
> error: can't connect to X server!
> libva info: VA-API version 1.7.0
> libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/r600_drv_video.so
> libva info: Found init function __vaDriverInit_1_7
> libva info: va_openDriver() returns 0
> vainfo: VA-API version: 1.7 (libva 2.6.0)
> vainfo: Driver version: Mesa Gallium driver 20.2.6 for AMD SUMO (DRM 2.50.0 / 5.4.0-72-generic, LLVM 11.0.0)
> vainfo: Supported profile and entrypoints
> VAProfileMPEG2Simple : VAEntrypointVLD
> VAProfileMPEG2Main : VAEntrypointVLD
> VAProfileVC1Simple : VAEntrypointVLD
> VAProfileVC1Main : VAEntrypointVLD
> VAProfileVC1Advanced : VAEntrypointVLD
> VAProfileH264ConstrainedBaseline: VAEntrypointVLD
> VAProfileH264Main : VAEntrypointVLD
> VAProfileH264High : VAEntrypointVLD
> VAProfileNone : VAEntrypointVideoProc
> #
>
> Leo
>

So I was nearly correct, it's an AMD GPU exposed via vaapi.

That hardware has zero support for h265, so stick with h264 format
and use the hardware acceleration via VAAPI, if you want to achieve
decent playback without needing to add a video card.


Regards
Stuart

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