: Source code download: http://blog.csdn.net/jgood/article/details/6626872
Python is a concise and elegant language. Her high productivity allows us to solve our immediate problems with minimal manpower, material resources, time, and financial cost. But when the current problems are solved, some long-term problems have to be considered.
Using the socket module provided by python to write network server programs makes it difficult to withstand thousands of connections. I used to refer to the
between this method and the first method?1. The first method can record chat information, and the second method cannot.2. The communication volume of the first method is relatively large. Each time, all the information must be read locally, and the second method is very small.3. The second method is more flexible. Users can delete the records of their chat areas. If the first method is used, so can only be deleted by persons with management permissions. data, so. data. TEXT = "";
Playing footba
);
If (info. Code = "netconnection. Connect. Success ")
{
Trace ("Connect ");
}
};
NC. Connect ("rtmp: // 172.28.10.123/VOD /");
Res = new netstream (NC );
View. attachvideo (RES );
View. attachaudio (RES );
Res. Play ("MP4: Test/3d5.mp4 ");
1.3 configure the Edge server cluster and Server Load balancer in nginx
1. Assign the domain name www.bbkwzk.com in the host file. The configuration is as follows:
127.0.0.1 www.bbkwzk.co
I used to think that video recording was a very troublesome task. I had to study the FMS during the past two days. I didn't expect it to be so easy to use the FMS and flex. I just studied this dd, some internal mechanisms are not fully understood. If it is not accurate enough or incorrect, you are welcome to make a brick and talk about its principles first: flex uses the rtmp protocol to establish a connection with the SSP, that is, the server. The biggest difference between rtmp and HTTP is tha
called. Onsuccess in this example.
Second, if the server returns an error, this function is called. In the example, onerror.
1 package 2 {3 Import flash. display. sprite; 4 Import flash. events. *; 5 import flash.net. netconnection; 6 Import flash.net. objectencoding; 7 Import flash.net. responder; 8 9/** 10 *... 11*12*13 */14 public class aswithphp_2 extends sprite 15 {16 private var connection: netconnection = new netconnection (); 17 private var RSP: responder = new Responder (onsuccess, on
Source on GitHubThis exception is thrown when the video stream in Flash Media server is drawn using Bitmapdata.draw ():
Cannot access rtmp://xxxxx. No policy files granted access. At Flash.display::bitmapdata/draw ()
This error occurs because the client (SWF) does not have permission to replicate the original video data in NetStream. To see a hint, a policy file is needed.However, in the FMS server can not place the policy file, FMS can
Compile flashcomCodeIf reasonable naming rules are often used, you can use the code prompt function of flashmx 2004.For example, the following naming method is used for the objects in flashcom when writing the FCS code. When editing the code, a code prompt is displayed after the vertex number is written after the object name, it contains the attributes and methods that can be used by this object, which is very practical.We recommend that you name the end string of each object: 1: _ Cam camera ob
My boss gave me a new task for playing FLV file dynamically in FMS. that means the Web service must provide the FLV name, start time and the length to play. to create this web service was easy; the return value was a string including these three properties I mentioned before. you can spilt this string into Array Using separating character '$ '.
The following is Action Script code.
Import MX. Services .*;NC = new netconnection ();
VaR myws: WebService = new MX. Services. WebService ("Your W
HttpClient is frequently used in recent work.First put on GitHub's project address Https://github.com/gabriel/as3httpclientThe principle is to use the socket to simulate an HTTP link to break through the various limitations of Flash PlayerBecause it is a socket connection, so the cross-domain problem people still have to pay attention to the nextsuch as referer that were not customizable in the original urlrequest.Another beauty is that the original NetStrea
function of the Click event of the Btndl button
private void Btndl_click (object sender, EventArgs e)
{
if (!string. IsNullOrEmpty (txtIP.Text.ToString ())//To determine whether the IP is null, request, listen to server IP
{
if (!string. IsNullOrEmpty (TxtName.Text.Trim ())//To determine whether the user name is empty, request a service-side fixed port
{
This. LoginName = txtName.Text;
Push off
Processes: initializing, connecting to servers, sending dataThis part mainly uses the librtmp, because is uses other people to encapsulate the good library, generally relatively simple initialization
Simply call the function
rtmp = Rtmp_alloc ();
Rtmp_init (RTMP);
connecting to a server
The four functions represent: Set the URL, make yourself a sender, build a netconnection, build a NetStream
Rtmp_setupurl (RTMP, url);
Rtmp_enablewrite (RT
to keep its _root property unchanged when a _root movie clip is loaded into another movie clip.
(a) Moviecliploader classAllows you to monitor the progress of loading files into movie clips.
(Netconnection class and NetStream Class)Allows you to stream a local video file (FLV file).
(a) PrintJob classLets you (and the user) have more printing control ability in the Flash player.
(Sound.onid3 event handler function)Allows you to access the ID3
camera as the capture source.
(3) For the sake of insurance, if you are using OBS for the first time, then you should click Preview Stream. Look at the effect
(4) Click Start Streaming to publish your video stream to the Red5 server. Here, by the way, the start of streaming is the same as the publish () in Flash or flex in NetStream.
Third, the preview effect
is to use the RTMP protocol to play your published video stream. I used the case of Red5 to
the key functions in the Flowchart are listed as follows: Initsockets (): Initialize socket Rtmp_alloc (): Allocates memory for the structure "RTMP". Rtmp_init (): Initializes a member variable in the structure "RTMP". Rtmp_setupurl (): Sets the URL of the input RTMP connection. Rtmp_enablewrite (): Must be used when publishing a stream. Represents the receive stream if not used. Rtmp_connect (): Establish an RTMP connection to create a netconnection in the RTMP protocol specification. R
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.