Глава 3. Предоставление вещания используя командную линиюа (Advanced streaming using the command line)

ОГЛАВЛЕНИЕ

Structure of stream output  (Структура вывода потока)
Description of the modules (Описание модулей)
Examples  (Примеры)

Structure of stream output (Структура вывода потока)

которая допускает на вывод любой поток прочитанный VLC в файл или как сетевой поток вместо отображения его. Другой тип обработки может быть приложен к потокув течение процесса (transcoding, см.- масштабирующие, фильтры, см.- muxing...) Выход Потока включает другие модули, каждый из их иметь другие возможности. Вы  можете подключить модули, чтобы повышать возможности.

 

Вот список модулей доступных к настоящему времени

  • standard allows стандарт позволяет посылать поток через выходной модуль  доступа: например, UDP, файл, HTTP,...

  • transcode используется, чтобы transcode (декодируйте и  см.-кодировать поток, использовавший другой codec и/или bitrate)  звук и видео входного потока. Если входной или выходной метод  доступа не допускает управление темпа (сеть, захватите устройства),  это сделанным "на лету", в течение реального времени. Это может потребовать совсем  немного мощности CPU, в зависимости от установленных параметров  . Другие потоки, как например, файлы и диски transcoded  так же быстро как система допускает это.
  • duplicate дубликат позволяет вам, создавать цепь секунды, где поток будет  прооперирован в независимом пути
  • display показ позволяет вам отображать входной поток, . Использованное двойным модулем, это позволяет вам, проверять поток при обработке  его.

  • rtp  потоки над RTP (один ■с2 Ёс25╘ы порт UDP для каждого элементарного потока). Этот модуль также  допускает поддержку RTSP.+

  • es  позволяет Вам, разделять Элементарные Потоки (ES) из входного потока. Это можно использовать, чтобы сохранять аудио и видео потоки, чтобы разделять файлы, например.

Каждый из этих модулей могут взять опции. Вот синтаксис, который Вы должны использовать:

% vlc input_stream --sout "#module1{option1=parameter1{parameter-option1},option2=parameter2}:module2{option1=...,option2=...}:..."

Note

Some of the module options (option1 in the example) have to be set, others are optional. Option parameters (parameter-option1 in the example) are always optional. These option parameters are also often very advanced settings. If you don't understand their description, this certainly means that you don't need them.

Вы можете также использовать следующий синтаксис: 

% vlc input_stream --sout-module1-option1=... --sout-module1-option2=... --sout-module2-option1=... --sout-module2-option2=... ...

Например, чтобы transcode (транскодировать) поток и посылать его, используйте::

% vlc input_stream --sout '#transcode{options}:standard{options}'

Description of the modules (Описание модулей)

standard (alias std)

Этот модуль сохраняет поток в файл или посылает его в сеть

The available options are:

access= (доступ)

Этот опция позволяет  одновремено ,сохранять или посылать поток. Это -  обязательная опция. Доступные опции:
 

  • file: сохраняет поток в файл.

  • Используйте append опцию, чтобы добавлять поток в  существующий файл заменяя его
  • udp: вещание в  UDP unicast или multicast адрес.
  • .

    Пункты опций: caching=<time in ms> to set the time VLC should  buffer data before sending it,<ttl> to set the ttl of the sent udp  packets, group=<amount of ■с2 Ёс25╘ы packets>Ы to sent packets by burst instead of one ■с2 Ёс25╘ы by one,  late=<time in ms>  to drop packets that arrive too late at this stage of the  if you ■с2 Ёс25╘ы don't want to wait until the MTU is filled before sending the packet.

  • http: streams over HTTP.

    Item options are: user=<user name> to enable HTTP basic authentication and set the user, pwd=<password> to set the basic authentication password, mime=<mime type> to set the mime type returned by the server.

  • https: streams over HTTP, using a secured SSL connection.

    Item options are the same as for http and: cert=<path to certificate>to set the certificate to use, key=<path to key> to set the private key file the server should use for the SSL connection, ca=<path to certificate> to set the path to the root CA certificates to use for SSL, crl=<path to certificate> to set the revocation certificate to use for the SSL connection.

  • mmsh: streams using the Microsoft MMS protocol. This protocol is used as transport method by many Microsoft's softwares. Note that only a small part of the MMS protocol is supported (MMS encapsulated in HTTP).

    Item options are the same as for the http module.

  • rtp: streams over RTP. Please note that this is a legacy module. It doesn't allow RTSP and can only be used to stream TS streams. Please have a look at the rtp stream output module for a more compliant and complete RTP streamer.

    Options are the same as for the udp setting.

mux=

This option allows you to set the encapsulation method used for the resulting stream. This option has to be set.

Available options are:

  • ts: the MPEG2/TS muxer. This the standard muxer used to stream MPEG 2. This muxer can be used with any access method. Supported codecs are MPEG 1/2/4, MJPEG, H263, H264, I263, WMV 1/2 and theora for video, MPEG audio, AAC and a52 for the audio stream.

    Item options are: pid-video=<pid> to set the PID of the video track, pid-audio=<pid> to set the PID of the audio track, pid-spu=<pid> to set the PID of the subtitle track, pid-pmt=<pid> to set the PID of the PMT (Program Map Table), tsid=<id> to set the ID of the resulting TS stream, shaping=<shaping delay in ms> to set the minimum interval during which the bitrate of the stream will remain constant, for variable bitrate streams, use-key-frames uses I frames as limits for the shaping intervals, pcr=<PCR interval in ms> allows to set at which interval Program Clock References will be sent, dts-delay=<delay in ms> allows to delay PTS (Presentation Time Stamps) from the DTS (Decoding Time Stamp) from the given time, crypt-audio allows to enable encryption of the audio track using the CSA algorithm, csa-ck=<key as a 16 character word> allows to set the key used for CSA encryption.

  • ps: the MPEG2/PS muxer. This the standard muxer for MPEG 2 files(.mpg). It can be used with the file and http output methods. Supported codecs are MPEG 1/2 and MJPEG for video, MPEG audio and a52 for audio streams.

    The only available item option is dst-delay=<delay in ms>. It allows to delay PTS (Presentation Time Stamps) from the DTS (Decoding Time Stamp) from the given time.

  • mpeg1: the standard MPEG 1 muxer. This muxer should be used instead of ps with MPEG 1 video streams, when saved to a file or streamed over HTTP. Supported codecs are MPEG 1 and MPEG audio.

    Items options are the same as for the PS muxer.

  • ogg: the ogg muxer. This is the muxer from the Xiph project. It can be used with the HTTP and file output methods. Supported codecs are MPEG 1/2/4, MJPEG WMV 1/2 and Theora, audio streams can be vorbis, flac, speex, a52 or MPEG audio.

    There is no item option for this muxer.

  • asf: the Microsoft ASF muxer. This is the standard muxer used for streaming by Microsoft's softwares. Is also used as container for WMA audio files. This muxer can be used with the file and HTTP output methods. Supported codecs are MPEG 4, MJPEG, WMV 1/2 for video, MPEG audio, a52 for audio streams.

    Item options are: title=<title>, autor=<author>, copyright=<copyright message>, comment=<comments>, rating=<rating> allow you to set what will be displayed in the according field of the stream comments.

  • asfh: this is a special version of the ASF muxer, that should be used for MMSH streaming. MMSH is the only supported output method. Supported codecs are the same as for ASF.

    Item options are the same as for ASF.

  • avi: the Microsoft AVI muxer. This is very common encapsulation format for MPEG 4 files. The only supported output method is file. Supported codecs are MPEG 1/2/4, H263, H264 and I263 for video, MPEG audio and a52 for audio streams.

    There is not item option for this muxer.

  • mpjpeg: the multipart jpeg muxer. This encapsulation format is mostly used on surveillance video cameras with an integrated web-server. Such streams are usually embedded in web-pages and seen with standard Internet browsers, as they are seen as a succession of jpeg images. The only supported output method is HTTP. The only usable codec is MJPEG. No sound track can be muxed in such streams.

    No item option is available for this muxer.

dst=

This option allows to give informations about the location where the stream should actually be saved or sent.

Here is the meaning of the dst option depending on the parameter used for the access option.

  • If the file output method is used, dst is the complete path where the file should be saved.

  • If the udp or rtp output method is used, dst is the unicast or multicast destination address and, optionally, UDP port, in the form address:port.

  • If the http, https or mmsh output method is chosen, dst is the address, port and path of the local network interface on which the server should listen for requests. If no address is given, VLC will listen on all the network interfaces. These information have to be supplied using the address:port/path syntax.

sap

Используйте этот выбор если Вы хотите, чтобы VLC посылал SAP  (Session Announcement Protocol), заявляет. SAP является протоколом открытия услуги, который использует специальный  групповой адрес, чтобы посылать список доступных потоков в  сервер.

Примечание╖

Этота опция может быть использована только  udp выводным методом.

group=

Этот опция позволяет определять имя дополнительной группы потоков. VLC клиент использует эту область

Примечание

Этот выбор использует частное расширение протокола SAP. VLC БУДЕТ единственным клиентом способным  прочитать эту область.

sap-ipv6V

Используйте эту опцию если вы хотите, чтобы SAP заявлял, что используется используя протокол IPv6 вместо IPv4.

Note

This option can only be used it the sap option has been enabled.

slp

Используйте этот выбор, чтобы определять имя потока, который будет послан в SAP и SLP announces

name=

Используйте этот опцию, чтобы определять имя потока, который будет послан в SAP и SLP announces.

Note

This option can only be used it the sap or slp option has been enabled.

display (показ)

Этот модуль может быть использован, чтобы отображать поток. Это особенно полезное в двойной цепи, для того, чтобы проверять поток тогда когда он сохраняется или вещает.
доступные опции:

novideo

Вы можете использовать эту опцию, блокировать видео вещание

noaudio

Вы можете использовать этот выбор, чтобы блокировать вещание звука .

delay=

Вы можете использовать этоу опцию, чтобы вводить задержку в показ вещания. Задержка должна быть данна в мс.

rtp

Этот модуль может быть использован, чтобы посылать поток, использующий RTP протокол (Real Time Protocol) (смотри RFC 3550).

Примечание


Хотя использование RTSP возможно но модуль, не позволит вам, делать Видео по требованию. Пожалуйста бегло познакомьтесь с описанием модуля VLM.
 

Другие доступные опции:

dst=

Эта опция позволяет давать адрес расположения UDP. Это может быть host адресом или multicast группа. Этот выбор должен быть данн, если sdp=rtsp://опция не дан (смотри ниже). В последнем случае, поток будет послан на host, делающему просьбой RTSP.

port=

эта опция позволяет устанавливать порт UDP , чтобы посылать первый элементарный поток.. Другие потоки будут вещатся используя даже порты непосредственно над этим.

port-video=

Эта опция позволяет устанавливать порт UDP использованный, чтобы посылать первый видео элементарный поток.

port-audio=

Этот выбор позволяет устанавливать порт UDP использованный, чтобы посылать первый аудио элементарный поток.

sdp=

  • Этот выбор позволяет устанавливать пути SDP файла (Session Description Protocol) ,соответствующему потоку
    опции:
     

  • file://<path to the file>,чтобы экспортировать SDP как локальный файл

  • http://<local interface IP:port/path>, чтобы делать файл доступным, используйте встроенный сервер HTTP VLC.

    Note

    The local interface IP argument is optional. If not given, VLC will listen on all available interfaces.

  • rtsp://<local interface IP:port/path>, to make the SDP file available using the RTSP protocol (see RFC 2326).

    Note

    The local interface IP argument is optional. If not given, VLC will listen on all available interfaces.

  • sap, to export the SDP using the SAP (Session Announcement Protocol, see RFC 2974).

ttl=

This option can be used to set the TTL (Time to Live) of the sent UDP packets.

mux=

This option allows to set the encapsulation method used to send the stream. See mux= options of the standard module for a description of the available method. Only ts and raw (no encpasulation) are possible values for RTP streams. Default is RAW.

name=

This option can be used to set the name that will be displayed on the client receiving the stream.

description=

This option can be used to give an additional description of the stream.

url=

This option allows to give the address of a website with additional informations about the stream.

email=

This options allows to give a contact e-mail address

es

The es module can be used to separate the different elementary streams from a stream, and save each of them in a different file or send it to a separate destination.

The available parameters are:

access-video=

Use this option to set the medium used to save or send the video elementary streams. Possible values and item options are the same as for the access option of the standard module (see above).

access-audio=

Use this option to set the medium used to save or send the audio elementary streams. Possible values and item options are the same than for the access option of the standard module (see above).

access=

This option can be used instead of both access-video and access-audio options, when they share the same setting.

mux-video=

Use this option to set the encapsulation method used for the video elementary streams. Possible values and item options are the same as for the mux option of the standard module (see above).

mux-audio=

Use this option to set the encapsulation method used for the audio elementary streams. Possible values and item options are the same than for the mux option of the standard module (see above).

mux=

This option can be used instead of both mux-video and mux-audio options, when they share the same setting.

dst-video=

Use this option to set the location where the video elementary streams should be saved, sent, or made available. The exact meaning of this option depends on the value of the access-video option and is the same as for the url option of the standard module (see above).

Note

If you use the %d string in the url field, VLC will replace it by the number of the audio or video track considered. The %c string will be replaced by the name (FOURCC) of the codec of the track.

dst-audio=

Use this option to set the location where the audio elementary streams should be saved, sent, or made available. The exact meaning of this option depends on the value of the access-audio option and is the same as for the url option of the standard module (see above).

Note

If you use the %d string in the url field, VLC will replace it by the number of the audio or video track considered. The %c string will be replaced by the name (FOURCC) of the codec of the track.

dst=

This option can be used instead of both dst-video and dst-audio options, when they share the same setting.

transcode

You can use this module to transcode a stream, i.e. to change its codecs or the encoding bitrates. Some additional processing can be done during this process, such as re-scaling, deinterlacing, resampling, etc.

Note

Depending on the bitrate of the original stream and of the options chosen, transcoding can be a very CPU intensive task. As a consequence, streaming of a real time transcoded stream can lead to dropped frames or a jerky image and sound in some cases, when running out of resources.

Available options are:

vcodec=

This options allows to specify the codec the video tracks of the input stream should be transcoded to.

List of available codecs can be found on the streaming features page.

vb=

This option allows to set the bitrate of the transcoded video stream, in kbit/s

venc=

This allows to set the encoder to use to encode the videos stream. Available options are:

  • ffmpeg: this is the libavcodec encoding module. It handles a large variety of different codecs (the list can be found on the streaming features page.

    Item options are: keyint=<number of frames> allows to set the maximal amount of frames between 2 key frames, hurry-up allows the encoder to decrease the quality of the stream if the CPU can't keep up with the encoding rate, interlace allows to improve the quality of the encoding of interlaced streams, noise-reduction=<noise reduction factor> enables a noise reduction algorithm (will decrease required bitrate at the cost of details in the image), vt=<bitrate tolerance in kbit/s> allows to set a tolerance for the bitrate of the outputted video stream, bframes=<amount of frames> allows to set the amount of B frames between 2 key frames, qmin=<quantizer> allows to set the minimum quantizer scale, qmax=<quantizer> allows to set the maximum quantizer scale, qscale=<quantizer scale> allows to specify a fixed quantizer scale for VBR encodings, i-quant-factor=<quantization factor> allows to set the quantization factor of I frames, compared to P frames, hq=<quality> allows to choose the quality level for the encoding of the motion vectors (arguments are simple, rd or bits, default is simple *FIXME*), strict=<level of compliance> allows to force a stricter standard compliance (possible values are -1, 0 and 1, default is 0), strict-rc enables a strict rate control algorithm, rc-buffer-size=<size of the buffer in bits> allows to choose the size of the buffer used for rate control (bigger means more efficient rate control), rc-buffer-aggressivity=<float representing the aggressiveness> allows to set the rate control buffer aggressiveness *FIXME*, pre-me allows to enable pre motion estimation, mpeg4-matrix enable use of the MPEG4 quantization matrix with MPEG2 streams, improving quality while keeping compatibility with MPEG2 decoders, trellis enables trelli quantization (better quality, but slower processing).

  • theora: The Xiph.org theora encoder. The module is used to produce theora streams. Theora is a free patent and royalties free video codec.

    The only available item option is quality=<quality level>. This option allows to create a VBR stream, overriding vb setting. the quality level must be an integer between 1 and 10. Higher is better.

  • x264. x264 is a free open-source h264 encoder. h264 (or MPEG4-AVC) is a quite recent high quality video codec.

    Item options are: keyint=<number of frames> allows to set the maximal amount of frames between 2 key frames, idrint=<number of frames> allows to set the maximal amount of frames between 2 IDR frames, bframes=<amount of frames> allows to set the amount of B frames between an I and a P frame, qp=<quantizer parameter> allows to specify a fixed quantizer (between 1 and 51), qp-max=<quantizer parameter> allows to set the maximum value for the quantizer, qp-min=<quantizer parameter> allows to set the minimum value for the quantizer, cabac enables the CABAC (Context-Adaptive Binary Arithmetic Coding) algorithm (slower, but enhances quality), loopfilter enables deblocking loop filter, analyse enables the analyze mode, frameref=<amount of frames> allows to set the number of previous frames used as predictors, scenecut=<sensibility< allows to control how aggressively the encoder should insert extra I-frame, on scene change.

fps=

This options allows to set the framerate of the transcoded video, in frame per second. reducing the framerate of a video can help decreasing its bitrate.

deinterlace

This option allows to enable deinterlacing of interlaced video streams before encoding.

croptop=

This option allows to crop the upper part of the source video while transcoding. The argument is the number of lines the video should be cropped.

cropbottom=

This option allows to crop the lower part of the source video. The argument is the Y coordinate of the first line to be cropped.

cropleft

This option allows to crop the left part of the source video while transcoding. The argument is the number of columns the video should be cropped.

cropright=

This option allows to crop the right part of the source video. The argument is the X coordinate of the first column to be cropped.

scale=

This option allows the give the ratio from which the video should be rescaled while being transcoded. This option can be particularly useful to help reduce the bitrate of a stream.

width=

This options allows to give the width of the transcoded video in pixels.

height

This options allows to give the height of the transcoded video, in pixels.

acodec=

This options allows to specify the codec the audio tracks of the input stream should be transcoded to.

List of available codecs can be found on the streaming features page.

ab=

This option allows to set the bitrate of the transcoded audio stream, in kbit/s

aenc=

This allows to set the encoder to use to encode the audio stream. Available options are:

  • ffmpeg: this is the libavcodec encoding module. It handles a large variety of different codecs (the list can be found on the streaming features page.

  • vorbis. This module uses the vorbis encoder from the Xiph.org project. Vorbis is a free, open, license-free lossy audio codec.

    Item options are: quality=<quality level> allows to use VBR (variable bitrate) encoding instead of the default CBR (constant bitrate), and to set the quality level (between 1 and 10, higher is better), max-bitrate=<bitrate in kbit/s> allows to set the maximum bitrate, for vbr encoding, min-bitrate=<bitrate in kbit/s> allows to set the minimum bitrate, for vbr encoding, cbr allows to force cbr encoding.

  • speex. This module uses the speex encoder from the Xiph.org project. Speex is a lossy audio codec, best fit for very low bitrates (around 10 kbit/s) and particularly video conference.

samplerate=

This option allows to set the samplerate of the transcoded audio stream, in Hz. Reducing the samplerate is be a way to lower the bitrate of the resulting audio stream.

channels=

This option allows to set the number of channels of the resulting audio stream. This is useful for codecs that don't have support for more than 2 channels, of to lower the bitrate of an audio stream.

scodec=

This options allows to specify subtitle format the subtitles tracks of the input stream should be converted to.

List of available codecs can be found on the streaming features page.

senc=

This allows to set the converter to use to encode the subtitle stream.

The only subtitle encoder we have at this time is dvbsub.

soverlay

This option allow to render subtitles directly on the video, while transcoding it. Do not confuse this option with senc/scodec that transcode the subtitles and streams them

sfilter=

This option allows to render some images generated by a so called subpicture filter (e.g. a logo, a text string, etc) on top of the video.

List of available subpicture filters can be found on the streaming features page. The Item options of this modules can be found using the following command line:

% vlc -p --advanced <module name>

threads=

This options allows to set the amount of threads that should be used to encode the streams. Increasing this number to the amount of processors on the computer, (or twice this number on Intel P4 HT processors) should improve transcoding performance.

audio-sync

When this option is enabled, VLC will drop/duplicate video frames to synchronize the video track on the audio track.

duplicate

This module can be used to duplicate the stream, and so process it through several different chains.

Available options are:

dst=

This options allows to give the chain through which the duplicated stream should be processed.

Note

Several dst= options have to be used in the same duplicate block to actually duplicate the stream.

Any of the stream output module described earlier can be used as parameter of this option.

select=

This options can be used to duplicate only a part elementary streams of a complete stream.

Several criteria can be given, by separating each of them with a comma.

For criteria that need a parameter, such as es and program, you can also specify a range, using the syntax criteria=num_start-num_end.

Available parameters are:

  • program=: duplicate only elementary streams belonging to the selected program (or SID). This option only works with MPEG2/TS streams.

  • noprogram=: do not duplicate elementary streams belonging to the selected program (or PID). This option only works with MPEG2/TS streams.

  • es=: duplicate only the elementary stream with the selected id.

  • noes=: do not duplicate the elementary stream with the selected id.

  • video: duplicate only video elementary streams.

  • novideo: do not duplicate video elementary streams.

  • audio: duplicate only audio elementary streams.

  • noaudio: do not duplicate audio elementary streams.

  • spu: duplicate only subtitle elementary streams.

  • nospu: do not duplicate subtitle elementary streams.

Example:

#duplicate{dst=std{...},select="program=100-200,novideo"}

This duplicate chain will only output the non video elementary streams belonging to the programs which PID are between 100 and 200.

Miscellaneous

Here are a few additional global options:

--sout-all, --no-sout-all

Enable streaming of all ES (default disabled). By default VLC will only stream one audio ES and one video ES (the first ones). If you enable sout-all, all ES (audio, video and SPU) will be streamed.

--sout-keep, --no-sout-keep

Keep sout open (default disabled) : use the same sout instance across the various playlist items, if possible.

--no-sout-audio

This options allows to disable audio in the outputted stream.

--no-sout-video

This options allows to disable video in the outputted stream.

Simplified Syntax

The stream output also offers a simplified syntax, with which you can only you use the standard module main options:

% vlc input_stream --sout access/mux:url

where access, mux and url are as defined in the options of the standard module.

Examples

To understand fully the complex syntax of VLC's stream output, please look at the examples in the next section.

Сайт управляется системой uCoz