如何通过gstreamer管道播放两个mp4视频? [英] how to play two mp4 videos through gstreamer pipeline?

查看:101
本文介绍了如何通过gstreamer管道播放两个mp4视频?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个gstreamer管道来连续播放两个mp4视频.可以使用gst-launch玩吗?我可以为此目的使用multifilesrc吗?

I would like to create a gstreamer pipeline to play two mp4 videos back to back. is it possible to play using gst-launch? can I use multifilesrc for this purpose ?

请向我展示播放两个视频的路径.

Please show me path to play two videos back to back.

提前谢谢!

推荐答案

实际上没有使用单个gst-launch命令执行此操作的方法.当您使用multifilesrc时,视频解码器会在第一个视频结束后发送一个流结束事件.

There isn't really a way to do this using a single gst-launch command. The video decoder sends an end of stream event after the first video ends when you use multifilesrc.

如果您不习惯使用gst-launch,则可以将两个gst-launch命令包装在shell脚本中:

If you are dead set on using gst-launch, you can wrap two gst-launch commands in a shell script:

#!/bin/sh
file1=$1
file2=$2

gst-launch filesrc location="$file1" ! decodebin2 ! autovideosink
gst-launch filesrc location="$file2" ! decodebin2 ! autovideosink

另一种方法是用C编写一个简单的GStreamer应用程序,为第一个视频创建管道,然后播放它,为第二个应用程序创建一个新管道,然后播放.

Another way to do this is to write a simple GStreamer application in C to create a pipeline for the first video, play it, create a new pipeline for the second application, and play that.

请参阅GStreamer应用程序开发人员指南: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/

See the GStreamer application developers guide: http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/

Hello World部分包含一个功能示例管道,我认为这将为您提供一个良好的起点.

The section Hello World contains a functional example pipeline which I think would make a good starting point for you.

这篇关于如何通过gstreamer管道播放两个mp4视频?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆