Mailing List Archive

Recording from HDMI
Dear mythizens,

I have just created a new page on the wiki on the subject of recording
from HDMI. It is a case study of how I have gone about this, and not so
much a how-to (although you are of course welcome to regard it as such).

https://www.mythtv.org/wiki/Recording_from_HDMI

The article discusses other topics as well, such as infrared channel
changing and the use of system events.

Hope this helps.

Cheers, Jan
_______________________________________________
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: Recording from HDMI [ In reply to ]
On 18/02/2023 09:25, Jan Ceuleers wrote:

> Dear mythizens,
>
> I have just created a new page on the wiki on the subject of recording
> from HDMI. It is a case study of how I have gone about this, and not so
> much a how-to (although you are of course welcome to regard it as such).
>
> https://www.mythtv.org/wiki/Recording_from_HDMI
>
> The article discusses other topics as well, such as infrared channel
> changing and the use of system events.
>
> Hope this helps.
>
> Cheers, Jan


What sort of delay does this device introduce? For example if you change
channel on the device you are recording how long of a delay is there
before you see the change? I'm talking about when you use something like
ffplay or vlc to view the raw output from the device not when used with
MythTV.


Paul H.

_______________________________________________
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: Recording from HDMI [ In reply to ]
On 21/02/2023 16:51, Paul Harrison wrote:
> What sort of delay does this device introduce? For example if you change
> channel on the device you are recording how long of a delay is there
> before you see the change? I'm talking about when you use something like
> ffplay or vlc to view the raw output from the device not when used with
> MythTV.

A few weeks ago I was watching TV using a set-top box while also
watching the same channel (using MythTV's live TV functionality) on my
laptop. The time lag was below 2 seconds.

However there is still an artefact I'm trying to fix, which is that
audio is delayed by a few hundred milliseconds relative to video. I've
asked the ffmpeg mailing list for how to delay the audio track of an
incoming stream (as opposed to delaying the audio track of a video file).

HTH, Jan
_______________________________________________
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: Recording from HDMI [ In reply to ]
On 22/02/2023 16:34, Jan Ceuleers wrote:
> On 21/02/2023 16:51, Paul Harrison wrote:
>> What sort of delay does this device introduce? For example if you change
>> channel on the device you are recording how long of a delay is there
>> before you see the change? I'm talking about when you use something like
>> ffplay or vlc to view the raw output from the device not when used with
>> MythTV.
>
> A few weeks ago I was watching TV using a set-top box while also
> watching the same channel (using MythTV's live TV functionality) on my
> laptop. The time lag was below 2 seconds.
>
> However there is still an artefact I'm trying to fix, which is that
> audio is delayed by a few hundred milliseconds relative to video. I've
> asked the ffmpeg mailing list for how to delay the audio track of an
> incoming stream (as opposed to delaying the audio track of a video file).
>
Don't forget that most STBs, like mine, are probably DVRs anyway. Mine has an SSD and actually
records as it displays, which means we have pause/rewind/playback functions built in - which is
exactly the same as mythtv's live TV function.

To get a true idea of any delay introduced by using mythtv, you'd have to compare it with reception
directly by a TV[1] which restricts you to OTA[2] or possibly satellite[3], but would provide a
baseline.

[1] Assuming that your TV is basic enough that it just displays what comes down the wire. Modern
ones may do so much processing on the feed that the whole 'delay' business becomes moot.

[2] I have done tests with our STB, tuned to a BBC radio channel, and a straight FM radio. The delay
introduced is noticeable and maybe four seconds or so. The Greenwich time pips can no longer be
considered reliable.

[3] Satellite of course involves a base -> satellite -> dish delay before any post-processing.

--

Mike Perkins


_______________________________________________
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: Recording from HDMI [ In reply to ]
On 22/02/2023 17:51, Mike Perkins wrote:
> Don't forget that most STBs, like mine, are probably DVRs anyway. Mine
> has an SSD and actually records as it displays, which means we have
> pause/rewind/playback functions built in - which is exactly the same as
> mythtv's live TV function.
>
> To get a true idea of any delay introduced by using mythtv, you'd have
> to compare it with reception directly by a TV[1] which restricts you to
> OTA[2] or possibly satellite[3], but would provide a baseline.

The test I described used identical STBs both for watching the TV feed
in real time and for MythTV's Live TV function. Whether these identical
STBs support DVR functionality or not is neither here nor there, but as
it happens they do not.

But as it happens I also know the group delay we experience on the BBC
channels: comparing the BBC Breakfast clock to a DCF-77 clock I have
within view reveals that the BBC signal is delayed by 13 seconds on its
way to the land of Belgium that is so far, far away.

Cheers, Jan
_______________________________________________
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: Recording from HDMI [ In reply to ]
On 22/02/2023 17:20, Jan Ceuleers wrote:

> On 22/02/2023 17:51, Mike Perkins wrote:
>> Don't forget that most STBs, like mine, are probably DVRs anyway. Mine
>> has an SSD and actually records as it displays, which means we have
>> pause/rewind/playback functions built in - which is exactly the same as
>> mythtv's live TV function.
>>
>> To get a true idea of any delay introduced by using mythtv, you'd have
>> to compare it with reception directly by a TV[1] which restricts you to
>> OTA[2] or possibly satellite[3], but would provide a baseline.
> The test I described used identical STBs both for watching the TV feed
> in real time and for MythTV's Live TV function. Whether these identical
> STBs support DVR functionality or not is neither here nor there, but as
> it happens they do not.
>
> But as it happens I also know the group delay we experience on the BBC
> channels: comparing the BBC Breakfast clock to a DCF-77 clock I have
> within view reveals that the BBC signal is delayed by 13 seconds on its
> way to the land of Belgium that is so far, far away.
>
> Cheers, Jan


Yeah I'm aware of the delays introduced by digital TV what I'm more
interested in is what sort of delay the LKV373A introduces to things.
I'm assuming it needs to encode the video and audio which will introduce
a delay. I have a couple of USB HDMI capture devices and they claim to
have a 1/3 of a frame delay. So when it detects a HDMI signal it will
start to output the raw data in about that time. The downside of these
sort of devices is the data is effectively the raw digital data
completely un-encoded which for an HD broadcast is a very large chunk of
data. The positive side is they give a high quality picture with very
little delay. It means you can play the video in real time and use a
remote to change channels or interact with the UI without the annoying
delay you would get with MythTV.


To be clear I don't use these devices with MythTV I use them for another
project. I'm just curious what sort of delay these type of devices
introduce and whether I should give one a try (I  could get one to give
it a try but they appear to cost 3 or 4 times the cost of the USB ones).
If the delay is to large then they wont work for what I need them for
which is why I'm asking.


Paul H.

_______________________________________________
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: Recording from HDMI [ In reply to ]
On 22/02/2023 19:01, Paul Harrison wrote:
> Yeah I'm aware of the delays introduced by digital TV what I'm more
> interested in is what sort of delay the LKV373A introduces to things.

As I said my test compared direct viewing with viewing through the HDMI
capture device and MythTV.

This guy [1] has done latency tests as well. His screenshots show around
half a second of latency (i.e. without MythTV).

[1]:
https://blog.danman.eu/new-version-of-lenkeng-hdmi-over-ip-extender-lkv373a/
; search for "Latency" to get to the bit of interest.

HTH, Jan
_______________________________________________
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: Recording from HDMI [ In reply to ]
On Sat, 18 Feb 2023 at 09:26, Jan Ceuleers <jan.ceuleers@gmail.com> wrote:

> Dear mythizens,
>
> I have just created a new page on the wiki on the subject of recording
> from HDMI. It is a case study of how I have gone about this, and not so
> much a how-to (although you are of course welcome to regard it as such).
>
> https://www.mythtv.org/wiki/Recording_from_HDMI
>
> The article discusses other topics as well, such as infrared channel
> changing and the use of system events.
>
> Hope this helps.
>
> Cheers, Jan
> _______________________________________________
>
>
This is very interesting. So interesting in fact that I've bought one of
the devices to play with.

Following the instructions it was easy enough to setup, even though I'm a
bit out of my depth with some of it.

I'm using a Windows laptop as an HDMI test source and even though the
laptop says it's connected at 1920x1080 and the LKV admin page shows the
input as 1920x1080, ffmpeg is showing (and capturing) a 1728x1080 video
stream, which was a surprise. I don't think it's a resolution I've come
across before.

...
Stream #0:0[0x7d1]: Video: h264 (Constrained Baseline) ([27][0][0][0] /
0x001B), yuv420p(progressive), 1728x1080, 29.97 fps, 29.97 tbr, 90k tbn
Stream #0:1[0x7d2]: Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo,
fltp, 192 kb/s
...

Any ideas why that would be? I'd rather have 1920 x 1080.
Re: Recording from HDMI [ In reply to ]
> On Mar 2, 2023, at 12:18 PM, David Watkins <watkinshome@gmail.com> wrote:
>
>
>
> On Sat, 18 Feb 2023 at 09:26, Jan Ceuleers <jan.ceuleers@gmail.com <mailto:jan.ceuleers@gmail.com>> wrote:
>> Dear mythizens,
>>
>> I have just created a new page on the wiki on the subject of recording
>> from HDMI. It is a case study of how I have gone about this, and not so
>> much a how-to (although you are of course welcome to regard it as such).
>>
>> https://www.mythtv.org/wiki/Recording_from_HDMI
>>
>> The article discusses other topics as well, such as infrared channel
>> changing and the use of system events.
>>
>> Hope this helps.
>>
>> Cheers, Jan
>> _______________________________________________
>>
>
> This is very interesting. So interesting in fact that I've bought one of the devices to play with.
>
> Following the instructions it was easy enough to setup, even though I'm a bit out of my depth with some of it.
>
> I'm using a Windows laptop as an HDMI test source and even though the laptop says it's connected at 1920x1080 and the LKV admin page shows the input as 1920x1080, ffmpeg is showing (and capturing) a 1728x1080 video stream, which was a surprise. I don't think it's a resolution I've come across before.
>
> ...
> Stream #0:0[0x7d1]: Video: h264 (Constrained Baseline) ([27][0][0][0] / 0x001B), yuv420p(progressive), 1728x1080, 29.97 fps, 29.97 tbr, 90k tbn
> Stream #0:1[0x7d2]: Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz, stereo, fltp, 192 kb/s
> ...
>



What you indicate is correct. The page in mythtv points to another source regarding the capture device that indicates there is a firmware update that needs to be done on the capture device to provide full 1920x1080 capture.

That page looked a little confusing to me.

Regards!
Re: Recording from HDMI [ In reply to ]
On 3/2/23 12:18 PM, David Watkins wrote:
> Stream #0:1[0x7d2]: Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz,
> stereo, fltp, 192 kb/s

This reminds me why I stopped considering these devices as an option:
2-channel audio compressed with MP2. Yuck.

IIRC, the v.4 hardware does a better job with audio, however those
devices use a completely different method to send the data over IP,
which hasn't been completely reverse-engineered yet.

_______________________________________________
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: Recording from HDMI [ In reply to ]
On 02/03/2023 18:18, David Watkins wrote:
> This is very interesting.  So interesting in fact that I've bought one
> of the devices to play with.
>
> Following the instructions it was easy enough to setup, even though I'm
> a bit out of my depth with some of it.
>
> I'm using a Windows laptop as an HDMI test source and even though the
> laptop says it's connected at 1920x1080 and the LKV admin page shows the
> input as 1920x1080, ffmpeg is showing (and capturing) a 1728x1080 video
> stream, which was a surprise.  I don't think it's a resolution I've come
> across before.
>
> ...
> Stream #0:0[0x7d1]: Video: h264 (Constrained Baseline) ([27][0][0][0] /
> 0x001B), yuv420p(progressive), 1728x1080, 29.97 fps, 29.97 tbr, 90k tbn
> Stream #0:1[0x7d2]: Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz,
> stereo, fltp, 192 kb/s
> ...
>
> Any ideas why that would be?  I'd rather have 1920 x 1080.

I'm afraid I can't help much since my STBs either output 720p or 1080i,
and I went for 720p. But perhaps you could play around with the web
settings: point a browser at the device and log in with admin/123456.

Having said that I went and checked a file thus recorded, and its
resolution is 1280x720. MythTV plays it just fine. Have you tried
playing yours with MythTV?

(Note that I ran ffprobe on a recording, so ffmpeg has changed the audio
encoding on the way into the backend).

$ ffprobe /mnt/disk4/mythtv/1044_20230220205000.ts
(...)
Input #0, mpegts, from '/mnt/disk4/mythtv/1044_20230220205000.ts':
Duration: 01:24:38.62, start: 1.400000, bitrate: 12935 kb/s
Program 1
Stream #0:0[0x100]: Video: h264 (Constrained Baseline)
([27][0][0][0] / 0x001B), yuv420p(progressive), 1280x720, 50 fps, 50
tbr, 90k tbn, 100 tbc
Stream #0:1[0x101]: Audio: aac (LC) ([15][0][0][0] / 0x000F), 48000
Hz, stereo, fltp, 149 kb/s

HTH, Jan
_______________________________________________
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: Recording from HDMI [ In reply to ]
On 02/03/2023 18:36, Dan Wilga wrote:
> On 3/2/23 12:18 PM, David Watkins wrote:
>> Stream #0:1[0x7d2]: Audio: mp2 ([4][0][0][0] / 0x0004), 48000 Hz,
>> stereo, fltp, 192 kb/s
>
> This reminds me why I stopped considering these devices as an option:
> 2-channel audio compressed with MP2. Yuck.

Agreed, audio could be better.

Still, the results are much better than my previous setup (based on
analogue SD video and stereo audio).

_______________________________________________
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