On Wed, 1 Mar 2023 11:00:35 -0500, you wrote:
>
>
>> On Mar 1, 2023, at 9:13 AM, Peter Bennett <pb.mythtv@gmail.com> wrote:
>>
>>
>> On 2/28/23 20:52, Stephen Worthington wrote:
>>> On Tue, 28 Feb 2023 14:39:03 -0500, you wrote:
>>>
>>>>
>>>>>> I don't know if it will help you, but as of Mythtv v33, the mythexternrecorder application now lets you set "per channel" tuning command. See:
>>>>>> https://www.mythtv.org/wiki/Example_Configuration_files#Mythtv_v33_Example
>>>>>>
>>>>>> That means your tuning command could be a no-op for specific channels that you have defined.
>>>>>>
>>>>>> John
>>>>>
>>>> So I have been ?experimenting? with this and I think I have set up something incorrect for incoming video.
>>>>
>>>> The hdmi device is usb, one of those that are 10-20 bucks, and from what I can tell it is creating a v4l2 mjpeg video stream with a PCM audio stream on USB audio.
>>>>
>>>> Using ffmpeg, I can create an avi with it, and also an mkv with it , and have tried multiple ways to create an output stream for mythtv to use.
>>>>
>>>> I am trying to keep processing down to a minimal amount since I am trying to use a Raspberry Pi 4b with 4GB ram running mythbackend to capture the video stream.
>>>>
>>>> If I try to use any mpeg2 or mp4 transcoding, I get in trouble with using too much cpu. Any ideas as to what I can try to capture with little or no transcoding effort on the RPI 4b? Or am I asking too much from the RPI4 to capture it.
>>>>
>>>> Regards!
>>> I know nothing about those cheap devices, but the first thing I would
>>> try would be to just store the data directly to a .ts file, as
>>> mythbackend does for DVB streams. If mythfrontend can play the
>>> result, then all is well. If not, then you can set up an automatic
>>> non-real time transcoding job to be run at low priority after the
>>> recording finishes (or the job can be run in parallel with the
>>> recording).
>>
>> FWIW I have been using those USB devices for about 2 years as my main MythTV capture devices. The scripts and info are here:
>>
>> https://github.com/bennettpeter/MythTV-LeanCapture#readme
>>
>> My scripts encode to H264. The RPI is far too slow to encode the stream (as noted in the readme). You may be able to change the ffmpeg parameters to output an MJPEG TS without any encoding.
>>
>> Peter
>
>I did check out your lean capture page, and I used the test on it to see how it fared as far as cpu usage, and the RPI4 stinks in comparison to what you are using. The events per second for the RPi 4 processor is 393, so that is a non starter for trying to use transcode with H264.
>
>I did try just copying to mpegts , but I couldn?t view video using it, either with vlc or mythtv.
>
>The best success I have had is creating an mkv, or an avi, but have not been able to get mythtv to accept it via a pipe.
>
>Looks like I am SOL then when using the RPI4 as the capture for the USB HDMI .
>
>UNLESS there is some other magic!?
>
>Some of the other experiments I tried were to treat it as a v4l2 capture device(there look like there are a couple of choices as tuners in Mythtv) since it is v4l2 video, but that was also a fail. I?m guessing the v4l2 driver is only looking for 640x480 video likes old school analog tv?
>
>Regards!
If you can record the raw data to disk, then transcoding later should
work. Try using ffprobe (or mythffprobe) on the raw file to see if it
is a valid format for ffmpeg to transcode. If you make a small
recording as an example and can upload it somewhere, I would be happy
have a look to see to see what works to transcode it. I have an RPi4
to test on.
With transcoding on any CPU that can not keep up with realtime
transcoding, you normally need to use nice (and possibly also ionice)
to reduce the priority of the transcoding process so that it does not
interfere with any recordings happening at the time. You can tell
mythbackend how many transcodings it is allowed to run at once, so on
an RPi4 if transcoding is a single core only process (which it often
is) then it might be able to run one per core at the same time, or run
three at once to leave one core to run recordings. It might take an
RPi4 several hours to transcode a one hour recording, or even longer,
but if you can just leave it on 24/7 and there are not too many
recordings happening, it should be able to catch up between
recordings.
There is also a big advantage to doing a transcoding from a file
rather than a recording stream, as you can use two pass transcoding
where the first pass works out where to use high or low bit rates and
the second pass does the actual transcoding to the requested average
bit rate. When you are transcoding a stream or using one pass
transcoding, the transcoding process can only buffer a small amount of
the stream to enable it to look ahead and decide what needs lots of
bits and what needs only a few bits to encode it well. So the quality
of the result is much lower.
_______________________________________________
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