由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Linux版 - 谁懂gstreamer? 用gst-launch什么的?
相关主题
Anyone using gigolo?求助:在ubuntu下制作的avi格式video,为什么在windows下就播放不了?
ask a question about compile shared library using libtool (转载)iPad
俺土俺知道请教用什么软件转.mpeg成.rmvb文件
xubuntu 11.04一个小buglinux下哪个mpeg player可以
System 76的电脑怎么样?ffmpeg能不能rip店里买回来的dvd?
CentOS 6.5安装skype 4.0后出现server connect failed问一个问题:boot up has 30s long pause
VDPAU: NV显卡可以硬解压了Ubuntu 10.04 server 在 Genome 下使用terminal时Pause/Break 键失效
如果有一天网速都是以G论的话find问题
相关话题的讨论汇总
话题: pipeline0话题: decodebin0话题: caps
进入Linux版参与讨论
1 (共1页)
f***8
发帖数: 641
1
我想在一个机器上把mpg文件stream出去,我来本版询问大家推荐了gstreamer。
我的目的就是我想在一个机器上把mpg文件stream出去,但是这个stream里要能改codec
的属性,比如P-frame的rate什么的。在另一台机器上接受这个stream播放出来。
于是我就试了一下gstreamer。我实在是对linux一窍不通阿,总遇到error。
google出来的几个结果我也不动阿。
比如:我在当前文件夹下,有个子文件夹叫做video,这个video文件夹里面有一个视频
叫做1.MPG。我现在就是想把这个视频stream出去,我就按照google的结果试了一下:
gst-launch v4l2src ! video/1.MPG,width=640,height=480,framerate=\(fraction\)
5/1 ! ffmpegcolorspace ! jpegenc ! multipartmux ! tcpserversink host=192.168
.2.1 port=5000
结果报错:
(gst-launch-0.10:9145): GLib-WARNING **: g_set_prgname() called multiple
times
WARNING: erroneous pipeline: could not link v4l2src0 to ffmpegcsp0
求助!谢谢!
r****t
发帖数: 10904
2
gst-launch filesrc location=1.MPG ! decodebin ! video/x-raw-yuv, width=640,
height=480,framerate=5/1 ! ffmpegcolorspace ! jpegenc ! multipartmux !
tcpserversink host=192.168.2.1 port=5000
streaming 我自己只试过 shout2send, 不过 tcpserver 应该差不太多。
f***8
发帖数: 641
3
多谢!我上一个帖子就是你回复的:)
我也加入了gstreamer的emial list,有不懂的也要问问他们。

【在 r****t 的大作中提到】
: gst-launch filesrc location=1.MPG ! decodebin ! video/x-raw-yuv, width=640,
: height=480,framerate=5/1 ! ffmpegcolorspace ! jpegenc ! multipartmux !
: tcpserversink host=192.168.2.1 port=5000
: streaming 我自己只试过 shout2send, 不过 tcpserver 应该差不太多。

f***8
发帖数: 641
4
谢谢!这个works。
在另一台ubuntu PC上,我用
“gst-launch tcpclientsrc host=130.160.47.62 port=5002 ! multipartdemux !
jpegdec ! autovideosink“
接收这个stream,能播放。
但是我的目的是:
1.MPG这个视频的framerate是25,但是我想把它有时候改成20,有时候改成10。甚至还
要更改I-frame,B-frame和p-frame的rate。那这该怎么实现呢?
有人说要“put a videoscale element between decodebin and the caps filter”,
那我具体啊该怎么做呢?
谢谢!!!

【在 r****t 的大作中提到】
: gst-launch filesrc location=1.MPG ! decodebin ! video/x-raw-yuv, width=640,
: height=480,framerate=5/1 ! ffmpegcolorspace ! jpegenc ! multipartmux !
: tcpserversink host=192.168.2.1 port=5000
: streaming 我自己只试过 shout2send, 不过 tcpserver 应该差不太多。

r****t
发帖数: 10904
5
我给你那行里面直接改 framerate=25/1, or framerate=20/1 就行了。
B-frame 这些和具体 codec 有关,需要改 encoder element 的参数,具体来说,
gst-inspect theoraenc 把 theoraenc 换成你需要用的 encoder。

【在 f***8 的大作中提到】
: 谢谢!这个works。
: 在另一台ubuntu PC上,我用
: “gst-launch tcpclientsrc host=130.160.47.62 port=5002 ! multipartdemux !
: jpegdec ! autovideosink“
: 接收这个stream,能播放。
: 但是我的目的是:
: 1.MPG这个视频的framerate是25,但是我想把它有时候改成20,有时候改成10。甚至还
: 要更改I-frame,B-frame和p-frame的rate。那这该怎么实现呢?
: 有人说要“put a videoscale element between decodebin and the caps filter”,
: 那我具体啊该怎么做呢?

f***8
发帖数: 641
6
不行啊。。。我右键单击得到那个视频的属性是framerate=25.
我试了把你给我的那个改成framerate=20/1就报错,但是改成framerate=25/1就OK。
你给我的那个是这样的:
gst-launch filesrc "location=1.MPG" ! decodebin ! video/x-raw-yuv, width=640
,height=480,framerate=25/1 ! ffmpegcolorspace ! jpegenc ! multipartmux !
tcpserversink host=192.168.2.1 port=5006
这个运行OK。但是如果直接写成framerate=25/1就报错。
于是我加了"!videoscale!"在decodebin和cap之间,又把framerate改成15:
gst-launch filesrc "location=1.MPG" ! decodebin ! videoscale ! video/x-raw-
yuv, width=640,height=480,framerate=15/1 ! ffmpegcolorspace ! jpegenc !
multipartmux ! tcpserversink host=192.168.2.1 port=5006
然后就报错,错误行数太多,我就写在这个帖子的末尾吧:)
下面这个也不行:
gst-launch -v filesrc location=1.MPG ! decodebin ! videoscale ! video/x-raw-
yuv, width=640,height=480,framerate=15/1 ! ffmpegcolorspace ! xvimagesink !
下面的这些行是前面第三段提到的报错,因为行数比较多,所以我写在了末尾:
(gst-launch-0.10:11600): GLib-WARNING **: g_set_prgname() called multiple
times
Setting pipeline to PAUSED ...
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.
GstPad:src: caps = video/mpeg, systemstream=(boolean)true, mpegversion=(int)
2
Pipeline is PREROLLING ...
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpegPSDemux:mpegpsdemux0.
GstPad:sink: caps = video/mpeg, systemstream=(boolean)true, mpegversion=(int
)2
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQueue:queue0.GstPad:sink:
caps = video/mpeg, mpegversion=(int)2, systemstream=(boolean)false
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQueue:queue1.GstPad:sink:
caps = audio/mpeg, mpegversion=(int)1
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQueue:queue0.GstPad:src:
caps = video/mpeg, mpegversion=(int)2, systemstream=(boolean)false
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/MpegVideoParse:
mpegvideoparse0.GstPad:sink: caps = video/mpeg, mpegversion=(int)2,
systemstream=(boolean)false
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQueue:queue1.GstPad:src:
caps = audio/mpeg, mpegversion=(int)1
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMPEGAudioParse:
mpegaudioparse0.GstPad:sink: caps = audio/mpeg, mpegversion=(int)1
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/MpegVideoParse:
mpegvideoparse0.GstPad:src: caps = video/mpeg, systemstream=(boolean)false,
parsed=(boolean)true, mpegversion=(int)2, width=(int)640, height=(int)480,
framerate=(fraction)25/1, pixel-aspect-ratio=(fraction)1/1, interlaced=(
boolean)false, codec_data=(buffer)
000001b32801e013ffffe090000001b5148a00010000
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpeg2dec:mpeg2dec0.GstPad:
sink: caps = video/mpeg, systemstream=(boolean)false, parsed=(boolean)true,
mpegversion=(int)2, width=(int)640, height=(int)480, framerate=(fraction)25/
1, pixel-aspect-ratio=(fraction)1/1, interlaced=(boolean)false, codec_data=(
buffer)000001b32801e013ffffe090000001b5148a00010000
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQueue:queue0: max-size-
bytes = 20240
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstGhostPad:src0: caps =
video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(int)480, pixel
-aspect-ratio=(fraction)1/1, framerate=(fraction)25/1, interlaced=(boolean)
false
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpeg2dec:mpeg2dec0.GstPad:
src: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(
int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)25/1,
interlaced=(boolean)false
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpeg2dec:mpeg2dec0.GstPad:
src: caps = video/x-raw-yuv, format=(fourcc)I420, width=(int)640, height=(
int)480, pixel-aspect-ratio=(fraction)1/1, framerate=(fraction)25/1,
interlaced=(boolean)false
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/FluMp3Dec:flump3dec0.GstPad:
sink: caps = audio/mpeg, mpegversion=(int)1, mpegaudioversion=(int)1, layer=
(int)3, rate=(int)44100, channels=(int)2, parsed=(boolean)true
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstGhostPad:src1: caps =
audio/x-raw-int, endianness=(int)1234, signed=(boolean)true, width=(int)16,
depth=(int)16, rate=(int)44100, channels=(int)2
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/FluMp3Dec:flump3dec0.GstPad:
src: caps = audio/x-raw-int, endianness=(int)1234, signed=(boolean)true,
width=(int)16, depth=(int)16, rate=(int)44100, channels=(int)2
ERROR: from element /GstPipeline:pipeline0/GstDecodeBin:decodebin0/
GstMpegPSDemux:mpegpsdemux0: Internal data stream error.
Additional debug info:
gstmpegdemux.c(2734): gst_flups_demux_loop (): /GstPipeline:pipeline0/
GstDecodeBin:decodebin0/GstMpegPSDemux:mpegpsdemux0:
stream stopped, reason not-negotiated
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstGhostPad:src1: caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0.GstGhostPad:src0: caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/FluMp3Dec:flump3dec0.GstPad:
src: caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/FluMp3Dec:flump3dec0.GstPad:
sink: caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMPEGAudioParse:
mpegaudioparse0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMPEGAudioParse:
mpegaudioparse0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQueue:queue1.GstPad:src:
caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQueue:queue1.GstPad:sink:
caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpeg2dec:mpeg2dec0.GstPad:
src: caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpeg2dec:mpeg2dec0.GstPad:
sink: caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/MpegVideoParse:
mpegvideoparse0.GstPad:src: caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/MpegVideoParse:
mpegvideoparse0.GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQueue:queue0.GstPad:src:
caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstQueue:queue0.GstPad:sink:
caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpegPSDemux:mpegpsdemux0.
GstPad:audio_c0: caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpegPSDemux:mpegpsdemux0.
GstPad:video_e0: caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstMpegPSDemux:mpegpsdemux0.
GstPad:sink: caps = NULL
/GstPipeline:pipeline0/GstDecodeBin:decodebin0/GstTypeFindElement:typefind.
GstPad:src: caps = NULL

【在 r****t 的大作中提到】
: 我给你那行里面直接改 framerate=25/1, or framerate=20/1 就行了。
: B-frame 这些和具体 codec 有关,需要改 encoder element 的参数,具体来说,
: gst-inspect theoraenc 把 theoraenc 换成你需要用的 encoder。

r****t
发帖数: 10904
7
videoscale 换成 videorate 应该行了

640

【在 f***8 的大作中提到】
: 不行啊。。。我右键单击得到那个视频的属性是framerate=25.
: 我试了把你给我的那个改成framerate=20/1就报错,但是改成framerate=25/1就OK。
: 你给我的那个是这样的:
: gst-launch filesrc "location=1.MPG" ! decodebin ! video/x-raw-yuv, width=640
: ,height=480,framerate=25/1 ! ffmpegcolorspace ! jpegenc ! multipartmux !
: tcpserversink host=192.168.2.1 port=5006
: 这个运行OK。但是如果直接写成framerate=25/1就报错。
: 于是我加了"!videoscale!"在decodebin和cap之间,又把framerate改成15:
: gst-launch filesrc "location=1.MPG" ! decodebin ! videoscale ! video/x-raw-
: yuv, width=640,height=480,framerate=15/1 ! ffmpegcolorspace ! jpegenc !

f***8
发帖数: 641
8
果然好使了!谢谢:)
你说更改I、B、P-frame需要改 encoder element 的参数:
gst-inspect theoraenc 把 theoraenc 换成需要用的 encoder
我怎么google不到这样的例子呀,自己猜来猜去太费劲了。。。能麻烦你发个链接之类
的吗?

【在 r****t 的大作中提到】
: videoscale 换成 videorate 应该行了
:
: 640

r****t
发帖数: 10904
9
google 的第一个结果就是 http://gstreamer.freedesktop.org/documentation/
把前三个 HTML 文档读了,后面的一边用一边查。

【在 f***8 的大作中提到】
: 果然好使了!谢谢:)
: 你说更改I、B、P-frame需要改 encoder element 的参数:
: gst-inspect theoraenc 把 theoraenc 换成需要用的 encoder
: 我怎么google不到这样的例子呀,自己猜来猜去太费劲了。。。能麻烦你发个链接之类
: 的吗?

1 (共1页)
进入Linux版参与讨论
相关主题
find问题System 76的电脑怎么样?
ubuntu9.0没有声音的问题有解决方法了吗?CentOS 6.5安装skype 4.0后出现server connect failed
fscanf is messyVDPAU: NV显卡可以硬解压了
有matplotlib或numpy/scipy的同学帮我试试 (转载)如果有一天网速都是以G论的话
Anyone using gigolo?求助:在ubuntu下制作的avi格式video,为什么在windows下就播放不了?
ask a question about compile shared library using libtool (转载)iPad
俺土俺知道请教用什么软件转.mpeg成.rmvb文件
xubuntu 11.04一个小buglinux下哪个mpeg player可以
相关话题的讨论汇总
话题: pipeline0话题: decodebin0话题: caps