gstreamer0.10 filesrc element cannot find file

3.2k Views Asked by At

I want to analyse a mp4 video by:

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

or

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

But the terminal shows:

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 ...

The ~/examples/fullstream.mp4 does exist. So I want to ask what's wrong with the code? I use Ubuntu 14.04.

1

There are 1 best solutions below

1
On BEST ANSWER

You cannot use filesrc for network stream. For http serving file you have to use souphttpsrc - 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

UPDATE

This is for using filesrc - the format of path is just normal absolute path or relative path from place where you execute (if needed use double " around):

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

This should maybe also work..

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