KOH_Linux_USB_Camera

Video Encode with USB Camera

Video encode in Linux is supported up to standard definition at 30 fps.

1. Connect USB camera to the Atom E6xx board.

2. Try to run a simple camera test using the following command:

For Timesys Fedora Remix 14, use the following command:

gst-launch v4l2src ! ffmpegcolorspace ! xvimagesink

For MeeGo 1.2, use the following command:

gst-launch-0.10 v4l2src ! ffmpegcolorspace ! xvimagesink

If the camera is not being detected, this might be because the UVC driver is not installed. You can download uvcvideo-756ad91a832e[1].tar.gz from
http://linux-uvc.berlios.de/#download.

3. To encode video to an H.264 file:

For Timesys Fedora Remix 14, use the following command:

gst-launch -e v4l2src ! ffmpegcolorspace ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! MixVideoEncoderH264 need-display=1 name=enc ! queue ! qtmux ! queue ! filesink location=/root/camera.h264 enc. ! vaimagesink

For MeeGo 1.2, use the following command:

gst-launch-0.10 -e v4l2src ! ffmpegcolorspace ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! MixVideoEncoderH264 need-display=1 name=enc ! queue ! qtmux ! queue ! filesink location=/root/camera.h264 enc. ! vaimagesink

4. To encode video to a MPEG-4 part 2 file:

For Timesys Fedora Remix 14, use the following command:

gst-launch -e v4l2src ! ffmpegcolorspace ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! MixVideoEncoderMPEG4 need-display=1 name=enc encode-format=video/mpeg profile=2 ! queue ! qtmux ! queue ! filesink location=/root/camera.mpeg4 enc. ! vaimagesink

For MeeGo 1.2, use the following command:

gst-launch-0.10 -e v4l2src ! ffmpegcolorspace ! 'video/x-raw-yuv,width=640,height=480,framerate=30/1' ! MixVideoEncoderMPEG4 need-display=1 name=enc encode-format=video/mpeg profile=2 ! queue ! qtmux ! queue ! filesink location=/root/camera.mpeg4 enc. ! vaimagesink

5. To play back the recorded video:

For Timesys Fedora Remix 14, use the following command:

gst-launch filesrc location=camera.mpeg4 ! qtdemux ! queue ! MixVideoDecoderMPEG4 ! vaimagesink

For MeeGo 1.2, use the following command:

gst-launch-0.10 filesrc location=camera.mpeg4 ! qtdemux ! queue ! MixVideoDecoderMPEG4 ! vaimagesink

6. To get more details on encoder properties, execute:

For Timesys Fedora Remix 14, use the following command:

gst-inspect MixVideoEncoderMPEG4

For MeeGo 1.2, use the following command:

gst-inspect-0.10 MixVideoEncoderMPEG4

Intel® EMGD supports encode of four channels of H.264 streams (four V4l2 cameras input) simultaneously. To encode the video streams simultaneously, open four terminals/application where each terminal/application runs one video capture stream.

Note: Use GStreamer framework for the video encode, and the maximum supported resolution is CIF(352x288) per stream.

• For Timesys Fedora Remix 14, use the following command for each stream:

gst-launch -e v4l2src ! ffmpegcolorspace ! 'video/x-raw-yuv,width=352,height=288,framerate=15/1' ! MixVideoEncoderH264 need-display=1 name=enc ! queue ! qtmux ! queue ! filesink location=/root/camera.h264 enc. ! vaimagesink

• For MeeGo 1.2, use the following command for each stream:

gst-launch-0.10 -e v4l2src ! ffmpegcolorspace ! 'video/x-raw-yuv,width=352,height=288,framerate=15/1' ! MixVideoEncoderH264 need-display=1 name=enc ! queue ! qtmux ! queue ! filesink location=/root/camera.h264 enc. ! vaimagesink




*Other names and brands may be claimed as the property of others.
Revised April 2013