Before you can use these commands, you need to configure, build, and run the HdmiExtenderService.

You can ensure it is working by loading http://localhost:18080/raw.html This page loads the mjpeg video with the lowest possible latency (I did not measure, but it feels like under 200ms). I recommend you use Google Chrome. In fact this is probably the best way you can view the video if you do not care about audio.

If you obtain ffmpeg and VLC, I have prepared several ways to display the video and audio together.

This command will have ffmpeg pull audio and video, transcode to H.264/mp3, and pipe the output to VLC media player. Total latency is a rather painful 4+ seconds but quality is usually very good.

 ffmpeg -f mjpeg -i http://localhost:18080/image.mjpg -ar 48000 -ac 2 -f s32be -i 

http://localhost:18080/audio.wav -vcodec libx264 -b:v 3072k -acodec 

libmp3lame -b:a 128k -pix_fmt yuvj420p -f mpegts - | "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" - 

--network-caching=500 


Here is an alternative set of arguments that reduces latency and CPU usage as much as I know how to, in an attempt to optimize for internet streaming. Note specifically the addition of a -framerate 30 argument for the mjpeg input. This value reduces latency of the stream by about a half a second without any apparent negative effect, as long as the actual frame rate is 25 fps. It is kind of a magic value and if it is set too high compared to the actual frame rate, there will be pauses and possibly video corruption.

 ffmpeg -f mjpeg -i http://localhost:18080/image.mjpg -ar 48000 -ac 2 -f s32be -i http://localhost:18080/audio.wav -vcodec libx264 -b:v 3072k -minrate 2048k -maxrate 4096k -acodec libmp3lame -b:a 128k -pix_fmt yuvj420p -f mpegts - | "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" - --network-caching=500 


Finally, this can achieve even lower latency by skipping the h.264 encoding and just copying the video stream.

 ffmpeg  -framerate 30 -fflags nobuffer -f mjpeg -i http://localhost:18080/image.mjpg -ar 48000 -ac 2 -f s32be -i http://localhost:18080/audio.wav -vcodec copy -acodec libvo_aacenc -b:a 128k -bufsize 50k -f matroska - | "C:\Program Files (x86)\VideoLAN\VLC\vlc.exe" - --network-caching=0 


None of these commands are quite perfect. They are all the result of much trial and error, and general confusion over why there is so much latency. Some of the arguments may do little or nothing at all. Further, I sometimes inexplicably get a lot of bad frames in H.264 video, using configurations that had worked well earlier. I don't know whether I should blame the Sender device, ffmpeg, my PC, my USB 3.0 network adapter, or myself.


Last edited Dec 11, 2014 at 4:09 PM by bp2008, version 5