benjojo / de-ip-hdmi Goto Github PK
View Code? Open in Web Editor NEWConvert a IP HDMI converter into a MKV stream
Convert a IP HDMI converter into a MKV stream
Does this program support version 2.0 of the lenking or 3.0? 3.0 emits H264 over JPG...
I see similar models that support a IR blaster. Do you think it would be possible to send "IR packets" to the blaster? I'm imagining a MythTV DVR setup that would make use of a channel changing script.
i.e. devices like this one https://amzn.com/B00Z9OW6DQ
I am using MacOS Mojave trying to use your package. When I run
go install main.go
All I get is:
'./main.go:256:32: not enough arguments in call to raw.ListenPacket
./main.go:256:38: undefined: raw.ProtocolARP'
I am suspecting there is some problem with my Go installation or PCAP since I am a total noob to Go and programming in general. Can anyone offer some help?
Hello,
Thanks for this tool !
I use a V2 sender and I'm trying to get the video stream in VLC.
hugo@hdrpc:~$ sudo de-ip-hdmi -interface enp3s0 -sender-mac 000b78006001 -audio false | vlc -
VLC media player 3.0.4 Vetinari (revision 3.0.4-0-gf615db6332)
[000055df75113570] main libvlc: Lancement de vlc avec l'interface par défaut. Utilisez « cvlc » pour démarrer VLC sans interface.
Warning: QT_DEVICE_PIXEL_RATIO is deprecated. Instead use:
QT_AUTO_SCREEN_SCALE_FACTOR to enable platform plugin controlled per-screen factors.
QT_SCREEN_SCALE_FACTORS to set per-screen factors.
QT_SCALE_FACTOR to set the application global scale factor.
ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
WARNING: library configuration mismatch
avcodec configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
Input #0, mjpeg, from '/tmp/hdmi-Vfifo-kyfw9':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 1:1 DAR 16:9], 25 tbr, 1200k tbn, 25 tbc
^CGuessed Channel Layout for Input Stream #1.0 : stereo
Input #1, s32be, from 'pipe:0':
Duration: N/A, bitrate: 2822 kb/s
Stream #1:0: Audio: pcm_s32be, 44100 Hz, stereo, s32, 2822 kb/s
Output #0, matroska, to 'pipe:1':
Metadata:
encoder : Lavf57.83.100
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 tbr, 1k tbn, 1200k tbc
Stream #0:1: Audio: pcm_s32be ([255][255][255][255] / 0xFFFFFFFF), 44100 Hz, stereo, s32, 2822 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
[00007f25f8017d90] mjpeg demux error: cannot peek
QObject::~QObject: Timers cannot be stopped from another thread
VLC seems to load forever (before I Ctrl + C).
I checked tcpdump
and as expected I have a lot of traffic going on :
13:10:01.211062 IP 192.168.168.55.2065 > 226.2.2.2.2066: UDP, length 1008
13:10:01.211193 IP 192.168.168.55.2068 > 226.2.2.2.2068: UDP, length 1024
13:10:01.211834 IP 192.168.168.55.2068 > 226.2.2.2.2068: UDP, length 1024
...
I tried to pipe to ffplay instead of vlc and this what I get :
hugo@hdrpc:~$ sudo de-ip-hdmi -interface enp3s0 -sender-mac 000b78006001 -audio false -raw | ffplay -
ffplay version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2003-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
WARNING: library configuration mismatch
avcodec configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
ffmpeg version 3.4.6-0ubuntu0.18.04.1 Copyright (c) 2000-2019 the FFmpeg developers
built with gcc 7 (Ubuntu 7.3.0-16ubuntu3)
configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared
WARNING: library configuration mismatch
avcodec configuration: --prefix=/usr --extra-version=0ubuntu0.18.04.1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --enable-gpl --disable-stripping --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librubberband --enable-librsvg --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-omx --enable-openal --enable-opengl --enable-sdl2 --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libopencv --enable-libx264 --enable-shared --enable-version3 --disable-doc --disable-programs --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libtesseract --enable-libvo_amrwbenc
libavutil 55. 78.100 / 55. 78.100
libavcodec 57.107.100 / 57.107.100
libavformat 57. 83.100 / 57. 83.100
libavdevice 57. 10.100 / 57. 10.100
libavfilter 6.107.100 / 6.107.100
libavresample 3. 7. 0 / 3. 7. 0
libswscale 4. 8.100 / 4. 8.100
libswresample 2. 9.100 / 2. 9.100
libpostproc 54. 7.100 / 54. 7.100
[mjpeg @ 0x55d987222160] Found EOI before any SOF, ignoring f=0/0
Input #0, mjpeg, from '/tmp/hdmi-Vfifo-G33og':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: mjpeg, yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 1:1 DAR 16:9], 25 tbr, 1200k tbn, 25 tbc
^CGuessed Channel Layout for Input Stream #1.0 : stereo 0B f=0/0
Input #1, s32be, from 'pipe:0':
Duration: N/A, bitrate: 2822 kb/s
Stream #1:0: Audio: pcm_s32be, 44100 Hz, stereo, s32, 2822 kb/s
Output #0, matroska, to 'pipe:1':
Metadata:
encoder : Lavf57.83.100
Stream #0:0: Video: mjpeg (MJPG / 0x47504A4D), yuvj422p(pc, bt470bg/unknown/unknown), 1920x1080 [SAR 1:1 DAR 16:9], q=2-31, 25 tbr, 1k tbn, 1200k tbc
Stream #0:1: Audio: pcm_s32be ([255][255][255][255] / 0xFFFFFFFF), 44100 Hz, stereo, s32, 2822 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
The MAC adress I use is the one given inside http://192.168.168.55/
Do you know what could be wrong here ?
Hugo
Hi,
I believe that this is incorrect:
FrameNumber := uint16(0)
CurrentChunk := uint16(0)
buf := bytes.NewBuffer(ApplicationData[:2])
buf2 := bytes.NewBuffer(ApplicationData[2:4])
buf2 should be only 8 bits, consisting of ApplicationData[3].
ApplicationData[2] is set to 0 normally, or 0x80 if it is the last chunk of the frame.
Apologies for not diving in and fixing/testing this, but I'm not a go programmer and I'm working on my own code in python - just passing this on based on my findings there.
We're trying to stream the output to ffplay.
However, it seems that the video stream remains empty. When piping the output to a file, the resulting file is empty, too.
Streaming to an MKV fifo works. When starting the program with -debug
, there is a lot of output.
I'm not familiar with the code base, but it seems to me that videowriter
remains unused when passing -mkv=false
.
Lines 57 to 61 in 632f157
go DumpChanToFile(videodis, videowriter)
should actually be placed below the if/else
block (line 61).
If this is not the problem, how can we narrow the problem down?
Hi,
trying to compile it on an raspberry 3. Tho getting following error:
../github.com/mdlayher/raw/raw_linux.go:88:14: f.SyscallConn undefined (type 'OS.File' has no field or method SyscallConn)
Any knows how to fix it?
I don't have the necessary device to test this, but it seems like BroadcastWakeups()
might not be modifying the magic packet correctly.
Below the declaration of the magic packet byte slice, the MAC address is written to it, though instead of writing to consecutive bytes, the same byte is overwritten by each consecutive byte in the MAC.
Is this (not) an error?
hey guys,
i have the same issue as mentioned in #5.
both, the deb package and the self compiled binary arent working.
me@my:~/gopath/src/github.com/de-ip-hdmi$ sudo ./de-ip-hdmi -interface enp0s25 -sender-mac 00f019d9d3df
ffmpeg version 2.8.6-1ubuntu2 Copyright (c) 2000-2016 the FFmpeg developers
built with gcc 5.3.1 (Ubuntu 5.3.1-11ubuntu1) 20160311
configuration: --prefix=/usr --extra-version=1ubuntu2 --build-suffix=-ffmpeg --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --cc=cc --cxx=g++ --enable-gpl --enable-shared --disable-stripping --disable-decoder=libopenjpeg --disable-decoder=libschroedinger --enable-avresample --enable-avisynth --enable-gnutls --enable-ladspa --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libmodplug --enable-libmp3lame --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librtmp --enable-libschroedinger --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxvid --enable-libzvbi --enable-openal --enable-opengl --enable-x11grab --enable-libdc1394 --enable-libiec61883 --enable-libzmq --enable-frei0r --enable-libx264 --enable-libopencv
libavutil 54. 31.100 / 54. 31.100
libavcodec 56. 60.100 / 56. 60.100
libavformat 56. 40.101 / 56. 40.101
libavdevice 56. 4.100 / 56. 4.100
libavfilter 5. 40.101 / 5. 40.101
libavresample 2. 1. 0 / 2. 1. 0
libswscale 3. 1.101 / 3. 1.101
libswresample 1. 2.101 / 1. 2.101
libpostproc 53. 3.100 / 53. 3.100
^C[mjpeg @ 0x103c5e0] No JPEG data found in image
[mjpeg @ 0x1033500] decoding for stream 0 failed
[mjpeg @ 0x1033500] Could not find codec parameters for stream 0 (Video: mjpeg, none(bt470bg/unknown/unknown)): unspecified size
Consider increasing the value for the 'analyzeduration' and 'probesize' options
/tmp/hdmi-Vfifo-1NVZN: could not find codec parameters
Input #0, mjpeg, from '/tmp/hdmi-Vfifo-1NVZN':
Duration: N/A, bitrate: N/A
Stream #0:0: Video: mjpeg, none(bt470bg/unknown/unknown), 25 tbr, 1200k tbn, 25 tbc
Guessed Channel Layout for Input Stream #1.0 : stereo
Input #1, s32be, from 'pipe:0':
Duration: N/A, bitrate: 2822 kb/s
Stream #1:0: Audio: pcm_s32be, 44100 Hz, 2 channels, s32, 2822 kb/s
[matroska @ 0x10478a0] dimensions not set
Output #0, matroska, to 'pipe:1':
Stream #0:0: Video: mjpeg, none, q=2-31, 25 tbr, 1200k tbn, 1200k tbc
Stream #0:1: Audio: pcm_s32be, 44100 Hz, stereo (32 bit), 2822 kb/s
Stream mapping:
Stream #0:0 -> #0:0 (copy)
Stream #1:0 -> #0:1 (copy)
Could not write header for output file #0 (incorrect codec parameters ?): Invalid argument
using wireshark, i can see these packets comming in:
239335 133.833210874 192.168.1.238 239.255.42.42 MPEG TS 1358 [MP2T fragment of a reassembled packet]
the file created in /tmp is always empty. am i doing something wrong?
How do I use your tool to capture the video and display in VLC? Your blog says it is possible but there are no examples to show how to do it.
Edit 4:
On the chance that I do get the glitchy output, it looks like this:
https://i.imgur.com/nXOzjOG.png
I tried mutliple sources.
Edit 3:
Doesn't seem to work anymore, for some reason, not even the glitchy video output.
Edit 2:
Alright, I had to use the Destination ip and port.
"ffplay -i udp://@226.2.2.2:2068" gave me some glitchy video, but it's something.
Edit 1:
On second thought, the packages seem to be MPEG packages actually. But I still can't seem to record or stream them (correctly).
I am using the v0.2 .deb release, having hooked the v2.0 HDMI Extender TX Sender hooked up through Ethernet directly on one of my two Ethernet ports on my motherboard.
Screenshot:
https://i.imgur.com/Y2Chyqb.jpg
The activation trigger activation works, it starts sending out data.
But the de-ip-hdmi program doesn't seem to do anything with it, see the screenshot. (I did hit Ctrl+C after a while)
Nor does Wireshark seem to interpret anything as mpeg packages?
I also tried using VLC during this, capturing a network steam with: "udp://@192.168.168.55:48689", but it doesn't seem to exist.
I might be missing something here, the board I have is identical to the one used in benjojo's blog.
Could the darker output be because gamma is applied by the device outputting to hdmi, then once this is used as input, gamma will be applied again before it is sent to output?
I see you are writing an MKV, but could this be consumed by https://obsproject.com/ ?
Would be great if it is seen as a webcam, as it will be very versatily to be able to do streaming.
This is a brilliant project. I wonder if there is any hint about which chips are supported by this algorithm. That is, compatibility for http://www.ebay.co.uk/itm/121708232481 this one is granted, while there are quite similar devices at http://www.ebay.de/itm//191286580723 or http://www.ebay.de/itm/142015060670 here available in the Germany eBay (way cheaper for me).
Do you have any idea what could tell us about if this program or a similar approach would work before buying such a device?
Hi, I'm new to go so sorry if this is a really dumb question, but do I have to do something special to create a binary prog from main.go? I've tried what seems to be the obvious choice: "go build main.go" but the resulting binary executes but doesn't actually work (the sender never starts streaming). The ready built package for Ubuntu/Debian works fine so I know my kit is all wired up correctly...
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.