It's Alessio Placitelli's playground
Streaming live camera feed to Dreambox
A friend of mine, who helps running a very small TV network in my city, asked me if I could help finding a affordable solution to a problem he had. He needed to connect two studios using a ~20Km wireless bridge, in order to make it possible for a studio to stream live video to the other. The receiver was required to have an analog output (example: SCART), so that it could coexist with other equipment. Since I love Dreambox I gave it a try
Let’s start with some ingredients for our recipe:
- A Dreambox (I’m using a DM600PVR with no HDD, but any Dreambox with an ethernet adapter should work)
- Gemini Firmware Image for your Dreambox version
- VLC Media Player for Windows (>= v 0.8.5)
- A FTP client (example: FileZilla)
- Windows Media Encoder (WME) for Windows (well, I guess there’s no Linux version for that
) - VLCF-Final plugin for Gemini firmware
- A camera and the related hardware to connect it to your PC (Firewire HUB, etc.)
A little bit of… background
It took me some time to figure out how to make my camera stream to the Dreambox. I tried many things, including directly streaming from VLC, without using Windows Media Encoder. It didn’t work. If only I had access to VLCF-Final source code, I could find out how to make it work without wasting resources with the WME step. But why it does work when using WME?
VLCF-Final simply acts as a front-end for the VLC instance on your computer (back-end). It tells the back-end to open the file you choose and to stream it to the Dreambox, transcoding it if needed. The file WME is creating is a .WMV file (like old .ASF files): because of the structure of this file, you can start playing it even if it is getting written on, because it was designed to be used on internet web pages, where you don’t have to wait for it to download completely before playing.
Windows Media Encoder basically keeps writing to the end of the file encoded data received from the camera, while VLC reads it (transcodes it) and sends it on the fly to your box.
Dreambox preparation
Now (1), the very first thing you need to do is to flash the Gemini image on your Dreambox. The net is full of tutorials and how-to about that, so I wont go into details. Just use latest DreamUP. When you’re done, (2) you need to configure network settings for your dreambox to connect to Internet. Simply find “Network Settings” menu and fill your stuff in there (yes, that’s a pretty easy operation, I’m not going to get you lost in details now.. if you need help, you can ask here in comments
). Once you’re done, reboot the box (3), then press the blue button on your remote and go to Plugins menu. Download the plugin list (4) and look for VLCF-Final plugin. Download it (5). Install the FTP client software on your PC and connect to the dreambox using the IP you assigned to it (username: root password: dreambox), browse to /var/tuxbox/config folder and download vlcf_original.xml to your computer (6). Open it with a text editor (do not use windows notepad, instead use something like PSPad), and change it as follows:
- Pick the first line which contains <server> tag (7): it should look like the one below. Change the ip field to match your PC IP (the one which will stream camera feed)
<server name="set1" ip="192.168.128.12" webif-port="8080" stream-port="9090" user="admin" pass="admin" />
- Pick the first line which contains a <config> tag (8) with the same name field of the <server> line you just modified. Fill in the startdir parameter, which tells VLCF-Final where to find the stream file. It should look like that:
<config name="set1" startdir="g:/" cddrive="f:" />
Upload the file back to dreambox (9), overwriting the one in /var/tuxbox/config (feel free to backup old file) and reboot the box again.
PC preparation
Download and install Windows Media Encoder and VLC for Windows (10). Open VLC and go to Preferences->Interfaces->Main Interfaces and enable (tick) “HTTP remote control interface” (11). Save settings and close VLC.
Test 1: video streaming to dreambox
Run VLC on the PC, and leave it opened. Turn on your Dreambox, press the Blue button, and go to Plugins menu. Run VLCF-Final. Press the Red button (should be bound to “File” action) and a list of files will appear. Yes, that’s the files in the folder you wrote in vlcf_original.xml file! Just select any file, press OK, and it should play
If it doesn’t display any file, you’ve probably forgot to configure or start VLC on your PC, or messed up with steps (7) or (8). Double check that VLC can open and play the file you’re trying to play as well.
Test 2: camera streaming to Dreambox
Connect your camera to the PC and, if your speakers are ON, you should hear a “din dong” sound. That’s good, camera is connected. Now run WME and go to “File->New” and then, in the Wizards panel, choose “Broadcast a live event” (12). When asked for input devices, select your camera from both video and audio dropdown menus. In broadcast method, be sure to select “Pull from the encoder” method. Next page will prompt for session settings (port to stream on, etc.); we won’t be using this stuff, so just skip it until you reach the bitrates page. In this page, depending on your PC horsepower, choose the desired bitrate. Keep in mind: the lower, the faster! We’re almost done. It will now ask if you want to archive a copy of the broadcast on your hard drive. That’s what you want to do. Be sure to make it create the file in the path you specified in vlcf_final.xml file. Click on “Finish”, and it should start the show. Get to your Dreambox, open VLCF-Final plugin, browse to the broadcast file and play it. Enjoy the show!
Further enhancements
This method isn’t exactly perfect or elegant. To tell the truth, it is a real mess
That’s what can be done to get it working better:
- Tweak WME bitrates to lower latency
- Avoid the use of WME and direct stream from camera using VLC
- Modify VLCF-Final plugin to enable a “Listen” mode, where it just listens for streams without having to manually browse for the stream file
I really hope this stuff will help. If you have any suggestion, problem or you just found a grammar error in my italenglish, don’t forget to leave me a comment down there ![]()
| Print article | This entry was posted by Alessio Placitelli on 6 January 2008 at 16:07, and is filed under Tips and Tricks. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |
English
about 2 years ago
Everything seemed to be fine,according to the guide step by step,it was buffering but every every time it didin’t work.Enigma was restarting every time when the buffering ended.
Same with P2P and camera.
The stream ok,Vlcf ok,interface ok,WMPE but nothing.The yellow bar was fulling but at 100% in the end it was just restarting enigma.
Do you know why.
Thanks anyway for those fantastic guides.
about 2 years ago
Thank you
Try to look for crash information in your /var/log/messages e /var/log/syslog (by logging into your box using Telnet) .. if you find something, feel free to paste it here so I can examine it!
about 2 years ago
Hi Alessio,i use an FTP client,not directly telnet commands, so i find out that i have 3 files in var/log directory,i dont see any var/syslog directory.
The first is wtmp(6kb),the second with the name lastlog (0 bytes) and the last is a txt with lot of stuff inside but no error as far as i can see.
Thu Jan 31 19:01:58 2008 [pid 539] CONNECT: Client “192.168.2.2″
Thu Jan 31 19:01:58 2008 [pid 538] [root] OK LOGIN: Client “192.168.2.2″
Thu Jan 31 19:01:58 2008 [pid 540] [root] OK DOWNLOAD: Client “192.168.2.2″, “/etc/tuxbox/config/vlcf.xml”, 5568 bytes, 268.28Kbyte/sec
Thu Jan 31 19:02:05 2008 [pid 540] [root] OK UPLOAD: Client “192.168.2.2″, “/etc/tuxbox/config/vlcf.xml”, 5567 bytes, 762.38Kbyte/sec
Thu Jan 31 19:03:13 2008 [pid 540] [root] OK DOWNLOAD: Client “192.168.2.2″, “/etc/tuxbox/config/vlcf.xml”, 5567 bytes, 425.83Kbyte/sec
Thu Jan 31 19:03:22 2008 [pid 540] [root] OK UPLOAD: Client “192.168.2.2″, “/etc/tuxbox/config/vlcf.xml”, 5567 bytes, 141.78Kbyte/sec
Thu Jan 31 19:11:45 2008 [pid 550] CONNECT: Client “192.168.2.2″
Thu Jan 31 19:11:45 2008 [pid 549] [root] OK LOGIN: Client “192.168.2.2″
I dont see an error,its the same to the end.The connection seems to be fine,i can see my files and my directories,i can see the .wmn file the dream buffers it but in the and enigma restarts.I am confused.
Thanks for your help
about 2 years ago
What’s your dreambox model and image version?
about 2 years ago
Gemini 4.2 and my dreambox is 7020Si
about 2 years ago
That’s weird
What’s your computer OS? I heard there are some problems with Windows Vista acting as a back end, which are fixed using SP1.
about 2 years ago
Windows XP SP2,Alessio thanks.Maybe its a tiny setting that i didint figure out.Maybe its my mistake,dont bother,i will test again and report
about 2 years ago
Nevermind
I would personally bet on some image-related problem or incompatibility. Try to ask for help on Gemini Image forum ( http://www.i-have-a-dreambox.com )
If you find a workaround to your problem, could you post it here for further reference? Thank you ^_^