Not able to save gstream videosink

I'm just trying to save the dummy video to my directory. In that case I end up in this error so I knew something is wrong in the pipeline.

Do I missing any parameters here ?

gst-launch -v videotestsrc ! ximagesink ! filesink location=~/cupcake.mp4 WARNING: erroneous pipeline: could not link ximagesink0 to filesink0

I just want to record only the video.


ximagesink is a sink element and as such doesn't have an output (source pad). This command will tell you about the details of an element:

gst-inspect-1.0 ximagesink

Notice that ximagesink has only sink pad and no source pads, so it doesn't generate any output.

You can dump the video directly to file by using:

gst-launch-1.0 videotestsrc ! filesink location=~/cupcake.raw

Unfortunately, this is still not what you want as videotestsrc will generate raw video and not encoded or muxed to mp4. If you want mp4 you need to put it into the mp4mux that will organize the data it receives into the mp4 container. It is also recommended to encode the video to reduce its size. Let's assume you want to use H.264 as your codec. You can use the element x264enc to encode to H.264

gst-launch-1.0 -e videotestsrc ! x264enc ! mp4mux ! filesink location=~/cupcake.mp4

Notice that I also added the "-e" parameter that will make gst-launch-1.0 send an EOS event and wait for the EOS message to indicate elements have finished working. Without the flag the pipeline is simply interrupted and aborted.

In any case I'd recommend going back to the manuals for application development: http://gstreamer.freedesktop.org/documentation/ The manpage for gst-launch-1.0 is also useful.

Disclaimer: You are using gstreamer 0.10 which is 3 years unmantained and obsolete, please upgrade to 1.0 (This answer is aimed at 1.0 but it can easily be applied to 0.10 by changing the commands to 0.10 version)

链接地址: http://www.djcxy.com/p/43928.html

上一篇: 使用ffenc编码音频文件

下一篇: 无法保存gstream videosink