gstreamer0.10 filesrc元素找不到文件

时间:2016-07-27 06:21:25

标签: gstreamer-0.10

我想通过以下方式分析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。

1 个答案:

答案 0 :(得分:1)

您不能将filesrc用于网络流。对于http服务文件,您必须使用javadoc - 它也可以在souphttpsrc

中使用
#! /bin/bash
python /path/to/my/script.py

<强>更新

这是用于使用filesrc - path的格式只是正常的绝对路径或从你执行的地方的相对路径(如果需要使用double&#34; around):

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

这应该也可以。

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