我正在尝试基于 gstreamer 构建一个 rtsp 视频服务器。在我的情况下,我需要客户端连接到服务器并开始将视频流式传输到服务器。
我已经阅读了一些关于这个主题的教程,尤其是这个:http : //www.ip-sense.com/linuxsense/how-to-develop-a-rtsp-server-in-linux-using-gstreamer/
在本教程中,视频从服务器流式传输到客户端,我需要更改它,以便视频将从客户端流式传输到服务器。
编辑:在演示中,此管道已启动:
gst_rtsp_media_factory_set_launch (factory, "( "
"videotestsrc ! video/x-raw-yuv,width=320,height=240,framerate=10/1 ! "
"x264enc ! queue ! rtph264pay name=pay0 pt=96 ! audiotestsrc ! audio/x-raw-int,rate=8000 ! alawenc ! rtppcmapay name=pay1 pt=97 "")");
Run Code Online (Sandbox Code Playgroud)
管道从视频和音频测试源开始,并将它们编码为有效载荷 0 和 1。我需要做相反的事情 - 获取 rtsp 有效载荷并对其进行解码。
我正在使用 GStreamer 设置我的第一个应用程序,其中一个要求是必须优化环境,因此没有图形界面。我在 Pandaboard(ARMv7 - TI OMAP4 - Rev 3.2)上运行 Arch Linux,没有图形。只是文本终端。
我现在想做的就是播放一部电影。第二步将是自定义媒体播放器的快速原型。
作为 GStreamer 的初学者,我可能正在做一些没有意义的事情,真的,但是http://docs.gstreamer.com/display/GstSDK/Basic+tutorials上的所有示例都在板上正确编译,但它们都不起作用.
像 gst-inspect-0.10 和 gst-launch-0.10 这样的所有命令也都失败了。
问题是:
非常感谢!
任何帮助高度赞赏。
我已经使用以下链接中的 .msi 文件在 Windows 上安装了 GStreamer -
gstreamer-1.0-x86-1.2.0.msi
和
gstreamer-1.0-devel-x86-1.2.0.msi
我可以运行以下命令并播放 .webm视频文件没有任何问题。gst-launch-1.0 playbin uri="file:///D:/gstreamer_sample_media/sintel_trailer-480p.webm"
但是当我尝试使用以下命令播放测试 .mts 文件时:
gst-launch-1.0 playbin uri="file:///D:/MyTestMedia/Test1.mts"
Run Code Online (Sandbox Code Playgroud)
出现以下错误:
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Missing element: MPEG-2 Transport Stream demuxer
WARNING: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0: No dec
oder available for type 'video/mpegts, systemstream=(boolean)true, packetsize=(i
nt)192'.
Additional debug info:
gsturidecodebin.c(930): unknown_type_cb (): /GstPlayBin:playbin0/GstURIDecodeBin
:uridecodebin0
ERROR: from element /GstPlayBin:playbin0/GstURIDecodeBin:uridecodebin0/GstDecode
Bin:decodebin0: Your GStreamer installation is missing a plug-in.
Additional debug info:
gstdecodebin2.c(3896): gst_decode_bin_expose (): /GstPlayBin:playbin0/GstURIDeco
deBin:uridecodebin0/GstDecodeBin:decodebin0:
no …Run Code Online (Sandbox Code Playgroud) 我使用 videomixer 在一个窗口中显示 multiplr 图像我使用以下代码来做到这一点
#include <gst/gst.h>
#include <glib.h>
static gboolean bus_call (GstBus *bus,
GstMessage *msg,
gpointer data)
{
GMainLoop *loop = (GMainLoop *) data;
switch (GST_MESSAGE_TYPE (msg)) {
case GST_MESSAGE_EOS:
g_print ("End of stream\n");
g_main_loop_quit (loop);
break;
case GST_MESSAGE_ERROR: {
gchar *debug;
GError *error;
gst_message_parse_error (msg, &error, &debug);
g_free (debug);
g_printerr ("Error: %s\n", error->message);
g_error_free (error);
g_main_loop_quit (loop);
break;
}
default:
break;
}
return TRUE;
}
static void
on_pad_added (GstElement *element,
GstPad *pad,
gpointer data)
{
GstPad *sinkpad;
GstElement …Run Code Online (Sandbox Code Playgroud) 我的问题是,我无法创建 Gstreamer 元素。我正在Gstreamer使用Qt 5.2.1
我在做什么 :
gst_init( NULL, NULL );
GstElement *m_pipeline = gst_pipeline_new ("pipeline1");
GstElement *m_rtspSrc = gst_element_factory_make("rtspsrc", "MyRtspSrc");
但gst_element_factory_make总是返回NULL。
我已经验证过:
gst-inspect-0.10 rtspsrc. (它提供了插件的详细信息)。我也尝试过替代选项:
GstElementFactory *factory = gst_element_factory_find ("rtspsrc");
if(factory)
GstElement *m_rtspSrc = gst_element_factory_create (factory, "MyRtspSrc");
但是,gst_element_factory_find找不到rtspsrc。
请帮我解决这个问题。
我也谷歌了一下。但是找不到任何解决办法。我也参考了一些 StackOverflow 文章。
像GStreamer gst_element_factory_make 失败等等,但仍然有问题。
非常感谢提前。
我正在尝试从 GstSample 获取数据以在我的应用程序接收器中处理它。但是我找不到从样本中提取数据的方法。我已经设置了调用函数“new-sample”:
static void GStPipeline::new_sample (GstAppSink *sink, CustomData *data) {
GstSample* sample;
sample = gst_app_sink_pull_sample(data->app_sink);
if (sample) {
data->sampleBuffer[data->num_samples] = sample;
data->num_samples++;
}
gst_sample_unref(sample);
}
Run Code Online (Sandbox Code Playgroud)
我是否缺少一些基本概念?从 gstreamer-1.0 开始,我必须提供回调“new-sample”而不是“pull-buffer”,这是真的吗?据我了解,缓冲区包含样本。
我有一个完美运行的 gstreamer 管道,它可以接收摄像头流,将其编码为 H.264 视频,将其保存到一个文件中,并将其显示在屏幕上,如下所示:
gst-launch-1.0 -v autovideosrc ! tee name = t ! queue ! omxh264enc !
'video/x-h264, stream-format=(string)byte-stream' ! h264parse ! qtmux !
filesink location=test.mp4 t. ! queue ! videoscale ! video/x-raw,
width=480,height=270 ! xvimagesink -e sync=false
Run Code Online (Sandbox Code Playgroud)
现在,我正在尝试做一些更简单的事情,只需将流记录到文件中(不显示在屏幕上),这似乎不起作用!它写入文件但无法播放。到目前为止我尝试过的是:
gst-launch-1.0 -v autovideosrc ! queue ! omxh264enc ! 'video/x-h264,
stream-format=(string)byte-stream' ! h264parse ! qtmux ! filesink
location=test.mp4 sync=false
Run Code Online (Sandbox Code Playgroud)
我也可以删除队列元素,但结果相同:
gst-launch-1.0 -v autovideosrc ! omxh264enc ! 'video/x-h264,
stream-format=(string)byte-stream' ! h264parse ! qtmux ! filesink
location=test.mp4 sync=false
Run Code Online (Sandbox Code Playgroud)
它似乎没有给出任何错误,但只是没有将有效的流写入我的文件接收器。
有人可以粘贴一对使用rtpvrawpay和的有效 gst-launch 管道rtpvrawdepay吗?
这是我的第一次尝试:
gst-launch-1.0 videotestsrc ! videoconvert ! video/x-raw,width=128,height=128,format=BGR ! rtpvrawpay ! application/x-rtp,payload=96 ! udpsink host=... port=...
gst-launch-1.0 udpsrc port=9999 ! application/x-rtp,media=video,payload=96,clock-rate=90000,encoding-name=RAW,sampling=BGR,depth=16 ! rtpvrawdepay ! video/x-raw,width=128,height=128,format=BGR,framerate=30/1 ! videoconvert ! ximagesink
我正在尝试将 h264 编码的数据从 gstreamer 共享到另外两个进程(两者都基于 gstreamer)。经过一些研究,我发现唯一的方法是使用 shm 插件。这就是我想要做的
gstreamer--->h264 encoder--->shmsink
shmrc--->process1
shmrc--->process2
Run Code Online (Sandbox Code Playgroud)
我能够从 videotestsrc 和网络摄像头工作中获取原始数据。但是对于 h264 编码的数据,它没有。这是我的测试管道
gst-launch-1.0 videotestsrc ! video/x-raw,width=640,height=480,format=YUY2 !
x264enc ! shmsink socket-path=/tmp/foo sync=true wait-for-
connection=false shm-size=10000000
gst-launch-1.0 shmsrc socket-path=/tmp/foo ! avdec_h264 ! video/x-
raw,width=640,height=480,framerate=25/1,format=YUY2 ! autovideosink
Run Code Online (Sandbox Code Playgroud)
有没有人尝试过使用 h264 编码数据的 shm 插件,请帮忙
我正在尝试创建一个简单的 gstreamer1-0 管道,它对 h264 网络摄像头提要进行编码和解码,希望尽可能使用最基本的元素。我已经(理论上)安装了所有标准的、好的、坏的和丑陋的 gstreamer 库。我使用“理论上”这个词是因为我没有 root 权限,我必须请求 IT 下载/安装我可能需要的每个库,这很痛苦。
我尝试了以下管道,但没有奏效:
gst-launch-1.0 v4l2src ! autovideoconvert ! x264enc bitrate=256 ! decodebin ! autovideosink
Run Code Online (Sandbox Code Playgroud)
我得到以下输出:
Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
Redistribute latency...
Missing element: H.264 decoder
ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0: Your GStreamer installation is missing a plug-in.
Additional debug info:
gstdecodebin2.c(3977): gst_decode_bin_expose (): /GstPipeline:pipeline0/GstDecodeBin:decodebin0:
no suitable plugins found
Execution ended after 0:00:01.795803500
Setting pipeline …Run Code Online (Sandbox Code Playgroud)