souphttpsrc

This plugin reads data from a remote location specified by a URI. Supported protocols are 'http', 'https'.

An HTTP proxy must be specified by its URL. If the "http_proxy" environment variable is set, its value is used. If built with libsoup's GNOME integration features, the GNOME proxy configuration will be used, or failing that, proxy autodetection. The proxy property can be used to override the default.

In case the iradio-mode property is set and the location is an HTTP resource, souphttpsrc will send special Icecast HTTP headers to the server to request additional Icecast meta-information. If the server is not an Icecast server, it will behave as if the iradio-mode property were not set. If it is, souphttpsrc will output data with a media type of application/x-icy, in which case you will need to use the icydemux element as follow-up element to extract the Icecast metadata and to determine the underlying media type.

Example launch line

 gst-launch-1.0 -v souphttpsrc location=https://some.server.org/index.html
     ! filesink location=/home/joe/server.html

The above pipeline reads a web page from a server using the HTTPS protocol and writes it to a local file.

 gst-launch-1.0 -v souphttpsrc user-agent="FooPlayer 0.99 beta"
     automatic-redirect=false proxy=http://proxy.intranet.local:8080
     location=http://music.foobar.com/demo.mp3 ! mpgaudioparse
     ! mpg123audiodec ! audioconvert ! audioresample ! autoaudiosink

The above pipeline will read and decode and play an mp3 file from a web server using the HTTP protocol. If the server sends redirects, the request fails instead of following the redirect. The specified HTTP proxy server is used. The User-Agent HTTP request header is set to a custom string instead of "GStreamer souphttpsrc."

 gst-launch-1.0 -v souphttpsrc location=http://10.11.12.13/mjpeg
     do-timestamp=true ! multipartdemux
     ! image/jpeg,width=640,height=480 ! matroskamux
     ! filesink location=mjpeg.mkv

The above pipeline reads a motion JPEG stream from an IP camera using the HTTP protocol, encoded as mime/multipart image/jpeg parts, and writes a Matroska motion JPEG file. The width and height properties are set in the caps to provide the Matroska multiplexer with the information to set this in the header. Timestamps are set on the buffers as they arrive from the camera. These are used by the mime/multipart demultiplexer to emit timestamps on the JPEG-encoded video frame buffers. This allows the Matroska multiplexer to timestamp the frames in the resulting file.

Hierarchy

GObject
    ╰──GInitiallyUnowned
        ╰──GstObject
            ╰──GstElement
                ╰──GstBaseSrc
                    ╰──GstPushSrc
                        ╰──souphttpsrc

Implemented interfaces

Factory details

Authors: – Wouter Cloetens

Classification:Source/Network

Rank – primary

Plugin – soup

Package – GStreamer Good Plug-ins

Pad Templates

src

ANY

Presencealways

Directionsrc

Object typeGstPad


Signals

accept-certificate

gboolean
accept_certificate_callback (GstElement * souphttpsrc,
                             GTlsCertificate * peer_cert,
                             GTlsCertificateFlags * errors,
                             gpointer udata)
def accept_certificate_callback (souphttpsrc, peer_cert, errors, udata):
    #python callback for the 'accept-certificate' signal
function accept_certificate_callback(souphttpsrc: GstElement * souphttpsrc, peer_cert: GTlsCertificate * peer_cert, errors: GTlsCertificateFlags * errors, udata: gpointer udata): {
    // javascript callback for the 'accept-certificate' signal
}

This will directly map to SoupMessage 's "accept-certificate" after an unacceptable TLS certificate has been received, and only for libsoup 3.x or above. If "ssl-strict" was set to FALSE, this signal will not be emitted.

Parameters:

souphttpsrc

a souphttpsrc

peer_cert

the peer's GTlsCertificate

errors

the problems with peer_cert

udata
No description available
Returns (gboolean)

TRUE to accept the TLS certificate and stop other handlers from being invoked, or FALSE to propagate the event further.

Flags: Run Last

Since : 1.24


Properties

automatic-redirect

“automatic-redirect” gboolean

Automatically follow HTTP redirects (HTTP Status Code 3xx)

Flags : Read / Write

Default value : true


compress

“compress” gboolean

Allow compressed content encodings

Flags : Read / Write

Default value : false


cookies

“cookies” GStrv *

HTTP request cookies

Flags : Read / Write


extra-headers

“extra-headers” GstStructure *

Extra headers to append to the HTTP request

Flags : Read / Write


http-log-level

“http-log-level” SoupLoggerLogLevel *

Set log level for soup's HTTP session log

Flags : Read / Write

Default value : headers (2)


iradio-mode

“iradio-mode” gboolean

Enable internet radio mode (ask server to send shoutcast/icecast metadata interleaved with the actual stream data)

Flags : Read / Write

Default value : true


is-live

“is-live” gboolean

Act like a live source

Flags : Read / Write

Default value : false


keep-alive

“keep-alive” gboolean

Use HTTP persistent connections

Flags : Read / Write

Default value : true


location

“location” gchararray

Location to read from

Flags : Read / Write

Default value : NULL


method

“method” gchararray

The HTTP method to use (GET, HEAD, OPTIONS, etc)

Flags : Read / Write

Default value : NULL


proxy

“proxy” gchararray

HTTP proxy server URI

Flags : Read / Write


proxy-id

“proxy-id” gchararray

HTTP proxy URI user id for authentication

Flags : Read / Write

Default value : NULL


proxy-pw

“proxy-pw” gchararray

HTTP proxy URI user password for authentication

Flags : Read / Write

Default value : NULL


retries

“retries” gint

Maximum number of retries until giving up (-1=infinite)

Flags : Read / Write

Default value : 3


ssl-ca-file

“ssl-ca-file” gchararray

Location of a SSL anchor CA file to use

Flags : Read / Write

Default value : NULL


ssl-strict

“ssl-strict” gboolean

Strict SSL certificate checking

Flags : Read / Write

Default value : true


ssl-use-system-ca-file

“ssl-use-system-ca-file” gboolean

Use system CA file

Flags : Read / Write

Default value : true


timeout

“timeout” guint

Value in seconds to timeout a blocking I/O (0 = No timeout).

Flags : Read / Write

Default value : 15


tls-database

“tls-database” GTlsDatabase *

TLS database with anchor certificate authorities used to validate the server certificate

Flags : Read / Write


tls-interaction

“tls-interaction” GTlsInteraction *

A GTlsInteraction object to be used when the connection or certificate database need to interact with the user.

Flags : Read / Write


user-agent

“user-agent” gchararray

Value of the User-Agent HTTP request header field

Flags : Read / Write

Default value : GStreamer souphttpsrc {VERSION}


user-id

“user-id” gchararray

HTTP location URI user id for authentication

Flags : Read / Write

Default value : NULL


user-pw

“user-pw” gchararray

HTTP location URI user password for authentication

Flags : Read / Write

Default value : NULL


The results of the search are