如何使用gstreamer将网络摄像头视频保存到文件? [英] How to use gstreamer to save webcam video to file?
问题描述
问题是opencv仅支持avi,而avi似乎不太适合像X264这样的格式.
The problem is opencv only ssupports avi, and avi does not seem to suit a format like X264 very well.
我可以在C语言中使用Gstreamer来帮我吗?
Could I use Gstreamer to do this for me in C?
如果我也可以选择文件格式和容器类型,那就太好了.如果可以使用schrodinger dirac这样的格式,那将是很好的.
It would be good if I could choose the file format and container type too. It would be good if I could use a format like schrodinger dirac.
我是GStreamer的新手,所以我不太确定自己是否在正确的轨道上.
I'm new to GStreamer so I'm not quite sure if I'm on the right track here.
编辑
我设法使用
gst-launch-0.10 ksvideosrc!自动视频接收器
gst-launch-0.10 ksvideosrc ! autovideosink
现在如何将其转码为H264或dirac等格式?
Now how to transcode this to a format like H264 or dirac ...?
编辑
gst-launch-0.10 ksvideosrc num-buffers = 10! encodebin2! ffmpegcolorspace! x264enc! matroskamux!文件库 location = video.mkv
gst-launch-0.10 ksvideosrc num-buffers=10 ! decodebin2 ! ffmpegcolorspace ! x264enc ! matroskamux ! filesink location=video.mkv
这似乎创建了一个文件,但是VLC播放器无法读取它.
This seems to create a file, but VLC player can't read it.
推荐答案
此
gst-launch-0.10
gst-launch-0.10
ksvideosrc !
decodebin2 !
ffmpegcolorspace !
schronc !
matroskamux !
filesink location=gopro2.mkv
似乎可以处理狄拉克编码
Seems to handle dirac encoding
还有这个
gst-launch-0.10 ksvideosrc num-buffers = 500! encodebin2! ffmpegcolorspace! x264enc! mp4mux! filesink location = gopro2.mp4
gst-launch-0.10 ksvideosrc num-buffers=500 ! decodebin2 ! ffmpegcolorspace ! x264enc ! mp4mux ! filesink location=gopro2.mp4
处理x264
这篇关于如何使用gstreamer将网络摄像头视频保存到文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!