Difference between revisions of "Video"
(26 intermediate revisions by 10 users not shown) | |||
Line 38: | Line 38: | ||
== Display == | == Display == | ||
CRT television sets seem to have the best picture. It blurs out the pixels that the human eye can see and the eye is very good at adapting to it. We used them whenever transport was not an issue. If not possible, small TFT video screens intended for car entertainment were used. | |||
== Digital Display == | == Digital Display == | ||
Line 50: | Line 50: | ||
===Pollin USB R1=== | ===Pollin USB R1=== | ||
The [http://www.pollin.de/shop/dt/NzM4OTE0OTk-/Haustechnik/Sicherheitstechnik/Kameras/USB_Funkkamera_2_4_GHz.html Pollin USB-R1] requires no additional software drivers since the release of Ubuntu 10.04 (Lucid Lynx). It now works out of the box. | |||
====Watching Video==== | |||
Watch video with (maybe adjust the NORM to PAL or whatever your cameras standard is): | |||
mplayer tv:// -tv driver=v4l2:width=320:height=240:norm=NTSC:input=0:device=/dev/video0:noaudio | |||
====LinuxTv==== | ====LinuxTv (old driver)==== | ||
http://www.linuxtv.org/wiki/index.php/Em28xx_devices | http://www.linuxtv.org/wiki/index.php/Em28xx_devices | ||
Line 65: | Line 70: | ||
shell> mplayer tv:// -tv driver=v4l2:width=320:height=240:norm=PAL:input=1:device=/dev/video0:noaudio -vo x11 | shell> mplayer tv:// -tv driver=v4l2:width=320:height=240:norm=PAL:input=1:device=/dev/video0:noaudio -vo x11 | ||
====Linux Kernel 2.18 (old driver)==== | |||
====Linux Kernel 2.18==== | |||
Some work is needed to get it to run with Linux as it needs a recent and patched version of the em28xx driver (this will get easier as the patches are integrated to v4l). You need some version control system as well as the kernel headers and video encoders, do as root: | Some work is needed to get it to run with Linux as it needs a recent and patched version of the em28xx driver (this will get easier as the patches are integrated to v4l). You need some version control system as well as the kernel headers and video encoders, do as root: | ||
Line 89: | Line 92: | ||
options em28xx card=62 | options em28xx card=62 | ||
====Linux Kernel 2.26==== | ====Linux Kernel 2.26 (old driver)==== | ||
The changes to the emb28xx driver have now been [http://mcentral.de/hg/~mrec/em28xx-new/rev/94d8ffd2d696 integrated upstream]. To build the driver, follow the [http://mcentral.de/wiki/index.php5/Installation_Guide instructions on the emb28xx driver website.] | The changes to the emb28xx driver have now been [http://mcentral.de/hg/~mrec/em28xx-new/rev/94d8ffd2d696 integrated upstream]. To build the driver, follow the [http://mcentral.de/wiki/index.php5/Installation_Guide instructions on the emb28xx driver website.] | ||
Line 96: | Line 99: | ||
options em28xx card=76 | options em28xx card=76 | ||
=== | ===Using separate Frame Grabber and Video Receiver=== | ||
This solution provides maximum possible range, video quality and flexiblity due to modularity. Though it requires more hardware than the integrated [[Video#Pollin_USB_R1|Pollin USB R1]] solution. | |||
====Frame Grabber==== | |||
A frame grabber takes the output of any video receiver and streams it into Linux. | |||
[[Image:AVerMedia_EZMaker.jpg|thumb|left|AVerMedia DVD EZMaker USB 2.0 Gold]] | |||
The AVerMedia DVD EZMaker USB 2.0 Gold works well and comes with a Linux driver. | |||
The Easycap DC60+ (with Empia chip) works well and is less expensive but not as compact as the Pollin unit. | |||
The video stream can be directly integrated into the GCS as described in [[GCS#Video_Plugin|Video Plugin]]. | |||
<br style="clear:both"> | <br style="clear:both"> | ||
==== | ====Video Receiver==== | ||
[[Image:YellowJacket_Pro.jpg|thumb|left|Yellowjacket Pro Video Receiver 2.4GHz]] | [[Image:YellowJacket_Pro.jpg|thumb|left|Yellowjacket Pro Video Receiver 2.4GHz]] | ||
This | This diversity receiver provides high range and video quality. Especially when connected to high gain patch antennas. | ||
<br style="clear:both"> | <br style="clear:both"> | ||
== Streaming == | == Streaming == | ||
The USB video converters can be used to do live streams over the internet as seen at 24C3. We | The USB video converters can be used to do live streams over the internet as seen at 24C3. We used [http://www.litech.org/spook/ spook] to receive the video data from the USB converter, compress it with MPEG4 and send it using the rtsp protocol. Spook needs some patches to work with the Pollin converter. Build it from Paparazzi cvs: | ||
cd sw/in_progress/videolizer/spook | cd sw/in_progress/videolizer/spook | ||
Line 140: | Line 142: | ||
vlc rtsp://localhost:7070/webcam | vlc rtsp://localhost:7070/webcam | ||
Note: a first time spook user must | Note: a first time spook user must choose the correct video camera output format i.e. NTSC or PAL, for instance. Navigate to ~paparazzi3/sw/in_progress/videolizer/spook/spook.conf.usbraw/input VL42/InputType PAL; The CVS default is set as PAL. | ||
Somehow the standard Debian 4.0 (etch) mplayer does not support rtsp:// video. The debian-multimedia.org mplayer seems to work. It can be installed adding to /etc/apt/sources.list: | Somehow the standard Debian 4.0 (etch) mplayer does not support rtsp:// video. The debian-multimedia.org mplayer seems to work. It can be installed adding to /etc/apt/sources.list: | ||
Line 173: | Line 175: | ||
===Remote Client Connection Configuration=== | ===Remote Client Connection Configuration=== | ||
[[Image:VLC_front_page.jpg|thumb|left|VLC Media Player]] | [[Image:VLC_front_page.jpg|thumb|left|VLC Media Player]] | ||
Windows client users will have to | Windows client users will have to [http://www.videolan.org/ download VLC Media Player] to view JPEG/HTTP video as defined in ~paparazzi3/sw/in_progress/videolizer/spook/spook.conf.dist | ||
<br style="clear:both"> | <br style="clear:both"> | ||
Line 199: | Line 201: | ||
= Digital Video = | = Digital Video = | ||
A fast digital telemetry link would be needed to send usable digital video. There are [http://www.comedia.com.cn/sm/C328.pdf serial bus cameras] that could be hooked up to the autopilot and the image data be sent through telemetry. | |||
A full integration of a [https://store.gumstix.com/caspa-fs.html Caspa FS camera] on a [[Lisa]]/L board is currently under [[Dev/Caspa|development]]. | |||
= On-Screen Display (OSD) = | = On-Screen Display (OSD) = | ||
Line 209: | Line 213: | ||
A number of OSD devices exist. | A number of OSD devices exist. | ||
[[Category:Hardware]] [[Category:User_Documentation]] | |||
== IVY to Mavlink to UDP to UART == | |||
$ mavlink-ivy-interface 127.0.0.1 | |||
$ stty -F /dev/ttyUSB1 57600 | |||
$ nc -l -u 127.0.0.1 14550 > /dev/ttyUSB1 | |||
== MinimOSD / ground side == | |||
Atmega 328P with MAX7456.<br/> | |||
[https://code.google.com/p/arducam-osd/wiki/minimosd MinimOSD Google Code page]<br/> | |||
[http://www.youtube.com/watch?v=oJlb4Fh3DVA&feature=youtu.be YouTube example Video]<br/> | |||
'''Note''': MinimOSD has been discontinued and was replaced by [https://github.com/diydrones/alceosd AliceOSD] | |||
Ground Station set up | |||
git clone git://github.com/mavlink/mavlink-ivy-interface.git | |||
cd mavlink-ivy-interface/ | |||
sudo apt-get install cmake | |||
./osd.sh |
Latest revision as of 18:50, 7 January 2016
The main application for small UAVs is video. There are various means to take pictures from the aircraft and transfer them to the ground.
Analog Video
The easiest and most practical way is to transfer video in an analog way either as NTSC or PAL signal. The picture is taken by a camera, put to an analog signal and sent through an FM modulated transmitter.
Cameras
Affordable CCD cameras tend to be better in dynamic range and noise than same price CMOS cameras. On the other side CMOS ones do need less energy and they are more likely to run with 5V.
Small digital handheld cameras do have a much better optical system and sensor than stand alone cameras. There are ongoing efforts to reduce size and weight to be able to implement them.
Recommended cameras
A good selection of miniature cameras can be found at Microcameras.com. If you´re looking for Panasonic KX-xxx cameras find them here: RangeVideo.
- Simple, lightweight camera with good performance
Panasonic KX-141 (a.k.a. Pacific Corp. PC-2005) CCD
- Available at Black Widow AV
- Available here too RangeVideo
Pan/tilt mechanism
For help in building a pan/tilt camera mechanism see our pan/tilt camera page. Code for driving such as system is in /sw/airborne/cam.c
Transmitter
There are various FM transmitters available at 10mW, 50mW, 200mW or even more. Keep them as far away from the GPS receiver/antenna as possible as they might cause severe interference. For the competitions mostly 50mW or 200mW transmitters have been used.
Standard 2.4GHz Wi-Fi antennas can be used as lightweight dipole antennas by breaking the plastic case and removing everything except the coaxial cable and the counter balance soldered to the shield.
Receiver
The most important thing about the receiver is a good antenna (we used a 2.4GHz Yagi (532-4474 from RS components) at some competitions, also some patch antennas). The analog receiver modules itself do not seem to differ very much.
Display
CRT television sets seem to have the best picture. It blurs out the pixels that the human eye can see and the eye is very good at adapting to it. We used them whenever transport was not an issue. If not possible, small TFT video screens intended for car entertainment were used.
Digital Display
There is a TFT screen in the ground station, so why not use it? For that the picture does need to be digitized and feed into the laptop. In the early days we used a Plextor M402U to digitize and MPEG4 compress the analog video. It was then recorded or decompressed and displayed on screen. The drawback on this nice box is the delay you get through compressing/decompressing plus the size and the need for an external video receiver and power supply. A lot easier to use is the Pollin USB-R1 which includes an analog video receiver and an USB (High Speed) digitizer. It does not need any external component or power supply.
Plextor M402U
This box not really recommended any more. With a recent kernel and driver patches from the Paparazzi cvs it should be possible to get it to run.
Pollin USB R1
The Pollin USB-R1 requires no additional software drivers since the release of Ubuntu 10.04 (Lucid Lynx). It now works out of the box.
Watching Video
Watch video with (maybe adjust the NORM to PAL or whatever your cameras standard is):
mplayer tv:// -tv driver=v4l2:width=320:height=240:norm=NTSC:input=0:device=/dev/video0:noaudio
LinuxTv (old driver)
http://www.linuxtv.org/wiki/index.php/Em28xx_devices
shell> hg clone http://linuxtv.org/hg/v4l-dvb
shell> cd v4l-dvb shell> make shell> sudo make install
shell> mplayer tv:// -tv driver=v4l2:width=320:height=240:norm=PAL:input=1:device=/dev/video0:noaudio -vo x11
Linux Kernel 2.18 (old driver)
Some work is needed to get it to run with Linux as it needs a recent and patched version of the em28xx driver (this will get easier as the patches are integrated to v4l). You need some version control system as well as the kernel headers and video encoders, do as root:
aptitude install mercurial linux-headers-$(uname -r) libxvidcore4 libxvidcore-dev mplayer
Get the video4linux drivers using the (v4l) special version control system, as user:
hg clone http://mcentral.de/hg/~mrec/v4l-dvb-kernel
Copy over the two changed files "em28xx-cards.c" and "em28xx.h" from sw/in_progress/videolizer/v4l-dvb-experimental/ to the v4l-dvb-kernel/linux/drivers/media/video/em28xx/ folder. Then build v4l-dvb as user:
cd v4l-dvb-kernel make
And install as root (you have to do this each time you update the kernel):
make install
Add the follwing to /etc/modprobe.d/emb28xx (as the Pollin USB-R1 does not have an EEPROM for auto detect.)
options em28xx card=62
Linux Kernel 2.26 (old driver)
The changes to the emb28xx driver have now been integrated upstream. To build the driver, follow the instructions on the emb28xx driver website.
Add the follwing to /etc/modprobe.d/emb28xx (as the Pollin USB-R1 does not have an EEPROM for auto detect.)
options em28xx card=76
Using separate Frame Grabber and Video Receiver
This solution provides maximum possible range, video quality and flexiblity due to modularity. Though it requires more hardware than the integrated Pollin USB R1 solution.
Frame Grabber
A frame grabber takes the output of any video receiver and streams it into Linux.
The AVerMedia DVD EZMaker USB 2.0 Gold works well and comes with a Linux driver.
The Easycap DC60+ (with Empia chip) works well and is less expensive but not as compact as the Pollin unit.
The video stream can be directly integrated into the GCS as described in Video Plugin.
Video Receiver
This diversity receiver provides high range and video quality. Especially when connected to high gain patch antennas.
Streaming
The USB video converters can be used to do live streams over the internet as seen at 24C3. We used spook to receive the video data from the USB converter, compress it with MPEG4 and send it using the rtsp protocol. Spook needs some patches to work with the Pollin converter. Build it from Paparazzi cvs:
cd sw/in_progress/videolizer/spook ./configure
All encoders should be enabled. Then build it:
make
and start it
./spook -c spook.conf.usbraw
Watch video through vlc from it
vlc rtsp://localhost:7070/webcam
Note: a first time spook user must choose the correct video camera output format i.e. NTSC or PAL, for instance. Navigate to ~paparazzi3/sw/in_progress/videolizer/spook/spook.conf.usbraw/input VL42/InputType PAL; The CVS default is set as PAL.
Somehow the standard Debian 4.0 (etch) mplayer does not support rtsp:// video. The debian-multimedia.org mplayer seems to work. It can be installed adding to /etc/apt/sources.list:
deb http://www.debian-multimedia.org etch main
and install with
aptitude install -t stable mplayer
Forward USB Streaming Video over a Mobile TCP/IP Link to a Remote Windows Viewer
If one has installed a fully functional USB video streaming payload, as outlined above, and wishes to share the output with associates beyond the perimeter of the local gcs TFT, implement the following.
Modem Hardware
Mobile modem choice is up to the user and ability to configure the interface to an ISP. The model described here and utilised for now is a Vodafone/Huawei E800 HSDPA 3G mobile data card. Compatible with Express Card laptops.
Modem Linux Drivers
Download the appropriate vodafone-mobile-connect-card-driver-for-linux for your Linux OS release at
Forge Vodafone Betavine. The Unbuntu Gutsy Gibbon & Hardy Heron version used by me can be loaded here: vodafone-mobile-connect-card-driver-for-linux-2.0.beta2-ubuntu-installer.run. Right click link, choose 'save link as' to your home folder. Check the permissions tab to allow the downloaded file to run as an executable. Run file. Follow the instructions in the README.
Warning - the user is advised to install the data card in the express card slot prior to booting and turn off the wifi radio before intialising the software found in the /Applications/Internet drop down menus. Furthermore, the later procedure should be instituted before starting spook.
The local gcs server should be ready now to transmit video as well as other data once a connection to the ISP is established. Confirm this by getting the IP address, as user:
ifconfig
Remote Client Connection Configuration
Windows client users will have to download VLC Media Player to view JPEG/HTTP video as defined in ~paparazzi3/sw/in_progress/videolizer/spook/spook.conf.dist
To faciltate a secure SSH TCP forward port connection from the host to the Windows client install PuTTY here:
PuTTY Download page. Insert the gcs host Mobile IP address obtained from the remote operator via a preferred form of communication .ie. chat, email etc.in the box labelled 'Host Name (or IP address)'. Confirm Port 22 is chosen and the connection type is SSH. Expand SSH category in left panel and click 'tunnels'. See next box.
Tick both port forwarding options. Set Source port to '80' and destination to 'localhost:7070/webcam'. Click 'Add' and then 'Open'. See next box.
The information contained within this terminal is self explanatory after a successful login.
Open VLC, click 'file', select 'open network stream' and then 'HTTP/HTTPS/FTP/MMS'. Enter 'localhost:80/webcam' in the URL box and select 'Open'. See next box.
Hopefully, whatever the on board camera is viewing is faithfully reproduced in the window. Unfortunately, the 'Print Screen' function fails to capture the live video output.
Digital Video
A fast digital telemetry link would be needed to send usable digital video. There are serial bus cameras that could be hooked up to the autopilot and the image data be sent through telemetry.
A full integration of a Caspa FS camera on a Lisa/L board is currently under development.
On-Screen Display (OSD)
There are some situations where on-board data needs to be overlayed on the video stream. Examples include:
- Alternative display of on-board data without a telemetry link and GCS;
- In Australia, 2.4GHz analogue video links with OSD are considered as "telemetry transmitters" allowing 1000mW EIRP emission without a licence; or
- Sending a callsign when operating under an amateur licence.
A number of OSD devices exist.
IVY to Mavlink to UDP to UART
$ mavlink-ivy-interface 127.0.0.1 $ stty -F /dev/ttyUSB1 57600 $ nc -l -u 127.0.0.1 14550 > /dev/ttyUSB1
MinimOSD / ground side
Atmega 328P with MAX7456.
MinimOSD Google Code page
YouTube example Video
Note: MinimOSD has been discontinued and was replaced by AliceOSD
Ground Station set up
git clone git://github.com/mavlink/mavlink-ivy-interface.git cd mavlink-ivy-interface/ sudo apt-get install cmake ./osd.sh