【发布时间】:2018-02-05 11:16:05
【问题描述】:
我想在以下环境中使用 GStreamer 保存视频。
硬件:Raspberry pi(BCM 2709 修订版:a 22082)
操作系统:Raspbian GNU / Linux 9(延伸) 网络摄像头:罗技高清网络摄像头 C270
使用以下命令保存的视频,播放速度变得比预期的快。
$ gst-launch-1.0 v4l2src ! video/x-raw,width=640,height=480,format=YV12,framerate=10/1 ! videoconvert ! omxh264enc ! video/x-h264 ! h264parse ! filesink location=video.h264
但是,如果我将“帧率”更改为 30/1,我可以毫无问题地观看
我使用以下命令检查了视频的帧速率
$ ffmpeg -i video.h 264
Input # 0, h 264, from 'video. H 264':
Duration: N / A, bitrate: N / A
Stream # 0: 0: Video: h 264 (High), yuv 420 p (progressive), 640 x 480 [SAR 1: 1 DAR 4: 3], 25 fps, 25 tbr, 1200 k tbn, 50 tbc
帧速率为 25/1。
我尝试使用以下命令为硬件指定帧速率。
$ v4l2-ctl -d / dev / video0 -p 10
Frame rate set to 10.000 fps
但是没有效果。
我也尝试使用“videorate”插件。
$ gst-launch-1.0 v4l2src ! videorate ! video/x-raw,width=640,height=480,format=YV12,framerate=10/1 ! videoconvert ! omxh264enc ! video/x-h264 ! h264parse ! filesink location=video.h264
但结果更糟。 即使开始播放,视频也会保持停止状态,过一会就会高速播放
GStreamer 的版本是 1.10.4。 这是 apt-get 唯一可用的版本。 我尝试从源代码编译,但不支持在 Raspbian 上构建,非常困难。
更新: 我尝试了 Lad 的建议(谢谢!)
但显示以下错误消息...
gst-launch-1.0 v4l2src ! video/x-raw,width=640,height=480,format=YV12,framerate=10/1 ! videoconvert ! omxh264enc ! video/x-h264 ! h264parse ! mp4mux ! filesink location=video.h264
...
ERROR: from element /GstPipeline:pipeline0/GstMP4Mux:mp4mux0: Could not multiplex stream.
Additional debug info:
gstqtmux.c(3391): gst_qt_mux_add_buffer (): /GstPipeline:pipeline0/GstMP4Mux:mp4mux0:
Buffer has no PTS.
怎么了?
【问题讨论】:
标签: linux video gstreamer raspbian raspberry-pi2