2

i was wondering how to encode video stream coming from a webcam in mpeg-4 containing H.264/AVC video, then stream it via http, using gstreamer ? The webcam is just a simple usb 2.0 webcam. The only example I've found is streaming mpeg-4 via rtsp, but the client I am using doesn't know about rtsp. Thanks for help.

jerome
  • 2,029
  • 4
  • 38
  • 58

1 Answers1

1

Gstreamer also has a http client: souphttpclientsink which can do a http put of the content you want to stream. The recieving server must be able to deal with the http put.

gst-launch videotestsrc ! x264enc ! souphttpclientsink location=<put the server location here>

The above works for me. Replace the testsrc with your capture and you need a server that will accept a http put on the location. Do a gst-inspect of souphttpclientsink for more details

av501
  • 6,645
  • 2
  • 23
  • 34
  • When i do gst-inspect souphttpclientsink it says no such element or plugin. In the link provided also there is no documentation http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-good-plugins/html/gst-plugins-good-plugins-plugin-soup.html#plugin-soup – jerome Aug 24 '12 at 13:40
  • Gstreamer is a framework. It does provides some functionality internally,it uses several external libraries. So souphttpclient comes from libsoup.The best way is to install gst from source [stick to 0.10 series]. You need 5 packages mostly: core, good, bad, ugly and ffmpeg. The major uncommon dependencies are liboil and orc compiler for getting it to compile. It compiles with a single ./configure --enable-orc & then make & make install. You can see the config.log to see which library was missing, hence why a particular plugin was not selected for build. Install the ones you want and configure – av501 Aug 24 '12 at 13:57
  • if you don't want to install from source you will need to have libsoup (and similarly any other dependencies) installed before you install gstreamer. [I really have never installed from binaries before directly] – av501 Aug 24 '12 at 14:00
  • I suggest you spend the hour or so needed to get gstreamer built from source. It gives you ability to immediately figure out the dependency from the config.log and install it and get it up and running fast. What OS are you using? http://pastebin.com/z96ju3E9 is a edited makefile [I had to remove somethings out] that I use to build ffmpeg/gstreamer and its dependencies from scratch on ubuntu. On some OS the gstffmpeg build fails in some assembly file build. Solved by uninstalling nasm and then installing yasm for the gstffmpeg build.Post that build I reinstall nasm and continue. Hope it helps. – av501 Aug 24 '12 at 14:55
  • At work i have opensuse, an old version, running under a vm. At home, i have Ubuntu the latest. I'll follow your advices and build it from source, when i will have time. Thanks for your help and advices. – jerome Aug 29 '12 at 11:10
  • 1
    Please can you tell us which PUT-compatible http server did you use with souphttpclientsink ? – Tim Autin Apr 28 '14 at 08:49
  • @Tim, I am not sure what you meant there.. if i am right, you read the .. put here means replace. :). Replace the server location here.. i.e put whatever is the server location place of the string between <>. Sometimes english is funny. – av501 Apr 28 '14 at 16:42
  • 1
    ^^ I understood that, but you need to have an HTTP server (which can handle the PUT method used by souphttpclientsink) running at this location, right ? So my question was : which one did you used ? – Tim Autin Apr 28 '14 at 20:51