VLC player on demand and broadcast service

Source: Internet
Author: User

VLC is an open source, simultaneous cross-platform player. When studying the RTSP protocol, it is also a powerful streaming media server.

VLM

VLM (VideoLAN Manager) is a small media manager in VLC that manages multiple streams with only one instance of VLC enabled. It can only be controlled under the Telnet interface and the HTTP interface

Usually if the GUI interface, it is through the mouse click the Window button and menu to control program. Under Linux, it is customary to use the command line to control the operation of the program. VLC also offers two different ways to be controlled. One is the interface of Telnet, it accepts Telnet connection, can have some preset command to control program. One is the way HTTP interfaces, home routing is often used in this way to provide control interface

Telnet interface

Enter the Telnet interface with the command line

    1.  A 192.168. 16.113 6000

The default port is 4212, and the default password is "admin". Use--telnet-port <Integer> and--telnet-password <string> options to speak for ports and passwords

HTTP interface

Use URL http://host:port/vlm.html (for VLC 0.8.4 and later version is http://host:port/vlm/) to enter VLM management interface

Configuration file for VLM

The VLM configuration file is a series of commands: one command per line

To create a profile, just edit a copy of the text file and type in a bunch of VLM commands. Note Recursive calls: for example, in load (file), be aware of the mutual references to files

Menu Tools, VLM Configurator can open the editor for VLM profile, and the bottom can import and export the configuration file

Use the following command to load a VLM configuration file when you start VLC

    1. Vlc-i telnet--vlm-conf vlm.conf

Media types supported by VLM

One medium (media) refers to multiple inputs (such as audio streams and video streams), one output and corresponding options

VLM supports two types of media:

VOD: Video on demand, service only when requested by customer

broadcast : Similar to TV shows, play, pause and other operations are controlled by the server, the client is very helpless, no control

Create a VOD service

Open VLC Player in Telnet mode, create RTSP service, use address 192.168.16.113 and Port 6000

VLC         -vvv--color-i    telnet    --telnet-passoword  VideoLAN  192.168. 16.113    6000
Another command terminal, Telnet connected to the VLC Telnet interface just opened
1[Email protected]1320: ~$ telnet localhost42122Trying127.0.0.1...3 Connected to localhost.4Escape character is'^]'.5VLC Media Player2.1. 6Rincewind6 Password:7 Welcome,master8>new Test VOD enabled9 NewTen> Setup Test input downloads/hotelcalifonia.flv One Setup A>

Next, create a service called Test with media type VOD: New test VOD enabled

Set some of its properties, enter the file as local hotelcalifonia.flv:setup Test input downloads/hotelcalifonia.flv

So we can create a good

Use the following command to play the video. Peer-tested in the network of different machines or mobile phone side, as long as the stream address of the broadcast to fill the correct (here is rtsp://192.168.16.113:6000/test), can be correctly on-demand this video

1 VLC RTSP://192.168.16.113:6000/test

Some details

When you telnet, VLM provides the following commands:

  • Help: Displays a list of all current commands
  • New (name) Vod|broadcast|schedule [Properties]: Create a new VOD, broadcast or plan (schedules) (plan is a date-dated script, on the date specified on that day, This script will be executed automatically). The name cannot be "media" or "schedule". You can specify some properties later, or use the Setup command to specify them later.
  • Setup (name): Sets the attributes of the element that name represents
  • Show [(name) |media|schedule]: Display status and Configuration
    • Show (name): Displays all the name information for this element
    • Show Media : Show summary information for media status
    • Show schedule: Show summary information for schedule status
  • del (name) |all|media|schedule: delete operation
    • del (name): Remove the name element
    • delAll: Delete all elements
    • del media: Remove all Media Elements
    • del Schedule: Delete all plan elements
  • control (name) [instance_name] (command): Change the state of the instance (instance_name) in which the media is located
  • Save (Config_file): Saves all media and scheduled configurations to the specified configuration file. If the configuration file already exists, it will be overwritten. Play, pause, stop, etc these states will not be saved
  • load (config_file): Load a configuration file

Media Properties

Property can be one after another

    • Input (input_name): Add an input stream to the playlist
    • Output (output_name): Defines the outputs of a media. Note: You do not need to define the output for the VOD
    • option (option_name) [=value] : Add option_name to the list of options. The option is global and works for all the media you enter
    • enabled|disabled: Turn the media on or off. If a media is closed, it will not be used as a stream, be paused, or be played
    • Loop|unloop (broadcast only): loop playback
    • mux (mux_name): Specifies that this property indicates that you want to encapsulate a stream instead of using bare data. Mux_name should be designated as four characters in length, for example, MP2T on behalf of MPEG TS,MP2P for MPEG PS. Note: This property is only used for VOD media

Control Commands Command
    • Play: Start playing the first item in the input table, then play the second item in the table, ..., sort of like a playlist
    • Pause: Paused
    • Stop: Stop
    • seek (percentage): Fast forward to a percentage position

Resources

Https://en.wikipedia.org/wiki/VLC_media_player

https://wiki.videolan.org/Documentation:Command_line/

https://wiki.videolan.org/Documentation:Streaming_HowTo/VLM/



From for notes (Wiz)



VLC player on demand and broadcast service

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.