Install GStreamer under Ubuntu14.04 to test UVC H264 Camera__ubuntu installation GStreamer

Source: Internet
Author: User
Tags bz2 gstreamer

Ubuntu14.04 install GStreamer to test UVC H264 Camera

Recently debugging UVC H264 Camera, need to test the camera in Ubuntu, so with the help of GStreamer to achieve.


Gtreamer is a programming framework based on the glib library (the latest version needs glib2.0) to build streaming media applications, the goal of which is to simplify the development of audio/video applications that can now be used to deal with such as MP3, Ogg, MPEG1, MPEG2, AVI, Multimedia data in various formats such as Quicktime.


First, install dependent libraries:
sudo apt-get install Bison flex zlib1g yasm


Second, download the installation package:


1, Gstreamer-1.3.1.tar.xz http://gstreamer.freedesktop.org/src/gstreamer/


2, Gst-plugins-base-1.3.1.tar.xz http://gstreamer.freedesktop.org/src/gst-plugins-base/


3, Gst-plugins-good-1.3.1.tar.xz Http://gstreamer.freedesktop.org/src/gst-plugins-good



4, GST-PLUGINS-UGLY-1.3.1.TAR.XZ
http://gstreamer.freedesktop.org/src/gst-plugins-ugly/


5, Gst-plugins-bad-1.3.1.tar.xz
Https://gstreamer.freedesktop.org/src/gst-plugins-bad/gst-plugins-bad-1.3.1.tar.xz


Use plug-in avdec_h264 need to install Gst-ffmpeg (gst-ffmpeg version V1.0 renamed to GST-LIBAV), install gst-ffmpeg need to install last_x264.tar.bz2
6, last_x264.tar.bz2
https://pan.baidu.com/share/link?shareid=2659340460&uk=4027341910&fid=588638103197893


7, Gst-libav-1.3.1.tar.xz
http://gstreamer.freedesktop.org/data/src/gst-libav/


Third, installation steps


Installation considerations:
gst-plugins-good-1.3.1 relies on gst-plugins-base-1.3.1, so install gst-plugins-good-1.3.1 and install gst-plugins-base-1.3.1 first.


1. Installation gstreamer-1.3.1
Xz-d GSTREAMER-1.3.1.TAR.XZ
Tar xvf Gstreamer-1.3.1.tar
CD gstreamer-1.3.1
./configure///default install to/usr/local directory; If custom directory, use--prefix= absolute path;
Make
sudo make install


2. Installation gst-plugins-base-1.3.1
Xz-d GST-PLUGINS-BASE-1.3.1.TAR.XZ
Tar xvf Gst-plugins-base-1.3.1.tar
CD gst-plugins-base-1.3.1
./configure//Ibid. consistent
Make
sudo make install


3. Installation gst-plugins-good-1.3.1
Xz-d GST-PLUGINS-GOOD-1.3.1.TAR.XZ
Tar xvf Gst-plugins-good-1.3.1.tar
CD gst-plugins-good-1.3.1
./configure//Ibid. consistent
Make
sudo make install


4. Installation gst-plugins-ugly-1.3.1
Xz-d GST-PLUGINS-UGLY-1.3.1.TAR.XZ
Tar xvf Gst-plugins-ugly-1.3.1.tar
CD gst-plugins-ugly-1.3.1
./configure//Ibid. consistent
Make
sudo make install


5. Installation gst-plugins-bad-1.3.1
Xz-d GST-PLUGINS-BAD-1.3.1.TAR.XZ
Tar xvf Gst-plugins-bad-1.3.1.tar
CD gst-plugins-bad-1.3.1
./configure//Ibid. consistent
Make
sudo make install


6. Installation last_x264
Xz-d LAST_X264.TAR.XZ
Tar xvf Last_x264.tar
CD last_x264
./configure//Ibid. consistent
Make
sudo make install


6. Installation gst-libav-1.3.1
Xz-d GST-LIBAV-1.3.1.TAR.XZ
Tar xvf Gst-libav-1.3.1.tar
CD gst-libav-1.3.1
./configure//Ibid. consistent
Make
sudo make install


Iv. Run the test

Plug-in Introduction:
1, V4L2SRC: Video capture
2, Ximagesink and Xvimagesink
Both are sink plug-ins for displaying video images, but they are supported in different formats. Ximagesink supports RGB format, does not support YUV format, Xvimagesink support YUV and many other formats.



Start the test below:
(1), gst-launch-1.0 V4L2SRC! Xvimagesink
Collect the view screen and show that there is no error in general. (OK: After executing the command will pop up an interface card)


(2), gst-launch-1.0--GST-DEBUG-LEVEL=4-VVV v4l2src device=/dev/video0! video/x-h264, width=1920, height=1080, FRAMERATE=30/1! H264parse! Filesink location= "test.264"
Receive H264 code stream from UVC camera, parse H264 code stream and save to "test.264" file (H264 format) (OK: Save successfully, can play)
--gst-debug-level=4: Print log, number (4) to represent the level
Device=/dev/video0: Specifies device node, default is/dev/video0
video/x-h264, width=1920, height=1080, FRAMERATE=30/1: Specifies the data format (data format, pixel, and frame rate) of the collection. VIDEO/X-H264: Format filter plug-ins that restrict the format of the data flow in the pipeline (if the format is not restricted, the plug-ins in the entire pipeline automatically negotiate one of the most appropriate data formats).
H264parse: Parsing H264 data
Filesink location= "test.264": Save as test.264 file


(3), gst-launch-1.0--GST-DEBUG-LEVEL=4-VVV v4l2src device=/dev/video0! video/x-h264, width=1920, height=1080, FRAMERATE=30/1! H264parse! avdec_h264! Filesink location= "TEST.YUV"
Receive H264 code stream from UVC camera, parse H264 code stream and decode it, decode it into YUV format data and save it to "Test.yuv" file (YUV format) (OK: Save successfully, can play)
avdec_h264: Decodes H264 data and decodes it into YUV format.


(4), gst-launch-1.0--GST-DEBUG-LEVEL=4-VVV v4l2src device=/dev/video0! video/x-h264, width=1920, height=1080, FRAMERATE=30/1! H264parse! avdec_h264! Xvimagesink
From the UVC camera to receive H264 code stream, the H264 code stream parsing and decoding, decoding into YUV format data after the output display (failure, plus color space conversion on OK, as shown below (5))


(5), gst-launch-1.0--GST-DEBUG-LEVEL=4-VVV v4l2src device=/dev/video0! video/x-h264, width=1920, height=1080, FRAMERATE=30/1! H264parse! avdec_h264! Videoconvert! Xvimagesink
Receive H264 code stream from UVC camera, parse the H264 code stream and decode it, decode it into YUV format data after output display (OK: normal display)
Videoconvert: Do color space conversion


V. Operational errors and Solutions:

1, the use of gstreamer-0.10 or gstreamer-0.11 version of the following problems:

$ gst-launch-0.10 V4L2SRC! Xvimagesink
Caught SIGSEGV accessing address 0x48
Spinning. Please run ' gdb gst-launch 13362 ' to continue debugging, ctrl-c to quit, or ctrl-\ to dump core.

Solution: Change to gstreamer-1.0 version is normal.


2, missing UVCH264SRC plugin

$ gst-launch-1.0 UVCH264SRC! Xvimagesink
Warning:erroneous pipeline:no element "UVCH264SRC"

Solution:
The gst-plugins-bad-1.3.1/sys/uvch264 directory is the code for the UVCH264SRC plug-in (no previous version), in which no compilation was found. After execution./configure found the following information in the configuration information log:

Configure: * * * checking FEATURE:UVC H264
Configure: * * for plug-ins:uvch264 * * *
Checking linux/uvcvideo.h usability ... yes.
Checking linux/uvcvideo.h presence ... yes.
Checking for linux/uvcvideo.h ... yes
Checking for Gst_video ... yes
Checking for G_udev ... no
Checking for LIBUSB ... no
Configure: * * * These plugins won't be built:uvch264

No: Indicates that the library is missing, causing the H264 plug-in to fail to install, and therefore requires a manual installation: sudo apt-get install Libusb-dev Libgudev-1.0-dev, and then recompile gst-plugins-bad-1.3.1.
Execute again./configure later becomes:
Configure: * * * checking FEATURE:UVC H264
Configure: * * for plug-ins:uvch264 * * *
Checking linux/uvcvideo.h usability ... yes.
Checking linux/uvcvideo.h presence ... yes.
Checking for linux/uvcvideo.h ... yes
Checking for Gst_video ... yes
Checking for G_udev ... yes
Checking for LIBUSB ... yes
Configure: * * * These plugins would be built:uvch264
Description The H264 plug-in is properly installed


3, missing avdec_h264 plugin # gst-launch-1.0 V4L2SRC device=/dev/video0! video/x-h264, width=1920, height=1080, FRAMERATE=30/1! H264parse! avdec_h264! Filesink location= "TEST.YUV"
Warning:erroneous pipeline:no element "UVCH264SRC"

Solution:

Install GST-LIBAV-1.3.1.TAR.XZ.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.