Comments (7)
I’m sorry. I think I was using something else finally. And the problem with YT was: YT requires audio, even if muted.
from librtmp-client-for-android.
@neilyoung I also have the same problem as publish stream to the platform like YouTube with the new release version 3.2.0. But it's okay on the others (e.g. srs). Do you remember what one did you use? The connection doesn't drop by the server If I downgrade to the old one 3.1.0.
The 3.2.0 release have renamed the package name from net.butterflytv
to io.antmedia
.
from librtmp-client-for-android.
No, it seems, this missing order is not the problem. What I can tell is, that the writeVideo routine is somehow sending garbage.
I have now replaced the YT endpoint by a local RTMP server, provided by node-media-server
. As with like the YT endpoint the only thing, what works is the initial connection establishment.
The node-media-server
complains literally about each incoming packet and Wireshark also doesn't like the packets much:
[NodeEvent on doneConnect] id=F2NUY8J4 args={"app":"live","type":"nonprivate","tcUrl":"rtmp://192.168.188.53:1935/live"}
29.3.2022 12:46:49 91076 [ERROR] rtmp packet parse error. {
header: {
fmt: 0,
cid: 50,
timestamp: 3078751,
length: 1012450,
type: 44,
stream_id: 79653137
},
clock: 0,
payload: null,
capacity: 0,
bytes: 0
}
29.3.2022 12:46:49 91076 [ERROR] rtmp packet parse error. {
header: {
fmt: 0,
cid: 49,
timestamp: 13436787,
length: 3644398,
type: 221,
stream_id: 3637163481
},
clock: 0,
payload: null,
capacity: 0,
bytes: 0
}
29.3.2022 12:46:49 91076 [ERROR] rtmp packet parse error. {
header: {
fmt: 0,
cid: 17,
timestamp: 14783451,
length: 11984760,
type: 214,
stream_id: 2566289446
},
clock: 0,
payload: null,
capacity: 0,
bytes: 0
}
On the other hand, at my source side, everything looks fine after NAL unit splitting. I'm using writeVideo
then to send down the NAL units.
The packet contents shortly before providing it to writeVideo
looks ok so far: NAL unit flag 00000001 followed by type and the rest of the trace doesn't look too bad
03-29 12:46:48.588 6116 6116 D: Opening RTMP 1280 720
03-29 12:46:48.790 6116 6279 D: Send NAL buffer, len 42121, type 0x21, first bytes: 00 00 00 01 21 e0 02 62 13 94 -> 42141
// Note: The next trace also shows the first few bytes of the following packet, because it is already in the buffer
03-29 12:46:48.793 6116 6279 D: Send NAL buffer, len 6, type 0x9, first bytes: 00 00 00 01 09 10 00 00 00 01 -> 0
03-29 12:46:48.797 6116 6279 D: Send NAL buffer, len 42607, type 0x21, first bytes: 00 00 00 01 21 e0 02 82 13 94 -> 42627
03-29 12:46:48.801 6116 6279 D: Send NAL buffer, len 6, type 0x9, first bytes: 00 00 00 01 09 10 00 00 00 01 -> 0
03-29 12:46:48.806 6116 6279 D: Send NAL buffer, len 44646, type 0x21, first bytes: 00 00 00 01 21 e0 02 a2 13 94 -> -20
03-29 12:46:48.806 6116 6279 D: Client connected false
EDIT: The value after the ->
is the result of writeVideo
.
So, I'm pretty convinced, that the NAL unit splitter does work correctly, the lib is fed with perfect NAL units. But it doesn't work somehow.
The H.264 source is a DJI and seems to be OK, since I can decode it perfectly to YUV and display on a surfaceview.
What is wrong here?
from librtmp-client-for-android.
To continue the discussion here: I have patched the rtmp-lib
a bit, namely I removed the requirement to have an SPS followed by a NAL unit. It seems, the whole thing is only working if the very first packet is an SPS. At least the RTMP_Write now doesn't complain anymore.
I'm not having any video on the remote side yet, but at least I have no errors anymore...
from librtmp-client-for-android.
Good. Found the problem:
- The lib expects to see SPS and PPS as ONE BUFFER.
- The SPS-PPS buffer needs to the first buffer sent, before any ID frame or video slice can be sent.
Works with node-media-server and VLC as client. Unfortunately not yet with Youtube :(
from librtmp-client-for-android.
@neilyoung Which version are you using?
from librtmp-client-for-android.
Don’t remember. Found another solution. Thanks
from librtmp-client-for-android.
Related Issues (20)
- Sample Example for RTMP URL HOT 1
- always crash with SIGSEGV after 6~8 hours rtmp steam play in android HOT 2
- RtmpMuxer推流使用exoplay无法播放,但是电脑直接用ffmepg推流exoplay可以正常播放? HOT 2
- Unable to stream video after updating to the new release 3.2.0 HOT 1
- 请问RTMPMuxer.writeVideo返回-20是什么错误? HOT 1
- Unable to publish to RTMP Server
- Issues enabling debug mode
- Can not stream with RtmpStreamer? HOT 2
- SEI message support (Display Orientation)
- how to work with this lib in Azure media service android? HOT 1
- 断网close后,第二次不能推流到服务端
- 推流无法使用VLC播放 HOT 2
- The method of writevideo is not hard to push. When writeaudio is added to push, the video cannot be played HOT 1
- Does this library support audio only publishing? HOT 2
- how to switch rtmp stream HOT 2
- JCenter shutdown - do you plan to move the latest version to another repository? HOT 20
- Send Metadata HOT 1
- RTMP publish/write confusion HOT 1
- Failed to analyze sps from h264 data
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 librtmp-client-for-android.