[mythtv-users] USB vendor=534d device=2109

Will Dormann wdormann at gmail.com
Wed Jul 29 23:02:22 UTC 2020


On 7/29/20 11:01 AM, Bob wrote:
> I was given one of these by a friend to evaluate as a replacement
> for an HDPVR. The short version of the story is my cable box reverts
> to 480p mode as soon as recording is attempted. I remove power from
> the cable box to have it reboot and it will return to 1080i mode.
> Again, if recording is attempted then the box displays "d2" and
> returns to 480p mode.  My guess is because this device does not
> support HDCP.
> 
> My friend was able to successfully capture and playback (recent 
> Ubuntu/5.4.0-42-generic #46-Ubuntu) from this device, I was not 
> (LinHes 4.9.159-1-ARCH). Neither of us could get audio working using 
> this command:
> 
> $ ffmpeg -f v4l2 -input_format mjpeg -i /dev/video4 -c:v copy -c:a 
> copy test.mpg


I'll say that I had better luck with my device.  I got one mostly for
poking around, as the price couldn't be beat.

As for the cable box reverting to 480p upon recording, I'm not sure
what'd be going on there.  Unless perhaps the cable box falls back to a
480p failsafe if it doesn't detect a valid HDMI connection?  The Fire
Stick I've been testing on seems to behave just fine.

gucview is a good simple app to test recording.  And also apparently to
tell the device what resolution it should be streaming in, etc.

But if you really want to test out the device as it's expected to be
used, start with obs-studio.  For the most part it will just work, but
on my test machine (Ubuntu 20.04) I had to make a specific adjustment to
get audio recording to work:

1. Run pavucontrol (the pulse audio mixer)
2. Go to Configuration -> USB Video -> Profile: Multichannel input
(for me, it was set to "Mono Input" by default, which gave me no sound)
3. Go to Input Devices -> USB Video Multichannel -> Port: Multichannel Input

At least on my system, this was required to get any evidence that there
was any audio.  If your HDMI input to the device is playing audio
currently, in pavucontrol, you should see the VU meter fluctuating with
the received audio levels.   Feel free to celebrate just a bit.

Now in obs, you'll want to add a Video Capture Device (V4L2) input in
the "Sources" frame.

Again in obs, go to Settings -> Audio -> Devices -> Mic/Auxiliary Audio
2.  Make sure that "USB Video Multichannel" is selected here.  Also at
the top set Sample Rate to 48kHZ and Channels to 5.1, assuming that this
is valid for your source.

In the main obs window, in the Audio Mixer frame, you should see
"Mic/Aux 2" with a fluctuating VU meter and you should see above it
video from what you're recording.

If you click the Start recording button, obs will capture a video of
what you're seeing, with audio, at the resolution and the audio profile
that you have configured.

Once you're comfortable with obs working, let's try something from the
command line with ffmpeg:

ffmpeg -f v4l2 -input_format mjpeg -i /dev/video0 -f pulse -i default
-c:v copy -c:a copy mmm.mkv

Here you have specified /dev/video0 for the video input and the default
pulse input (which we configured previously) for the audio input.

After recording for a bit, we can check it out:
Input #0, matroska,webm, from 'mmm.mkv':
  Metadata:
    ENCODER         : Lavf58.29.100
  Duration: 00:00:03.19, start: 0.000000, bitrate: 41998 kb/s
    Stream #0:0: Video: mjpeg (Baseline), yuvj422p(pc,
bt470bg/unknown/unknown), 1920x1080, 30 fps, 30 tbr, 1k tbn, 1k tbc
(default)
    Metadata:
      DURATION        : 00:00:03.189000000
    Stream #0:1: Audio: pcm_s16le, 48000 Hz, 2 channels, s16, 1536 kb/s
(default)
    Metadata:
      DURATION        : 00:00:03.155000000


We can confirm that it's 1920x1080 video with an audio channel.   I
couldn't get an audio channel out of only specifying /dev/video0 for the
input, and I'm not 100% sure why.   Note however, that the audio is only
in stereo.   And it's PCM, so it's not even compressed.  I'm not sure
what sort of magic OBS does to get the audio in anything beyond stereo.
The video is about 42mbit/sec, so that'll eat up disk space quickly
unless it's transcoded.
Or if you've got an Nvidia GPU and the appropriate ffmpeg build, you may
be able to offload video encoding to it with the "-c:v h264_nvenc"
option.  I haven't been able to verify this as all my testing has been
in a virtual machine.  If you have a fast enough machine, you may be
able to get away with CPU-based h246 encoding on the fly.  If not, you
could play with other codecs / parameters until you find something that
looks good and doesn't excessively tax the system.   Or just rely on
MythTV's after-the-fact transcoding options.


If you're fine with stereo sound, then you might be good to go with a
setup such as the above.  And to be honest, despite the output file from
obs having 5.1 channels, I'm not completely certain that it's not just
faking it.  The obs documentation states that "There is an automatic
channel rematrixing when either downmixing or upmixing is mandated by a
difference in channel layouts between source and output."   So it's
possible that the LFE channel was just logically produced based off of
the stereo input by obs.  I'd probably need a 5.1 test tone to see for
sure what's going on, but as far as I can tell YouTube doesn't even
support 5.1 audio on the Fire Stick, so I'm really sure the best way
forward here.  If I really wanted to be sure, maybe I could put a true
5.1 audio-containing video file on a thumb drive and capture that from
something that outputs it over HDMI, assuming I know for sure that the
device outputs 5.1 audio.


Anyway, that's about what I know at this point.  I haven't fully
investigated this device's ability to be used with MythTV, but after my
brief testing it seems promising.  Perhaps as an "External Recorder" as
the Hauppauge HD-PVR2 and Colossus2 devices are available to be used?


-WD


More information about the mythtv-users mailing list