Comments (5)
Hi @brestmoor ,
In order to use RtmpMuxer, you need the read packets(aka tags) from flv file and then write them to the RtmpMuxer. Each packet has a specific size and type(video and audio).
If you have a h264 file, then you need to get each NAL unit from this file and send to the rtmpmuxer as NAL units. In h264 file each NAL unit starts with 0x000001 or 0x00000001. It seems that you need to dig into the NAL units.
Regards,
from librtmp-client-for-android.
Ok, splitting the h264 file into NAL units almost completly solved this issue. Now I get almost always 0-s, the only -1-s I get is at the beginning of the file for 2 or 3 pockets, but that maybe is not an issue.
Although I would like to ask you for advice with another place where I got stuck, which is, the pockets i send (NALs) cannot be read by a client which is VLC player.
Do you think that my packets somehow are too large? I would say the average size is about 23kb. Or do I do something wrong again with pocketizing the data?
There are only sometimes "holes" of -1 in my stream that looks like this:
09-09 12:47:24.665 6974-7218/projekt.filip.raspberry I/System.out: sent 17452 bytes and video succeded: 0
09-09 12:47:24.675 6974-7218/projekt.filip.raspberry I/System.out: sent 773 bytes and video succeded: 0
09-09 12:47:24.675 6974-7218/projekt.filip.raspberry I/System.out: sent 27 bytes and video succeded: -1
09-09 12:47:24.675 6974-7218/projekt.filip.raspberry I/System.out: sent 8 bytes and video succeded: -1
09-09 12:47:26.055 6974-7218/projekt.filip.raspberry I/System.out: sent 87549 bytes and video succeded: 0
09-09 12:47:26.365 6974-7218/projekt.filip.raspberry I/System.out: sent 19431 bytes and video succeded: 0
Here I link the VLC debug logs: https://pastebin.com/JBtsAKWQ
And I must add that it all takes very long for VLC. It freezes a few times even before the "buffering" that appears in the logs starts. The broadcasting from RTMPmuxer is working all the time though.
Same happens when I try to stream to Wowza. It seems like RTMPMuxer.sendVideo succeeds but there is no playback at Wowza side.
from librtmp-client-for-android.
Hi @brestmoor ,
The ordering of packets may cause rtmp write function to return -1 so it makes a player to stuck.
In LiveVideoBroadcaster there is a simple ordering functionality.
You may use rtmp_write in the same way LiveVideoBroadcaster uses
https://github.com/ant-media/LiveVideoBroadcaster/
Please let me know your thoughts. I want to help.
from librtmp-client-for-android.
Hi @mekya
Unfortunatelly that project that I was working on went to an end, but if I get some free time I will check if reordering packets helps here :).
Thanks for your response.
This rtmp topic seems very complicated in general to me.
from librtmp-client-for-android.
Yeah it is a little bit complicated. I can help you more if you have any question.
I can share my personal phone number as well for chatting and phone call.
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
- Upload RTMP to YT - closing after a couple of buffers (NAL units) HOT 7
- 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
- write stream to local file
- 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.