gstreamer0.10 filesrc 元素找不到文件

gstreamer0.10 filesrc element cannot find file

我想通过以下方式分析 mp4 视频:

gst-launch-0.10 filesrc location=file:~/examples/fullstream.mp4 ! tsparse ! tsdemux ! queue ! ffdec_h264 max-threads=0 ! ffmpegcolorspace ! autovideosink name=video

gst-launch-0.10 filesrc location=http://192.168.40.228:8080/fullstream.mp4 ! mpegtsdemux ! queue ! ffdec_h264 max-threads=1 ! ffmpegcolorspace ! autovideosink name=video

但是终端显示:

Setting pipeline to PAUSED ...
ERROR: Pipeline doesn't want to pause.
ERROR: from element /GstPipeline:pipeline0/GstFileSrc:filesrc0: Resource not found.
Additional debug info:
gstfilesrc.c(1042): gst_file_src_start (): /GstPipeline:pipeline0/GstFileSrc:filesrc0:
No such file "file:/home/zhaozhenjie/examples/fullstream.mp4"
Setting pipeline to NULL ...
Freeing pipeline ...

~/examples/fullstream.mp4 确实存在。所以我想问下代码有什么问题?我使用 Ubuntu 14.04.

您不能将 filesrc 用于网络流。对于 http 服务文件,您必须使用 - it was available also in GStreamer 0.10

gst-launch-0.10 souphttpsrc location=http://192.168.40.228:8080/fullstream.mp4 ! qtdemux name=demuxer demuxer. ! queue ! faad ! audioconvert ! audioresample ! autoaudiosink demuxer. ! queue ! ffdec_h264 ! ffmpegcolorspace ! autovideosink

更新

这是为了使用 filesrc - 路径的格式只是正常的绝对路径或从你执行的地方开始的相对路径(如果需要,使用双“左右):

gst-launch-0.10 filesrc location=/home/user/examples/fullstream.mp4 ! qtdemux name=demuxer demuxer. ! queue ! faad ! audioconvert ! audioresample ! autoaudiosink demuxer. ! queue ! ffdec_h264 ! ffmpegcolorspace ! autovideosink

这应该也可以..

gst-launch-0.10 filesrc location=~/examples/fullstream.mp4 ...