zuko
zuko

Reputation: 470

gstreamer to stream mp4 through the network - Could not determine type of stream

I'm really running out of ideas. Here is my problem: I need to stream on demand mp4 (H264) through the network. I'm new with gstreamer and after lot of tries with versions > 1.0 I decided to use 0.10 because seems to be most promising so far.

Command below works perfect ( I see window with my movie )

gst-launch filesrc location=/home/zuko/sintel_trailer-368p.mp4 ! decodebin2 name=dec ! queue ! ffmpegcolorspace ! autovideosink dec. ! queue ! audioconvert ! audioresample ! autoaudiosink

Now I'm trying to build TCP stream using commands (so far on localhost only):

Server side:
gst-launch filesrc location=/home/zuko/sintel_trailer-368p.mp4 ! decodebin2 name=dec ! tcpserversink host=127.0.0.1 port=5000

Client side:
gst-launch tcpclientsrc host=127.0.0.1 port=5000 ! decodebin2 name=dec ! queue ! ffmpegcolorspace ! autovideosink dec. ! queue ! audioconvert ! audioresample ! autoaudiosink

But response from the "client side" command is following:

Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
ERROR: from element /GstPipeline:pipeline0/GstDecodeBin2:dec/GstTypeFindElement:typefind: Could not determine type of stream.
Additional debug info:
gsttypefindelement.c(813): gst_type_find_element_chain_do_typefinding (): /GstPipeline:pipeline0/GstDecodeBin2:dec/GstTypeFindElement:typefind
ERROR: pipeline doesn't want to preroll.
Setting pipeline to NULL ...
Freeing pipeline ...

What is missing, or what I'm doing wrong?

I'm testing on: VirtualBox 4.3.12 with Ubuntu 14.04, kernel 3.13.0-24-generic #47-Ubuntu SMP Fri May 2 23:30:00 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Full error with (GST_DEBUG_NO_COLOR=1 GST_DEBUG=*:3 ) attached here: https://app.box.com/s/4ntyk6am2ibg0pohtg9h

Upvotes: 0

Views: 7194

Answers (2)

karlphillip
karlphillip

Reputation: 93468

Using gstreamer 1.0 the server side can share h264 streams with:

gst-launch-1.0 filesrc location="C:\\Videos\\videotestsrc.avi" ! decodebin ! x264enc ! mpegtsmux ! queue ! tcpserversink host=127.0.0.1 port=8080

While the client side receives with:

gst-launch-1.0 tcpclientsrc host=127.0.0.1 port=8080 ! decodebin ! videoconvert ! autovideosink sync=false

Alternatively, the client could be simulated with VLC through:

Media >> Open Network Stream >> tcp://127.0.0.1:8080 >> Play

Upvotes: 0

Mathieu_Du
Mathieu_Du

Reputation: 827

First off, using 0.10 is an absolutely bad idea, you should really stick to 1.0, for which you will have community support.

Second, to your problem itself, you are trying to stream the decoded stream over the network ("decodebin2 ! tcpserversink") and to decode it again on the other side ("tcpclientsrc ! decodebin2"). Not only is it very wrong with respect to bandwidth usage, it also straight up won't work.

I'll advise you to have a look at the rtp plugins provided by gstreamer.

Upvotes: 1

Related Questions