Comments (10)
Really ? Does it support dynamic camera switching ? Please show me the code !
from pldroidmediastreaming.
Yes dynamic camera switching, Zoom, adaptive bitrate, custom resolutions, filters among the important ones.
This above is the UI part that requests camera switch (mBroadcaster.requestOtherCamera();)
This is parent class of mBroadcaster. This calls mCamEncoder.requestOtherCamera(); of the camera encoder class.
This is the camera encoder that does the actual switching. This calls requestCamera(int cameraNum)
public void requestCamera(int camera) {
if (Camera.getNumberOfCameras() == 1) {
Log.w(TAG, "Ignoring requestCamera: only one device camera available.");
return;
}
mDesiredCamera = camera;
if (mCamera != null && mDesiredCamera != mCurrentCamera) {
// Hot swap camera
mHandler.sendMessage(mHandler.obtainMessage(MSG_RELEASE_CAMERA));
mHandler.sendMessage(mHandler.obtainMessage(MSG_REOPEN_CAMERA));
}
}
@OverRide
public void handleMessage(Message inputMessage) {
int what = inputMessage.what;
Object obj = inputMessage.obj;
CameraEncoder encoder = mWeakEncoder.get();
if (encoder == null) {
Log.w(TAG, "EncoderHandler.handleMessage: encoder is null");
return;
}
try {
switch (what) {
case MSG_SET_SURFACE_TEXTURE:
encoder.handleSetSurfaceTexture((Integer) obj);
break;
case MSG_FRAME_AVAILABLE:
encoder.handleFrameAvailable((SurfaceTexture) obj);
break;
case MSG_REOPEN_CAMERA:
encoder.openAndAttachCameraToSurfaceTexture();
break;
case MSG_RELEASE_CAMERA:
encoder.releaseCamera();
break;
case MSG_RELEASE:
encoder.handleRelease();
break;
case MSG_RESET:
encoder.handleReset((SessionConfig) obj);
break;
default:
throw new RuntimeException("Unexpected msg what=" + what);
}
} catch (IOException e) {
Log.e(TAG, "Unable to reset! Could be trouble creating MediaCodec encoder");
e.printStackTrace();
}
}
I have used this myself and I can say that the streaming does not stop and restart. Hope this helps
from pldroidmediastreaming.
Yes, it helpful. I had been missed something. But MediaCodec doesn't support update bitrate dynamically API 18. Also i want to change the quality not only the bitrate. Thanks for your helpful information.
from pldroidmediastreaming.
Yes MediaCodec does not allow to update bitrate, I guess that is why they
rely on Ffmpeg to update the bitrate dynamically. I haven't looked deeper
but I believe that is how they do it.
I also believe Periscope dynamically updates bitrate only. Changing quality
is recommended for big change in internet connection speed. But for
temporary changes in internet speed, changing bitrate only is very helpful.
Also without the dependency on Ffmpeg we cannot predict the final
resolution and quality across different phones. But Ffmpeg allows to set a
constant output (eg 640x360 etc.)/across all platforms. We can then also
set custom aspect ratio(like square)
So I would really request and recommend to reintroduce dependency on Ffmpeg
and all
- custom resolutions
2)Dynamic updating of bitrate
3)Custom aspect ratio (1:1)
On Sep 15, 2015 9:09 PM, "jpxiong" [email protected] wrote:
Yes, it helpful. I had been missed something. But MediaCodec doesn't
support update bitrate dynamically API 18. Also i want to change the
quality not only the bitrate. Thanks for your helpful information.—
Reply to this email directly or view it on GitHub
#36 (comment)
.
from pldroidmediastreaming.
Also it would be very helpful if you can guide me how you integrate ActionScript in Android for using NetStream.
from pldroidmediastreaming.
Yes MediaCodec does not allow to update bitrate, I guess that is why they
rely on Ffmpeg to update the bitrate dynamically. I haven't looked deeper
but I believe that is how they do it.
NO! MediaCodec is for encoding and ffmpeg is for packeting and sending frames. If MediaCodec can't update bitrate dynamically, the whole process can't.
reintroduce dependency on Ffmpeg
We wouldn't reintroduce any more.
- custom resolutions
2)Dynamic updating of bitrate
3)Custom aspect ratio (1:1)
The reqs are on my work task list.
Also it would be very helpful if you can guide me how you integrate ActionScript in Android for using NetStream.
I have no experience about that.
BTW, I's sorry to say that the setLocalFileAbsolutePath
can't work on v1.3.3 or v1.3.4. I will add the api back on the later version.
from pldroidmediastreaming.
"BTW, I's sorry to say that the setLocalFileAbsolutePath can't work on v1.3.3 or v1.3.4. I will add the api back on the later version."
Any timeline when it might be re-introduced. It is actually very very important for us.
"The reqs are on my work task list."
So you mean without ffmpeg dependency, we can get Custom resolutions, Dynamic bitrate update and custom aspect ratio? That would be great.
from pldroidmediastreaming.
"I have no experience about that."
I asked about ActionScript because I thought you use ActionScript's NetStream for checking status of RTMP endpoint. Could you please let me know how you actually check the status and invoke events like Disconnected, NetBlocking etc..?
I am adding support for 4.1+ using JavaCV and need to add simillar capabilities of checking the rtmp atatus.
from pldroidmediastreaming.
"BTW, I's sorry to say that the setLocalFileAbsolutePath can't work on v1.3.3 or v1.3.4. I will add the api back on the later version."
Any timeline when it might be re-introduced. It is actually very very important for us.
from pldroidmediastreaming.
setLocalFileAbsolutePath is available in 1.3.7. Haven't tried it, but will it work?
from pldroidmediastreaming.
Related Issues (20)
- Youtube rtmp link not working HOT 1
- 录屏推流需要使用CameraPreviewFrameView吗?
- 视频进度条 HOT 1
- Access denied finding property "camera.aux.packagelist"
- 推流端预览左右两边有黑色 HOT 1
- 如何推流前预览? HOT 1
- 开始推流后 返回状态码 streamingState = UNAUTHORIZED_STREAMING_URL extra = -3 HOT 1
- 快速开始是不是已经不能快速开始了? HOT 1
- targetSdkVersion 29录屏会闪退 HOT 1
- 编译报错,与我的项目中使用的库有冲突? HOT 2
- 通过captureFrame截帧,图像变形。
- 引用happy-dns,还报NoSuchMethodError错误 HOT 4
- No static method defaultResolver() HOT 3
- Issue with the support of 64 bit libraries.
- Unauthorized Package while starting the Streaming
- Pili Streaming not working with Pili Android Version 2.4.0
- activity添加两个fragment,使用懒加载,第二个fragment,无法调起相机 HOT 1
- 最新Demo运行不起来 HOT 3
- 急急急,请问为啥下载的apk demo是牛直播,github上下载的代码跑起来又不像同一个app
- 播放器拉流问题
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pldroidmediastreaming.