使用GStreamer作v4l2摄像头采集和输出到YUV文件及屏幕的相关测试
2010-03-21 07:56
1231 查看
环境:ubuntu 9.10
安装软件:gstreamer 基本包 以及gst-plug-ins-bad, mplayer
1、使用mplayer播放yuv文件
shallon@shallon-desktop:~/yuv_play_test_from_hp$ mplayer test.yuv1 -demuxer rawvideo -rawvideo w=352:h=288
MPlayer SVN-r29237-4.4.1 (C) 2000-2009 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Playing test.yuv1.
rawvideo file format detected.
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
[VO_TDFXFB] Can't open /dev/fb0: No such file or directory.
[VO_3DFX] Unable to open /dev/3dfx.
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 352 x 288 (preferred colorspace: Planar I420)
VDec: using Planar I420 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [xv] 352x288 => 352x288 Planar I420
Selected video codec: [rawi420] vfm: raw (RAW I420)
==========================================================================
Audio: no sound
Starting playback...
V: 1.0 26/ 26 0% 4% 0.0% 0 0
Exiting... (End of file)
--------------------------------------------------------------------------------------------------------------------
2、v4l2 摄像头采集并输出到屏幕
shallon@shallon-desktop:~/yuv_play_test_from_hp$ gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=352,height=288 ! xvimagesink
(gst-launch-0.10:13429): GLib-WARNING **: g_set_prgname() called multiple times
设置暂停管道 ...
管道正在使用且不需要 PREROLL ...
设置播放管道 ...
New clock: GstSystemClock
^CCaught interrupt -- handling interrupt.
中断:停止流水线作业...
Execution ended after 5775814760 ns.
设置暂停管道 ...
正在完成设置管道 ...
正在设置管道为 NULL ...
释放管道资源 ...
-------------------------------------------------------------------------------------------------------------------------
3、v4l2 摄像头采集并输出到yuv文件
gst-launch-0.10 v4l2src ! ffmpegcolorspace ! video/x-raw-yuv, format=/(fourcc/)I420, width=352,height=288 ! filesink location=v4l2.yuv1
shallon@shallon-desktop:~$ gst-launch-0.10 v4l2src ! ffmpegcolorspace ! video/x-raw-yuv, format=/(fourcc/)I420, width=352,height=288 ! filesink location=v4l2.yuv1
(gst-launch-0.10:2152): GLib-WARNING **: g_set_prgname() called multiple times
设置暂停管道 ...
管道正在使用且不需要 PREROLL ...
设置播放管道 ...
New clock: GstSystemClock
^CCaught interrupt -- handling interrupt.
中断:停止流水线作业...
Execution ended after 6094593351 ns.
设置暂停管道 ...
正在完成设置管道 ...
正在设置管道为 NULL ...
释放管道资源 ...
-------------------------------------------------------------------------------------------------------------------------
4、使用gstreamer 将yuv文件读出并显示到屏幕上
shallon@shallon-desktop:~$ gst-launch-0.10 filesrc location=v4l2.yuv1 ! videoparse width=352 height=288 ! xvimagesink
(gst-launch-0.10:2521): GLib-WARNING **: g_set_prgname() called multiple times
设置暂停管道 ...
管道正在 PREROLLING ...
管道预读完成 ...
设置播放管道 ...
New clock: GstSystemClock
收到来自组件“pipeline0”的 EOS 信号。
Execution ended after 4480103264 ns.
设置暂停管道 ...
正在完成设置管道 ...
正在设置管道为 NULL ...
释放管道资源 ...
安装软件:gstreamer 基本包 以及gst-plug-ins-bad, mplayer
1、使用mplayer播放yuv文件
shallon@shallon-desktop:~/yuv_play_test_from_hp$ mplayer test.yuv1 -demuxer rawvideo -rawvideo w=352:h=288
MPlayer SVN-r29237-4.4.1 (C) 2000-2009 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.
Playing test.yuv1.
rawvideo file format detected.
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
open: No such file or directory
[MGA] Couldn't open: /dev/mga_vid
[VO_TDFXFB] Can't open /dev/fb0: No such file or directory.
[VO_3DFX] Unable to open /dev/3dfx.
==========================================================================
Opening video decoder: [raw] RAW Uncompressed Video
VDec: vo config request - 352 x 288 (preferred colorspace: Planar I420)
VDec: using Planar I420 as output csp (no 0)
Movie-Aspect is undefined - no prescaling applied.
VO: [xv] 352x288 => 352x288 Planar I420
Selected video codec: [rawi420] vfm: raw (RAW I420)
==========================================================================
Audio: no sound
Starting playback...
V: 1.0 26/ 26 0% 4% 0.0% 0 0
Exiting... (End of file)
--------------------------------------------------------------------------------------------------------------------
2、v4l2 摄像头采集并输出到屏幕
shallon@shallon-desktop:~/yuv_play_test_from_hp$ gst-launch-0.10 v4l2src ! video/x-raw-yuv,width=352,height=288 ! xvimagesink
(gst-launch-0.10:13429): GLib-WARNING **: g_set_prgname() called multiple times
设置暂停管道 ...
管道正在使用且不需要 PREROLL ...
设置播放管道 ...
New clock: GstSystemClock
^CCaught interrupt -- handling interrupt.
中断:停止流水线作业...
Execution ended after 5775814760 ns.
设置暂停管道 ...
正在完成设置管道 ...
正在设置管道为 NULL ...
释放管道资源 ...
-------------------------------------------------------------------------------------------------------------------------
3、v4l2 摄像头采集并输出到yuv文件
gst-launch-0.10 v4l2src ! ffmpegcolorspace ! video/x-raw-yuv, format=/(fourcc/)I420, width=352,height=288 ! filesink location=v4l2.yuv1
shallon@shallon-desktop:~$ gst-launch-0.10 v4l2src ! ffmpegcolorspace ! video/x-raw-yuv, format=/(fourcc/)I420, width=352,height=288 ! filesink location=v4l2.yuv1
(gst-launch-0.10:2152): GLib-WARNING **: g_set_prgname() called multiple times
设置暂停管道 ...
管道正在使用且不需要 PREROLL ...
设置播放管道 ...
New clock: GstSystemClock
^CCaught interrupt -- handling interrupt.
中断:停止流水线作业...
Execution ended after 6094593351 ns.
设置暂停管道 ...
正在完成设置管道 ...
正在设置管道为 NULL ...
释放管道资源 ...
-------------------------------------------------------------------------------------------------------------------------
4、使用gstreamer 将yuv文件读出并显示到屏幕上
shallon@shallon-desktop:~$ gst-launch-0.10 filesrc location=v4l2.yuv1 ! videoparse width=352 height=288 ! xvimagesink
(gst-launch-0.10:2521): GLib-WARNING **: g_set_prgname() called multiple times
设置暂停管道 ...
管道正在 PREROLLING ...
管道预读完成 ...
设置播放管道 ...
New clock: GstSystemClock
收到来自组件“pipeline0”的 EOS 信号。
Execution ended after 4480103264 ns.
设置暂停管道 ...
正在完成设置管道 ...
正在设置管道为 NULL ...
释放管道资源 ...
相关文章推荐
- <车载物联网项目,视频采集传输部分,第二天> 使用ffserver输出视频文件流,并且使用使用命令行终端播放视频文件
- V4L2视频采集以及使用libjpeg 用yuv转JPEG
- Gstreamer实现摄像头的远程采集,udp传输,本地显示和保存为AVI文件 发送端
- 在Android上使用FFmpeg将摄像头采集的YUV裸流编码为h264。
- Gstreamer实现摄像头的远程采集,udp传输,本地显示和保存为AVI文件 发送端
- Gstreamer实现摄像头的远程采集,udp传输,本地显示和保存为AVI文件 接收保存显示端
- 测试中使用config文件读取测试者相关的变量
- USB视频采集系统 视频测试软件将正式发布(方便调试测试各自摄像头,RAW,RGB,YUV)
- Gstreamer实现摄像头的远程采集,udp传输,本地显示和保存为AVI文件 接收保存显示端
- 使用 Video4Linux 采集USB摄像头的图像,并保存到一张 jpg图像文件中的程序
- 使用响应流来输出文件(适合导出文件使用,本文主要测试的是导出excel)
- V4L2视频采集以及使用libjpeg 用yuv转JPEG
- <车载物联网项目,视频采集传输部分,第三天> 使用ffserver输出视频文件流,并且使用使用命令行终端播放视频文件
- acm技巧 使用文件输入输出方便测试的方法
- V4L2视频采集以及使用libjpeg 用yuv转JPEG
- V4L2采集摄像头过程中的几点细节
- CamGameSDK 摄像头游戏SDK提供测试版本。欢迎使用
- 使用 七牛云存储 给力CDN加速图片等静态文件(附相关教程)
- 如何使用MATLAB语言读写YUV文件
- 使用vim在文件中插入命令执行的输出结果