一、简介
视频硬件编解码主要用到的是
GST-Ducati,GST-Ducati是gstreamer的一个插件。在GST-Ducati中用ibdce
library来进行编解码。
二、编码器和解码器的元素
- ducativc1dec: VC1 解码器
- ducatimpeg2dec: MPEG2 解码器
- ducatimpeg4dec: MPEG4 解码器
- ducatih264dec: H264 解码器
- ducatimpeg4enc: MPEG4 编码器
- ducatih264enc: H264 编码器
三、
GST-Ducati管道实例
1.解码器
GST-Ducati解码器是自动选择播放视频。(使用选项- V看看元素被使用):
gst-launch playbin2 uri=file://home/user/sample.mp4
gst-launch filesrc location=/home/user/sample.mp4 ! decodebin2 ! pvrvideosink
gst-launch filesrc location=/home/user/sample.mp4 ! qtdemux ! h264parse ! ducatih264dec ! pvrvideosink
2.编码器
摄像头的视频文件编码
gst-launch -e v4l2src ! "video/x-raw-yuv, width=640, height=480,framerate=30/1" ! queue ! ffmpegcolorspace ! ducatih264enc ! h264parse ! qtmux ! filesink location=sample.mp4
3.编码器+解码器
gst-launch -v v4l2src ! stridetransform ! tee name=t
t. ! queue ! dri2videosink sync=false
t. ! queue ! ducatih264enc rate-preset=low-delay profile=100 ! h264parse ! ducatih264dec ! queue ! pvrvideosink sync=false
四、参数介绍
可以通过gst-inspect 参数 来查看gst-launch的参数说明,比如 gst-inspect playbin2
1.
playbin2
Name: playback
Description: various playback elements
Filename: /usr/lib/arm-linux-gnueabihf/gstreamer-0.10/libgstplaybin.so
Source module: gst-plugins-base
2.filesrc
Name:
coreelements
Description:
Read from arbitrary point in a file
Filename:
/usr/lib/i386-linux-gnu/gstreamer-0.10/libgstcoreelements.so
Source module:
gstreamer
3.decodebin2
Factory Details:
Description:
Autoplug and decode to raw media
Name:
uridecodebin
Description:
URI Decoder bin
Source module:
gst-plugins-base