Thursday, January 16, 2014

android publish live video flows Red5 server


project environment:

1 The client uses juv-rtmp-client-1.5.10.jar + android camera capture video data released live video stream.
2 server is the use of open source Red5 streaming media server.

current situation:
1 The client and server is connected, and the release of the video stream time if using NetStream.RECORD publish to the server side, preserved flv file can be successful playing and support on-demand (test using Red5 comes oflaDemo)
(2) When I used NetStream.LIVE way to publish live video flow server, comes with Red5 Demo can not display video.
3 The problem I tangled a few weeks, you big cattle please help a brother, brother in this thanked.
(These are just currently do have a problem if the idea of ​​brother Daniel also please point it out, do not let go too many detours brother, streaming piece of me is in contact Less than two weeks)
Reply:
!! Younger brother for the first time in it to ask questions, do not understand the rules, may be above the light that we did not understand the code I put the code posted below for your reference recording video classes:
 package com.cn.rtmp; 

import java.io.IOException;
import java.util.Map;

import com.cn.rtmp.R;
import com.smaxe.io.ByteArray;
import com.smaxe.uv.client.INetStream;
import com.smaxe.uv.client.NetStream;
import com.smaxe.uv.client.camera.AbstractCamera;
import com.smaxe.uv.stream.support.MediaDataByteArray;

import android.app.Activity;
import android.content.Context;

import android.graphics.PixelFormat;
import android.hardware.Camera;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;
import android.view.SurfaceHolder;

import android.view.SurfaceView;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;

/ **
* By implementing Camera.onPreviewCallback way to get real-time camera array of bytes written back, in essence, a data frame by frame.
*
* @ Author jay-hmw
*
* /

public class CameraVideoActivity extends Activity {
private SurfaceView surfaceView ;/ / video components
private SurfaceHolder surfaceHolder ;/ / video components
private Camera camera ;/ / camera
private int width ;/ / resolution width
private int height ;/ / Resolution height
private boolean init ;/ / flag is initialized successfully
private int blockWidth ;/ / maximum width
private int blockHeight ;/ / maximum height
private int timeBetweenFrames; / / frame rate
private int frameCounter ;/ / capacity
private byte [] previous ;/ / video data byte array
private TextView hour; / / hour
private TextView minute; / / min
private TextView second; / / sec
private Button mStart; / / Start button
private Button mStop; / / end button
private Button mReturn; / / Return button
public static AndroidCamera mCamera;
private boolean isStreaming = false;
private boolean isTiming = true;

@ Override
protected void onCreate (Bundle savedInstanceState) {
/ / TODO Auto-generated method stub
super.onCreate (savedInstanceState);
/ / Set the screen to full screen
getWindow () setFormat (PixelFormat.TRANSLUCENT);.
requestWindowFeature (Window.FEATURE_NO_TITLE);
getWindow (). setFlags (WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
setContentView (R.layout.video);
initMode ();

}

/ **
* Initialize components
* /
private void initMode () {
/ / MSurfaceView = (SurfaceView)
/ / FindViewById (R.id.mediarecorder_Surfaceview);
hour = (TextView) findViewById (R.id.mediarecorder_TextView01);
minute = (TextView) findViewById (R.id.mediarecorder_TextView03);
second = (TextView) findViewById (R.id.mediarecorder_TextView05);
mStart = (Button) findViewById (R.id.mediarecorder_VideoStartBtn);
mStop = (Button) findViewById (R.id.mediarecorder_VideoStopBtn);
mReturn = (Button) findViewById (R.id.mediarecorder_VideoReturnBtn);
/ / RTMPConnectionUtil.ConnectRed5 (CameraVideoActivity.this);
mCamera = new AndroidCamera (CameraVideoActivity.this);
/ / Start button to add an event
mStart.setOnClickListener (new OnClickListener () {

@ Override
public void onClick (View v) {
/ / TODO Auto-generated method stub

mCamera.startVideo ();
handler.postDelayed (task, 1000);
mStart.setEnabled (false);
mReturn.setEnabled (true);
mStop.setEnabled (true);
isTiming = true;
if (isStreaming) {
camera.startPreview ();
}

}
});
/ / Return button to add an event
mReturn.setOnClickListener (new OnClickListener () {

@ Override
public void onClick (View v) {
/ / TODO Auto-generated method stub
mCamera.stopVideo ();
if (RTMPConnectionUtil.netStream! = null) {
RTMPConnectionUtil.netStream.close ();
}
finish ();

}
});
/ / Stop button to add an event
mStop.setOnClickListener (new OnClickListener () {

@ Override
public void onClick (View v) {
/ / TODO Auto-generated method stub
camera.stopPreview ();
isTiming = false;
mStart.setEnabled (true);
mReturn.setEnabled (true);
mStop.setEnabled (false);
}
});

}

@ Override
public void onStop () {
super.onStop ();
mCamera = null;
if (RTMPConnectionUtil.netStream! = null) {
RTMPConnectionUtil.netStream.close ();
}
}

@ Override
public void onDestroy () {
super.onDestroy ();
System.exit (0);
}

/ **
* Custom camera
*
* @ Author jay-hmw
*
* /
public class AndroidCamera extends AbstractCamera implements
SurfaceHolder.Callback, Camera.PreviewCallback {

public AndroidCamera (Context context) {

surfaceView = (SurfaceView) findViewById (R.id.mediarecorder_Surfaceview);
surfaceHolder = surfaceView.getHolder ();
surfaceHolder.addCallback (AndroidCamera.this);
surfaceHolder.setType (SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
width = 352;
height = 288;
init = false;
System.out.println ("***** camera initialization complete *****");
}

private NetStream.ListenerAdapter a = new NetStream.ListenerAdapter () {
@ Override
public void onNetStatus (final INetStream source,
final Map info) {

final Object code = info.get ("code");

if (NetStream.PUBLISH_START.equals (code)) {

if (CameraVideoActivity.mCamera! = null) {
RTMPConnectionUtil.netStream.attachCamera (mCamera, -1);
mCamera.start ();
System.out.println ("***** start recording *****");
} Else {
System.out.println ("***** recording failure *****");
}
}
}

};

private void startVideo () {

RTMPConnectionUtil.netStream = new UltraNetStream (
RTMPConnectionUtil.connection);
RTMPConnectionUtil.netStream
. AddEventListener (new NetStream.ListenerAdapter () {

@ Override
public void onNetStatus (final INetStream source,
final Map info) {

final Object code = info.get ("code");

if (NetStream.PUBLISH_START.equals (code)) {

if (CameraVideoActivity.mCamera! = null) {
RTMPConnectionUtil.netStream.attachCamera (
mCamera, -1);
mCamera.start ();
System.out.println ("***** start recording *****");
} Else {
System.out.println ("***** recording failure *****");
}
}
}
});

RTMPConnectionUtil.netStream.publish ("me", NetStream.RECORD);
/ / RTMPConnectionUtil.netStream.publish ("me", NetStream.LIVE);


}

private void stopVideo () {
if (camera! = null) {
camera.setPreviewCallback (null);
camera.stopPreview ();
camera.release ();
camera = null;
}
}

/ **
* Open the camera
* /
public void start () {
camera.startPreview ();
}

@ Override
public void onPreviewFrame (byte [] arg0, Camera arg1) {
/ / TODO Auto-generated method stub
isStreaming = true;
if (! init) {
blockWidth = 32;
blockHeight = 32;
timeBetweenFrames = 100; / / 1000 / frameRate
frameCounter = 0;
previous = null;
init = true;
}
final long ctime = System.currentTimeMillis ();
System.out.println ("***** camera to capture the array length" + arg0.length + "*****");
byte [] current = RemoteUtil.decodeYUV420SP2RGB (arg0, width, height);
/ / Byte [] current = RemoteUtil.decodeYUV420SP2YUV420 (arg0, arg0.length);
try {

final byte [] packet = RemoteUtil.encode (current, previous,
blockWidth, blockHeight, width, height);
fireOnVideoData (new MediaDataByteArray (timeBetweenFrames,
new ByteArray (packet)));
previous = current;
if (+ + frameCounter% 10 == 0)
previous = null;

} Catch (Exception e) {
e.printStackTrace ();
}
final int spent = (int) (System.currentTimeMillis () - ctime);
try {

Thread.sleep (Math.max (0, timeBetweenFrames - spent));
} Catch (InterruptedException e) {
/ / TODO Auto-generated catch block
e.printStackTrace ();
}
}

@ Override
public void surfaceChanged (SurfaceHolder holder, int format, int width,
int height) {
/ / TODO Auto-generated method stub
System.out.println ("***** system performs surfaceChanged *****");
RTMPConnectionUtil.ConnectRed5 (CameraVideoActivity.this);
}

@ Override
public void surfaceCreated (SurfaceHolder holder) {
/ / TODO Auto-generated method stub
camera = Camera.open ();
try {
camera.setPreviewDisplay (surfaceHolder);
camera.setPreviewCallback (this);
Camera.Parameters params = camera.getParameters ();
params.setPreviewSize (width, height);
camera.setParameters (params);
} Catch (IOException e) {
/ / TODO Auto-generated catch block
e.printStackTrace ();
camera.release ();
camera = null;
}
}

@ Override
public void surfaceDestroyed (SurfaceHolder holder) {
/ / TODO Auto-generated method stub
isStreaming = false;
if (camera! = null) {
camera.stopPreview ();
camera.release ();
camera = null;
}

}

}
/ * Timer setting, timing * /
private Handler handler = new Handler ();
int s, h, m;
private Runnable task = new Runnable () {
public void run () {
if (isTiming) {
handler.postDelayed (this, 1000);
s + +;
if (s <60) {
second.setText (format (s));
} Else if (s <3600) {
m = s / 60;
s = s% 60;
minute.setText (format (m));
second.setText (format (s));
} Else {
h = s / 3600;
m = (s% 3600) / 60;
s = (s% 3600)% 60;
hour.setText (format (h));
minute.setText (format (m));
second.setText (format (s));
}
}
}
};

/ * Formatting time * /
public String format (int i) {
String s = i + "";
if (s.length () == 1) {
s = "0" + s;
}
return s;
}

}

Reply:
Connection to the server class:
 package com.cn.rtmp; 

import java.util.Date;
import java.util.Map;

import android.content.Context;
import android.content.Intent;
import android.os.Message;
import android.util.Log;

import com.smaxe.uv.Responder;
import com.smaxe.uv.client.INetConnection;
import com.smaxe.uv.client.INetStream;

public class RTMPConnectionUtil {
private static final String red5_url = "rtmp :/ / 192.168.1.103/fitcDemo";

public static UltraNetConnection connection;
public static UltraNetStream netStream;

public static String message;

public static void ConnectRed5 (Context context) {
/ / License.setKey ("63140-D023C-D7420-00B15-91FC7");
connection = new UltraNetConnection ();

connection.configuration () put (UltraNetConnection.Configuration.INACTIVITY_TIMEOUT, -1);.
connection.configuration () put (UltraNetConnection.Configuration.RECEIVE_BUFFER_SIZE, 256 * 1024);.
connection.configuration () put (UltraNetConnection.Configuration.SEND_BUFFER_SIZE, 256 * 1024);.

/ / Connection.client (new ClientHandler (context));
connection.addEventListener (new NetConnectionListener ());
/ / Log.d ("DEBUG", User.id + "-" + User.phone);
connection.connect (red5_url);
}

/ / Private static class ClientHandler extends Object {
/ /
/ / Private Context context;
/ /
/ / ClientHandler (Context context) {
/ / This.context = context;
/ /};
/ /
/ / / / Server invoke this method
/ / Public void getVideoInfo (String fromUserId, String fromUserName, String message) {
/ / / / System.out.println (fromUserId + "+ +" + fromUserName + "+ +" + message);
/ / / / RTMPConnectionUtil.message = message;
/ / / / Intent intent = new Intent (context, ChatActivity.class);
/ / / / Intent.putExtra ("state", "callyou");
/ / / / Intent.putExtra ("who", fromUserName);
/ / / / Context.startActivity (intent);
/ /}
/ /
/ / / / Server invoke this method when receiver reject
/ / Public void rejected (String userid, String username) {
/ / / / System.out.println (userid + "+ +" + username);
/ / / / Message msg = ChatActivity.handler.obtainMessage ();
/ / / / Msg.arg1 = 0; / / receiver reject
/ / / / Msg.sendToTarget ();
/ /}
/ /
/ / / / Server invoke this method when receiver receive call
/ / Public void addMember (String userId, String userName) {
/ / / / System.out.println (userId + "+ +" + userName);
/ / / /
/ / / / Message msg = ChatActivity.handler.obtainMessage ();
/ / / / Msg.arg1 = 1;
/ / / / Msg.sendToTarget ();
/ / / /
/ / / / Log.d ("DEBUG", "addMember ()");
/ /
/ /}
/ /
/ / / / Server invoke this method when receiver is not login
/ / Public void Info (String information) {
/ / / / System.out.println ("Info" + information);
/ / / /
/ / / / Message msg = ChatActivity.handler.obtainMessage ();
/ / / / If (information.equals ("client is not login the Red5 Server")) {
/ / / / Msg.arg1 = 2;
/ / / / Msg.sendToTarget ();
/ / / /} Else if (information.equals ("the client is calling, please try again")) {
/ / / / Msg.arg1 = 3;
/ / / / Msg.sendToTarget ();
/ / / /}
/ /}
/ /
/ / Public void onBWDone ()
/ / {
/ /
/ /}
/ /
/ / Public void onBWDone (Object [] paramArrayOfObject)
/ / {
/ /
/ /}
/ /}

private static class NetConnectionListener extends UltraNetConnection.ListenerAdapter {
public NetConnectionListener () {}

@ Override
public void onAsyncError (final INetConnection source, final String message, final Exception e) {
System.out.println ("NetConnection # onAsyncError:" + message + "" + e);
}

@ Override
public void onIOError (final INetConnection source, final String message) {
System.out.println ("NetConnection # onIOError:" + message);
}

@ Override
public void onNetStatus (final INetConnection source, final Map info) {
System.out.println ("NetConnection # onNetStatus:" + info);
final Object code = info.get ("code");
if (UltraNetConnection.CONNECT_SUCCESS.equals (code)) {
/ / Source.call ("testConnection", new Responder () {
/ / Public void onResult (final Object result) {
/ / System.out.println ("Method testConnection result:" + result);
/ /}
/ /
/ / Public void onStatus (final Map status) {
/ / System.out.println ("Method testConnection status:" + status);
/ /}
/ /});
}
}
} / / NetConnectionListener

/ / Invoke server method createMeeting
public static void invokeMethodFormRed5 (String toUserId) {
/ / Date nowDate = new Date ();
/ / String time = nowDate.getTime () + "" + (int) ((Math.random () * 100)% 100);
/ / Message = time;
/ / Connection.call ("createMeeting", responder, User.id + "", toUserId, message);
/ / Log.d ("DEBUG", "call createMeeting");
}

private static Responder responder = new Responder () {

@ Override
public void onResult (Object arg0) {
/ / TODO Auto-generated method stub
System.out.println ("Method createMeeting result:" + arg0);
callback_createMeeting ();
}

@ Override
public void onStatus (Map arg0) {
/ / TODO Auto-generated method stub
System.out.println ("Method createMeetiong status:" + arg0);
}

};

/ / Invoke server method reject
public static void invokeRejectMethod () {
/ / Connection.call ("reject", null, message, User.id);
}

private static void callback_createMeeting () {

/ / StartVideo ();
}

private static void startVideo () {

Log.d ("DEBUG", "startVideo ()");

netStream = new UltraNetStream (connection);
netStream.addEventListener (new UltraNetStream.ListenerAdapter () {
@ Override
public void onNetStatus (final INetStream source, final Map info) {
System.out.println ("Publisher # NetStream # onNetStatus:" + info);
Log.d ("DEBUG", "Publisher # NetStream # onNetStatus:" + info);

final Object code = info.get ("code");

/ / If (UltraNetStream.PUBLISH_START.equals (code)) {
/ / If (VideoActivity.aCamera! = Null) {
/ / NetStream.attachCamera (VideoActivity.aCamera, -1 / * snapshotMilliseconds * /);
/ / Log.d ("DEBUG", "aCamera.start ()");
/ / VideoActivity.aCamera.start ();
/ /} Else {
/ / Log.d ("DEBUG", "camera == null");
/ /}
/ /}
}

});

/ / Log.i ("DEBUG", "User.id:" + User.id + "message" + message);
/ / NetStream.publish (User.id + message, UltraNetStream.RECORD) ;/ / "mp4:" + User.id + message + ". Mp4"
}

/ / Invoke server method enterMeeting
public static void invokeEnterMeetingMethod () {
/ / Connection.call ("enterMeeting", enterResp, message, User.id);
}

private static Responder enterResp = new Responder () {

@ Override
public void onResult (Object arg0) {
/ / TODO Auto-generated method stub
System.out.println ("Method enterMeeting result:" + arg0);
callback_enterMeeting ();
}

@ Override
public void onStatus (Map arg0) {
/ / TODO Auto-generated method stub
System.out.println ("Method enterMeetiong status:" + arg0);
}

};

private static void callback_enterMeeting () {
/ / Message msg = ChatActivity.handler.obtainMessage ();
/ / Msg.arg1 = 1;
/ / Msg.sendToTarget ();

/ / StartVideo ();
}
}

Reply:
Class is responsible for encoding:
 package com.cn.rtmp; 

import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import java.util.zip.Deflater;
import java.util.zip.DeflaterOutputStream;

import android.util.Log;

public class RemoteUtil {

private static Deflater deflater = new Deflater ();

public static byte [] decodeYUV420SP2RGB (byte [] yuv420sp, int width, int height) {
final int frameSize = width * height;

byte [] rgbBuf = new byte [frameSize * 3];

/ / If (rgbBuf == null) throw new NullPointerException ("buffer 'rgbBuf' is null");
if (rgbBuf.length
if (yuv420sp == null) throw new NullPointerException ("buffer 'yuv420sp' is null");

if (yuv420sp.length
int i = 0, y = 0;
int uvp = 0, u = 0, v = 0;
int y1192 = 0, r = 0, g = 0, b = 0;

for (int j = 0, yp = 0; j uvp = frameSize + (j >> 1) * width;
u = 0;
v = 0;
for (i = 0; i y = (0xff & ((int) yuv420sp [yp])) - 16;
if (y <0) y = 0;
if ((i & 1) == 0) {
v = (0xff & yuv420sp [uvp + +]) - 128;
u = (0xff & yuv420sp [uvp + +]) - 128;
}

y1192 = 1192 * y;
r = (y1192 + 1634 * v);
g = (y1192 - 833 * v - 400 * u);
b = (y1192 + 2066 * u);

if (r <0) r = 0; else if (r> 262143) r = 262143;
if (g <0) g = 0; else if (g> 262143) g = 262143;
if (b <0) b = 0; else if (b> 262143) b = 262143;

rgbBuf [yp * 3] = (byte) (r >> 10);
rgbBuf [yp * 3 + 1] = (byte) (g >> 10);
rgbBuf [yp * 3 + 2] = (byte) (b >> 10);
}
} / / For
return rgbBuf;
} / / DecodeYUV420Sp2RGB

public static byte [] decodeYUV420SP2YUV420 (byte [] data, int length) {
int width = 176;
int height = 144;
byte [] str = new byte [length];
System.arraycopy (data, 0, str, 0, width * height);

int strIndex = width * height;

for (int i = width * height +1; i str [strIndex + +] = data [i];
}
for (int i = width * height; i str [strIndex + +] = data [i];
}
return str;
} / / YUV420SP2YUV420

public static byte [] encode (final byte [] current, final byte [] previous, final int blockWidth, final int blockHeight, final int width, final int height) throws Exception {
/ / This limits the maximum capacity of 1G
upload videosByteArrayOutputStream baos = new ByteArrayOutputStream (16 * 1024);

if (previous == null) {
baos.write (getTag (0x01 / * key-frame * /, 0x03 / * ScreenVideo codec * /));
} Else {
baos.write (getTag (0x02 / * inter-frame * /, 0x03 / * ScreenVideo codec * /));
}

/ / Write header
final int wh = width + ((blockWidth / 16 - 1) << 12);
final int hh = height + ((blockHeight / 16 - 1) << 12);

writeShort (baos, wh);
writeShort (baos, hh);

/ / Write content
int y0 = height;
int x0 = 0;
int bwidth = blockWidth;
int bheight = blockHeight;

while (y0> 0) {
bheight = Math.min (y0, blockHeight);
y0 - = bheight;

bwidth = blockWidth;
x0 = 0;

while (x0 ? bwidth = (x0 + blockWidth> width) width - x0: blockWidth;

final boolean changed = isChanged (current, previous, x0, y0, bwidth, bheight, width, height);

if (changed) {
ByteArrayOutputStream blaos = new ByteArrayOutputStream (4 * 1024);

DeflaterOutputStream dos = new DeflaterOutputStream (blaos, deflater);

for (int y = 0; y / / Log.i ("DEBUG", "length of the current of:" + current.length + "starting point:" +3 * ((y0 + bheight - y - 1) * width + x0) + "end:" +3 * bwidth);
dos.write (current, 3 * ((y0 + bheight - y - 1) * width + x0), 3 * bwidth);
}
/ / Dos.write (current, 0, current.length);
dos.finish ();
deflater.reset ();

final byte [] bbuf = blaos.toByteArray ();
final int written = bbuf.length;

/ / Write DataSize
writeShort (baos, written);
/ / Write Data
baos.write (bbuf, 0, written);
} Else {
/ / Write DataSize
writeShort (baos, 0);
}
x0 + = bwidth;
}
}
return baos.toByteArray ();
}

/ **
* Writes short value to the {@ link OutputStream os }.
*
* @ Param os
* @ Param n
* @ Throws Exception if an exception occurred
* /
private static void writeShort (OutputStream os, final int n) throws Exception {
os.write ((n >> 8) & 0xFF);
os.write ((n >> 0) & 0xFF);
}

/ **
* Checks if image block is changed.
*
* @ Param current
* @ Param previous
* @ Param x0
* @ Param y0
* @ Param blockWidth
* @ Param blockHeight
* @ Param width
* @ Param height
* @ Return true if changed, otherwise false
* /
public static boolean isChanged (final byte [] current, final byte [] previous, final int x0, final int y0, final int blockWidth, final int blockHeight, final int width, final int height) {
if (previous == null)
return true;

for (int y = y0, ny = y0 + blockHeight; y final int foff = 3 * (x0 + width * y);
final int poff = 3 * (x0 + width * y);

for (int i = 0, ni = 3 * blockWidth; i if (current [foff + i]! = previous [poff + i])
return true;
}
}
return false;
}

/ **
* @ Param frame
* @ Param codec
* @ Return tag
* /
public static int getTag (final int frame, final int codec) {
return ((frame & 0x0F) << 4) + ((codec & 0x0F) << 0);
}
}

Reply:
Xiongtai I also do something in this area, beginner novice, you can send me a copy of this Demo do appreciate it and you want to explore the mailbox hubo_8911@163.com
Reply:
Demo has to please check your mailbox, you are the first person to see my question .. Thank you
Reply:
My brother introduced juv-rtmp-client-1.5.10.jar
Also probably an android whole package, you can run on the surface.
But that would force close the Start button
Please give me a Demo Xiongtai it.
Extremely grateful!
tkuchris@hotmail.com
Reply:
send all your mail a demo
Reply:
Source landlord seeking to do the project on my recent video stream you want to look at the source code to look for ideas Thank mailbox 258559020@qq.com
Reply:
Will the landlord is Which phone do the test?
My Qcom CPU Tester camera seems to have problems
E / QualcommCamera (28801): Qvoid android :: disable_msg_type (camera_device *, int32_t): E
Red5 Server no response
I currently have to look for other phones to see Cece
Reply:
By the way, ask the landlord how much Red5 version of it.
Reply:
I use Red5-0.9.1, the phone I use millet, if you have not changed Red5 server address, it is estimated there will be a camera problem, because when you point the beginning began to connect the server.
Reply:
I use HTC phones, brushed off the machine Android 4.0.4
Red5 version 1.0.0
Server addresses turn the phone's video timing figures in the running, but Red5 is no response.
It seems I have to wait and then try Red5-0.9.1 Android version 2.3 to take measurements.
Reply:
Seniors look in the same parts with Cock wire phones also send a demo to learn from it, I, vjnjc # qq.com
Reply:
Testing out!
Phone: HTC Desire - Android 2.3.3
Server: Red5 - 0.9.1

RTMPConnectionUtil.netStream.publish ("aaa", NetStream.RECORD);
The video will be released to the Red5 server, the file will exist Red5 (aaa is the file name).

RTMPConnectionUtil.netStream.publish ("aaa", NetStream.LIVE);
Red5 server responded, but the file is not saved, so there should be no oflaDemo own files can be played.
Perhaps you want to do Demo Live instant playback test.
Reply:
I've tested, this will be passed, and now I can get the live broadcast of the recorded side edge broadcast .. ~ ~
Reply:
Brother, I am also live this! Engage in a long time did not do it, can send a demo to learn about it? E-mail: 236056760@qq.com
Reply:
Will the landlord is how to achieve? OflaDemo usage examples, like the?
Reply:
You enter in RED5 called: Publisher's demo, this demo is actually RED5 debugger, we LIVE mode mobile terminal,
As in the following code RTMPConnectionUtil.netStream.publish ("aaa", NetStream.LIVE);
First click connect, then enter the name of your live stream "aaa", click the play can play smoothly, this is the live broadcast.
If you use the corresponding Record mode, that is, the on-demand model.
You can try

Reply:
The landlord, ask when you will not have to play a card a card case. . . Is how to solve it?
Reply:
In response harry163:
You are using vlc player it? Vlc I used to see when the movie would be a little faster transfer of state.

Here is my question:
Red5 received FLV file is also full of large, about 10 seconds on 6M, do not know what can make the file smaller?
Reply:
Are also engaged in this, LZ, it can send a DEMO, 346072628@qq.com
Reply:
I am using red5 the Publisher demo to play real-time video uploaded, the feeling is the relationship between the frame rate setting, 100 will be set to fast forward feeling, set in large, the situation will produce a card a card .. Headache in
Reply:
Play video in which segment is the ah?
Reply:
Video file size improvements can search about ScreenCodec2 algorithm.
Called SVC2 of flash video encoding, you can replace the original encode function,
The original java BufferedImage in Android does not apply,
Can be converted into a Bitmap consider the idea, of course, a small part of the content needs to be rewritten function,
Currently I recorded five seconds is about 1MB.
Reply:
Recently, I also study this, the landlord does not know how kind of research? I hope the landlord to give me a demo, so I study, first thank landlord.
Reply:
E-mail to 1826559560@qq.com
Reply:
Can now do not know the landlord of the code sent to me, are studying (357140343@qq.com)
Reply:
Can now do not know the landlord of the code sent to me, are studying (357140343@qq.com)
Reply:

Reply:

Reply:

Reply:

Reply:

Reply:

Reply:

Reply:
! !

Reply:

Reply:

Reply:

Reply:

Reply:


Reply:


Reply:

Reply:

Reply:

Reply:

Reply:

Reply:

Thank you!
Reply:

Reply:

Reply:

Reply:

Reply:

Reply:

Reply:

Reply:

Reply:

Reply:




? ?
Reply:

Reply:

Reply:



Thanks!
Reply:

Reply:

Reply:

Reply:
Thank you
Reply:

Reply:

Reply:

Reply:

Reply:

Reply:

Reply:

4 comments:

  1. can you send me a copy of how to stream to red5-server from android device using JUV RTMP Client ..... sitara.4u2@gmail.com

    ReplyDelete
  2. thanks for this, i am interested in barcode 128 b font encoder jar file as well. do you have any articel on this

    ReplyDelete
  3. Can you please send me the code to live stream from android phone to red5server? can we also save the stream to file at the same time? does it work outside of localhost?
    please email the code to roopakottapalli@yahoo.com or kottapalli.roopa@gmail.com

    ReplyDelete
  4. Thank you for sharing so many.
    It's refreshing to learn something from your article.

    draw barcode 128 in java

    ReplyDelete