hauppauge dvc 100

happauge dazzle dvc 100 v4l2
streaming to rtp

hassle- had to read polish: http://forumdyskusyjne.co.pl/b/748/tuner,tv,em28xx.php. literally took weeks!

had to add my users to audio and video groups

at the end of all this, I put these in rc.local
modprobe em28xx-alsa &
v4l2-ctl -d /dev/video0 –set-standard=ntsc &
v4l2-ctl –set-ctrl=mute=0 &

https://trac.ffmpeg.org/wiki/Capture/ALSA

phomlish@a6:~/dm$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 2: ALC892 Alt Analog [ALC892 Alt Analog]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: DVC100 [DVC100], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

# which means we need to say -i hw:1
ffmpeg -f alsa -i hw:1 -t 30 -y out.wav
#but this was giving me no sound in the file.
check alsamixer F4 F6 to make sure it’s not muted

maybe this will help
ffmpeg -f alsa -i default:CARD=U0x46d0x809 -t 30 out.wav

so for me
ffmpeg -f alsa -i default:CARD=DVC100 -y out.wav
# still no joy playing with vc from my mac
it’s official, the link above helped me check my math but did not help!

ffmpeg -f alsa -i default:CARD=DVC100 -acodec mp3 -ac 2 -ar 44100 -y out.mp3
ffmpeg -f alsa -i hw:1 -acodec mp3 -ac 2 -ar 44100 -y out.mp3
# no joy

https://forums.linuxmint.com/viewtopic.php?t=123022
v4l2-ctl –set-ctrl=mute=0
ffmpeg -f alsa -i default:CARD=DVC100 -acodec mp3 -ac 2 -ar 44100 -y out.mp3
# that worked

# now to try libopus
ffmpeg -f alsa -i default:CARD=DVC100 -acodec libopus -ac 2 -ar 44100 -y out.webm

# streaming an audio test
ffmpeg -re -f lavfi -i aevalsrc=”sin(400*2*PI*t)” -ar 8000 -f mulaw -f rtp rtp://127.0.0.1:1234

Goals
best recording possible- will be done on a2 with the mpeg compression board
webm to udp

but what is libvisual_infinite?
gst-launch-1.0 alsasrc ! libvisual_lv_analyzer ! eglglessink

What does the Dazzle do?
dmesg
em28xx: New device Pinnacle Systems GmbH DVC100 @ 480 Mbps (2304:021a, interface 0, class 0)
AC97 audio (5 sample rates)
yuyv422 or yuv411p
-video_size 768×576
Width/Height : 640/480
Frames per second: 29.970 (30000/1001)

let’s record the webm file
ffmpeg \
-f video4linux2 -thread_queue_size 1024 -i /dev/video0 \
-f alsa -thread_queue_size 1024 -ar 44100 -channels 2 -channel_layout stereo -i hw:1 \
-video_size 720×480 -pix_fmt yuyv422 \
-c:v libvpx -crf 10 -b:v 246K -r 29.970 \
-c:a libopus -b:a 256k -vbr on -compression_level 10 \
-f webm -y -threads 4 t.webm

and then stream it
ffmpeg -re -i t.webm \
-acodec copy -vn -f rtp rtp://10.11.1.96:5122 \
-vcodec copy -an -f rtp rtp://10.11.1.96:5124

trying gstreamer
test audio/video
/usr/local/bin/gst-launch-1.0 -v \
audiotestsrc ! audioconvert dithering=0 ! opusenc bitrate=128000 ! rtpopuspay pt=98 \
! udpsink host=127.0.0.1 port=5122 \
videotestsrc ! vp8enc ! rtpvp8pay ! udpsink host=127.0.0.1 port=5124

tring videotestsrc
/usr/local/bin/gst-launch-1.0 -v \
videotestsrc ! vp8enc ! rtpvp8pay ! udpsink host=10.11.1.96 port=5124

trying dazzle dvc 100

This worked to record the video
/usr/local/bin/gst-launch-1.0 -v v4l2src device=/dev/video0 norm=NTSC \
! videoscale ! ‘video/x-raw,width=640,height=480,framerate=15/1,interlace-mode=mixed’ \
! videoconvert ! ‘video/x-raw, width=640, height=480’ \
! vp8enc threads=4 ! webmmux \
! filesink location=test.webm

and this worked to stream the video
/usr/local/bin/gst-launch-1.0 -v v4l2src device=/dev/video0 norm=NTSC \
! videoscale ! ‘video/x-raw,width=640,height=480,framerate=15/1,interlace-mode=mixed’ \
! videoconvert ! ‘video/x-raw, width=640, height=480’ ! videorate \
! vp8enc threads=4 ! rtpvp8pay ! udpsink host=10.11.1.96 port=5124

on to audio:
this worked to create the file
GST_DEBUG=4 /usr/local/bin/gst-launch-1.0 -v \
alsasrc num-buffers=1000 device=hw:1 provide-clock=false \
! ‘audio/x-raw, format=S16LE, rate=44100, channels=2’ \
! audioconvert ! audioresample \
! avimux ! filesink location=test.avi
WORKS! but Got EOS from element “pipeline0”.
/usr/local/bin/gst-launch-1.0 -v \
alsasrc num-buffers=1000 device=hw:1 provide-clock=false \
! ‘audio/x-raw, format=S16LE, rate=44100, channels=2’ \
! audioconvert ! audioresample \
! avimux ! filesink location=test.avi

/usr/local/bin/gst-launch-1.0 -v -e \
alsasrc num-buffers=1000 device=hw:1 provide-clock=false \
! ‘audio/x-raw, format=S16LE, rate=44100, channels=2’ \
! audioconvert ! audioresample \
! vorbisenc ! oggmux ! filesink location=test.ogg
Got EOS from element “pipeline0”.
Execution ended after 0:00:10.003604373

maybe we should try open -> rtp
/usr/local/bin/gst-launch-1.0 -v -e \
alsasrc num-buffers=1000 device=hw:1 provide-clock=false \
! ‘audio/x-raw, format=S16LE, rate=44100, channels=2’ \
! audioconvert ! audioresample \
! opusenc ! rtpopuspay ! udpsink host=10.11.1.96 port=5124
Got EOS from element “pipeline0”.
Execution ended after 0:00:10.032618505

/usr/local/bin/gst-launch-1.0 -v -e \
alsasrc num-buffers=10000 device=hw:1 provide-clock=false \
! ‘audio/x-raw, format=S16LE, rate=44100, channels=2’ \
! audioconvert ! audioresample \
! opusenc ! rtpopuspay ! udpsink host=10.11.1.96 port=5124
didn’t stop but also didn’t hear anything…

/usr/local/bin/gst-launch-1.0 -v -e \
alsasrc num-buffers=10000 device=hw:1 provide-clock=false do-timestamp=true \
! ‘audio/x-raw, format=S16LE, rate=44100, channels=2’ \
! queue ! audioconvert ! audioresample ! queue \
! opusenc ! webmmux ! filesink location=test.webm
Got EOS from element “pipeline0”.

/usr/local/bin/gst-launch-1.0 -v -e \
alsasrc num-buffers=10000 device=hw:1 provide-clock=false do-timestamp=true \
! ‘audio/x-raw, format=S16LE, rate=44100, channels=2’ \
! audioconvert ! audioresample \
! opusenc ! webmmux ! filesink location=test.webm
Got EOS from element “pipeline0”.
Execution ended after 0:01:40.006636953

finally got audio working here
/usr/local/bin/gst-launch-1.0 -v -e \
alsasrc num-buffers=-1 device=hw:1 provide-clock=false do-timestamp=true \
! ‘audio/x-raw, format=S16LE, rate=44100, channels=2’ \
! audioconvert ! audioresample \
! opusenc ! webmmux ! filesink location=test.webm

and to put it all together
/usr/local/bin/gst-launch-1.0 -v -e \
alsasrc num-buffers=-1 device=hw:1 provide-clock=false do-timestamp=true \
! ‘audio/x-raw, format=S16LE, rate=44100, channels=2’ \
! audioconvert ! audioresample \
! opusenc ! rtpopuspay ! udpsink host=10.11.1.96 port=5122 \
v4l2src device=/dev/video0 norm=NTSC \
! videoscale ! ‘video/x-raw,width=640,height=480,framerate=15/1,interlace-mode=mixed’ \
! videoconvert ! ‘video/x-raw, width=640, height=480’ ! videorate \
! vp8enc threads=4 ! rtpvp8pay ! udpsink host=10.11.1.96 port=5124

v4l2-ctl –list-devices
Pinnacle Dazzle DVC 90/100/101/ (usb-0000:00:14.0-4):
/dev/video0

ffmpeg -f v4l2 -list_formats all -i /dev/video0
[video4linux2,v4l2 @ 0x3e00380] Raw : yuyv422 : YUYV 4:2:2 : {144-720, 1}x{115-576, 1}
[video4linux2,v4l2 @ 0x3e00380] Raw : rgb565le : 16-bit RGB 5-6-5 : {144-720, 1}x{115-576, 1}
[video4linux2,v4l2 @ 0x3e00380] Raw : bayer_bggr8 : 8-bit Bayer BGBG/GRGR : {144-720, 1}x{115-576, 1}
[video4linux2,v4l2 @ 0x3e00380] Raw : bayer_grbg8 : 8-bit Bayer GRGR/BGBG : {144-720, 1}x{115-576, 1}
[video4linux2,v4l2 @ 0x3e00380] Raw : bayer_gbrg8 : 8-bit Bayer GBGB/RGRG : {144-720, 1}x{115-576, 1}
[video4linux2,v4l2 @ 0x3e00380] Raw : yuv411p : Planar YUV 4:1:1 : {144-720, 1}x{115-576, 1}

ffmpeg -f video4linux2 -video_size 768×576 -i /dev/video0 -framerate 60 -c:v mpeg2video -flags +ilme+ildct tmp.mpg

v4l2-ctl –all
Driver Info (not using libv4l2):
Driver name : em28xx
Card type : Pinnacle Dazzle DVC 90/100/101/
Bus info : usb-0000:00:14.0-4
Driver version: 4.4.87
Capabilities : 0x85200001
Video Capture
Read/Write
Streaming
Extended Pix Format
Device Capabilities
Device Caps : 0x05200001
Video Capture
Read/Write
Streaming
Extended Pix Format
Priority: 2
Video input : 0 (Composite1: ok)
Video Standard = 0x0000b000
NTSC-M/M-JP/M-KR
Format Video Capture:
Width/Height : 720/480
Pixel Format : ‘YUYV’
Field : Interlaced
Bytes per Line : 1440
Size Image : 691200
Colorspace : SMPTE 170M
Transfer Function : Default
YCbCr Encoding : Default
Quantization : Default
Flags :
Streaming Parameters Video Capture:
Frames per second: 29.970 (30000/1001)
Read buffers : 4

User Controls

brightness (int) : min=-128 max=127 step=1 default=0 value=0 flags=slider
contrast (int) : min=0 max=31 step=1 default=16 value=16 flags=slider
saturation (int) : min=0 max=31 step=1 default=16 value=16 flags=slider
red_balance (int) : min=-48 max=48 step=1 default=0 value=0 flags=slider
blue_balance (int) : min=-48 max=48 step=1 default=0 value=0 flags=slider
sharpness (int) : min=0 max=15 step=1 default=0 value=0 flags=slider

v4l2-ctl -d /dev/video0 –set-standard=ntsc

openssl

openssl x509 -in certificate.pem -text

openssl pkcs12 -export -in cert.pem -inkey privkey.pem \
-out swarm.p12 -name swarm \
-CAfile ca.crt -caname root

openssl pkcs12 -export -in cert.pem -inkey privkey.pem -out swarm.p12 -name swarm -password pass:password

openssl x509 -in mydetv.crt -text

openssl s_client -showcerts -verify 5 -connect stackexchange.com:443 < /dev/null

why this blog


Because google sucks. But it sucks less than the alternatives which don’t return very valuable results at all. But the top google results are all add encrusted cpu hogs that bog down my browser. So I stood up this blog simply so I can have a nice clean no advertisement place to find my technology hints and howtos.