[mythtv-users] garbage output from external HDMI source

Peter Bennett pb.mythtv at gmail.com
Sat Jun 10 13:35:39 UTC 2023


On 6/10/23 09:34, Peter Bennett wrote:
>
> On 6/9/23 23:23, David Newman wrote:
>> MythTV 32 on Ubuntu 22 LTS
>>
>> I recently switched from an ancient Hauppauge PVR box to a simple 
>> HDMI capture card and am setting it up as an external recorder using 
>> the wiki and some config suggestions from list member Dave Pearson 
>> (thanks Dave!).
>>
>> Scheduled recordings work, but for reasons that aren't clear to me 
>> the output is just digital noise. I could use help in understanding 
>> why –– configs and logs pasted below.
>>
>> My setup is the HDMI input of the capture device [1] connected to the 
>> the HDMI port of my set Arris DCX3200-M top box (via a 2-port powered 
>> HDMI splitter [2] for viewing live TV). In mythtv-setup I use the 
>> 6200ch command to change channels (and this works when executed 
>> manually).
>>
>> Config files and logs from a sample bad recording below. Thanks in 
>> advance for helping understand what's missing here.
>>
>> dn
>>
>>
>> [1] Capture device:
>>
>> https://www.amazon.com/gp/product/B089ZWX5MY
>>
>> [2] Powered HDMI splitter:
>>
>> https://www.amazon.com/gp/product/B0B2R3GXL9/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1 
>>
>>
>> -----
>>
>> /usr/local/bin/MythExternalRecorder (called out in mythtv-setup step 2):
>>
>> #!/bin/bash
>>
>> ## echo "`date`: /usr/bin/mythexternrecorder" "${@}" >> 
>> /var/log/mythtv/mythexternrecorder.log
>>
>> /usr/bin/mythexternrecorder -v all:debug --exec --conf 
>> /usr/share/mythtv/external.conf "${@}"
>>
>> -----
>>
>> /usr/share/mythtv/external.conf:
>>
>> [RECORDER]
>> # This is the recorder command to execute
>> command="mythffmpeg -f v4l2 -framerate 30 -input_format mjpeg 
>> -video_size 1920x1080 -i /dev/video0 -f alsa -ac 2 -itsoffset 0.150 
>> -i hw:1,0 -f mpegts -c:v libx264 -b:v 5200k -preset ultrafast 
>> -x264opts keyint=50 -c:a aac -b:a 160k pipe:1"
>>
>> # Optional cleanup command which is executed when this recorder is 
>> shut down
>> #cleanup="/home/mythtv/bin/input-finished.sh"
>> cleanup="killall mythffmpeg"
>>
>> # Used in logging events, %ARG% are replaced from the channel info
>> desc=mythffmpeg \"%URL%\" \"%CHANNUM%\" \"%CHANNAME%\" \"%CALLSIGN%\"
>
>
> I have been using the identical device for all of my recordings for a 
> few years now.
>
> My scripts are all here 
> https://github.com/bennettpeter/MythTV-LeanCapture .
>
> They are customized for Amazon fire stick. You will have to create 
> your own for the set top box.
>
> Test out the capture with a command like this to see if it works. You 
> will need to figure out the VIDEO_IN and AUDIO_IN, that depends on 
> what devices you have.
>
> (from script leanrec.sh)
>
> INPUT_FORMAT=mjpeg
> FRAMERATE=60
> VIDEO_IN=/dev/video2
> AUDIO_IN=hw:2,0
> X264_PRESET=veryfast
> X264_CRF=21
> AUDIO_OFFSET=0.150
>
> ffmpeg -hide_banner -loglevel error \
> -f v4l2 \
> -thread_queue_size 256 \
> -input_format $INPUT_FORMAT \
> -framerate $FRAMERATE \
> -video_size $RESOLUTION \
> -use_wallclock_as_timestamps 1 \
> -i $VIDEO_IN \
> -f alsa \
> -ac 2 \
> -ar 48000 \
> -thread_queue_size 1024 \
> -itsoffset $AUDIO_OFFSET \
> -i $AUDIO_IN \
> -c:v libx264 \
> -vf format=yuv420p \
> -preset $X264_PRESET \
> -crf $X264_CRF \
> -c:a aac \
> output_file.mkv
>
> You can also test it by playing video from the capture device through 
> vlc:
>
> (from script leanvlc.sh)
>
> ifparam=":v4l2-chroma=MJPG
> audio=":input-slave=alsa://$AUDIO_IN"
> video="v4l2://$VIDEO_IN"
>
> vlc $video  :v4l2-width=1280 :v4l2-height=720  \
>  $ifparam :v4l2-fps=30 :v4l2-aspect-ratio=16:9 $audio \
>  --audio-desync $offset_ms
>
> Note that vlc 3.0.16 has a bug that does not play audio with this 
> setup. You can get vlc 3.0.18 from savoury1 ppa.
>
> Peter
>
Note: You do not need any splitter for this.

Peter



More information about the mythtv-users mailing list