Coder Social home page Coder Social logo

ant-media / librtmp-client-for-android Goto Github PK

View Code? Open in Web Editor NEW
665.0 665.0 227.0 343 KB

It is probably the smallest(~60KB, fat version ~300KB) rtmp client for android. It calls librtmp functions over JNI interface

Home Page: http://antmedia.io

License: Apache License 2.0

Java 4.31% C 89.87% Makefile 0.80% HTML 2.37% CMake 0.69% Roff 1.95%

librtmp-client-for-android's People

Contributors

bryant1410 avatar ianholing avatar luohaohaha avatar mekya avatar mstorsjo avatar pnemonic78 avatar timgates42 avatar vavadhani avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

librtmp-client-for-android's Issues

Thank you. I use this for my opensource project. Some suggestions.

  1. Timestamp. Maybe add some comment on the API to tell that the timestamp unit is millisecond will be better. You know the BufferInfo in MediaCodec uses us as unit. And I see the timestamp at c code uses dts_us. So I thought it uses us at first. But it actually need to divide 1000.
  2. Maybe tell users at README the timestamp must be in order will be better. I know this maybe too newcomer. But I know it after I saw issues/7
  3. Maybe tell users at README about sample address will be better.
    AndroidSimpleScreenRTMP

Finally, thank you very much. The APIs are simple and easy to use. It helps me a lot.

How to implement librtmp on Android application?

I checkout the rtmp-client project and find that there is no code in test module just the rtmp-client is baked already, which is pretty awesome.
However, I don't know to to implement to show RTMP on a player or videoview.
What I tried is:

  • open rtmp client to RTMP url (a valid url like rtmp://127.0.0.1/live/mytest)
  • check that client is open.
  • able to read() which returns an int value.

byte[] buffer = new byte[1024]; int readData = rtmpClient.read(buffer, 0, 1024);

Can anyone guide what I should do to render data from read() function to the video view?
Thanks.

keep returing "video config is already set"

My android is pluged by a codec device which send data from camera to my android. In that way, I can read byte[] parsed by the device in every frame.It's formed as h264 unit.

As the byte data was send to rtmp server.I debugged the 'rtmp_sender_write_video_frame' always ended in if(nal[0] == 0x67) and my server get nothing but a empty connection.

Bad memory copy

Scenario:

  • RTMP stream that apparently specified audio presence in the header but no packets are transmitted
  • Results in exoplayer constantly buffering (librtmp client tried to wait for the first audio packet)
  • Phone is rotated (from portrait to landscape)
  • Once loaded, phone is rotated again (from landscape to portrait)
    • these rotations have to be done fast
  • App crashes

I get the following error:

10-06 23:50:02.216 194-194/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-06 23:50:02.216 194-194/? A/DEBUG: Build fingerprint: 'google/hammerhead/hammerhead:6.0.1/MOB31E/3142026:user/release-keys'
10-06 23:50:02.216 194-194/? A/DEBUG: Revision: '11'
10-06 23:50:02.216 194-194/? A/DEBUG: ABI: 'arm'
10-06 23:50:02.216 194-194/? A/DEBUG: pid: 8321, tid: 8730, name: Loader:Extracto  >>> com.test.player.debug <<<
10-06 23:50:02.216 194-194/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
10-06 23:50:02.243 194-194/? A/DEBUG:     r0 8e99a370  r1 00000000  r2 00000001  r3 00000010
10-06 23:50:02.243 194-194/? A/DEBUG:     r4 9b91b000  r5 00000001  r6 00000001  r7 9b91f188
10-06 23:50:02.243 194-194/? A/DEBUG:     r8 8e99a370  r9 00000001  sl 9a7129ab  fp 131432b0
10-06 23:50:02.243 194-194/? A/DEBUG:     ip 80000000  sp 8e99a338  lr 9a70db4d  pc b6ca86ae  cpsr 800f4430
10-06 23:50:02.248 194-194/? A/DEBUG: backtrace:
10-06 23:50:02.248 194-194/? A/DEBUG:     #00 pc 000176ae  /system/lib/libc.so (__memcpy_base+165)
10-06 23:50:02.249 194-194/? A/DEBUG:     #01 pc 00007b49  /data/app/com.test.player.debug-2/lib/arm/librtmp-jni.so
10-06 23:50:02.249 194-194/? A/DEBUG:     #02 pc 00007d87  /data/app/com.test.player.debug-2/lib/arm/librtmp-jni.so (RTMP_ReadPacket+66)
10-06 23:50:02.249 194-194/? A/DEBUG:     #03 pc 00009351  /data/app/com.test.player.debug-2/lib/arm/librtmp-jni.so (RTMP_ConnectStream+56)
10-06 23:50:02.249 194-194/? A/DEBUG:     #04 pc 0000a165  /data/app/com.test.player.debug-2/lib/arm/librtmp-jni.so (Java_net_butterflytv_rtmp_1client_RtmpClient_open+108)
10-06 23:50:02.249 194-194/? A/DEBUG:     #05 pc 000008e5  /data/data/com.test.player.debug/cache/slice-net.butterflytv.utils-rtmp-client-0.2.6.1_856a7238761ee0f3c629e21e465141e60bb4c661-classes.dex (offset 0x2000)

ExoPlayer-with-RTMP-and-FLV-seek does not advance beyond preparation state for RTMP stream

I've downloaded ExoPlayer-with-RTMP-and-FLV-seek demo and trying to play a RTMP stream, which VLC is able to play. However, all I see in the log is the following:

ExoPlayerImpl: Init 1.5.7
EventLogger: start [0]
EventLogger: state [0.00, false, P]
EventLogger: state [0.19, true, P]

I do see that the packets are being read by RtmpDataSource. I am also able to play HLS streams with the demo app. On the server side, I do see that the client is able to connect to the nginx server. Can you suggest debug steps?

I dug a little deeper into exoplayer flv extractor and see that payload data is being parsed and written to the chunkextractorwrapper video track. Does this mean that exoplayer is not able to then render the video frames?

Another update, it does look like the frames are not drawn onto the surface. When I play HLS, I see surface drawing notifications. With RTMP, I also see that the surface is being set. However, frames are not being rendered to it. I know this isn't the repo for the RTMP work you guys so generously provided. Yet, that repo doesn't have Issues section so I cannot post to it.

I've got additional info. It seems that tracks for video, audio, and meta never become prepared. Their sources are never prepared. From looking at code, once a track's source is set, it is not able to get the format set. The format, at least for video track, is supposed to come from consuming tag data. However, I seem to only get AVC_PACKET_TYPE_SEQUENCE_HEADER only once in the very beginning and never again (I don't know if the server never emits the sequence header or packets with them are ignored by the client).

Also, will the rtmp client handle the case where my RTMP stream does not have autio and text tracks? Currently, I think the playback never starts is because all three (video, audio, and text) tracks are not prepared. However, assuming that is handled, will it work with only one track prepared?

@mekya Let me know if I can provide any more info to debug this issue.

General API cleanup suggestions

  • close() could return void. There's no value to the return value if it's always the same.
  • isConnected could more clearly return a boolean instead of an integer.
  • It's unclear from the Javadoc what the return values are for seek and pause.

How to build the native library

I am trying to build the native C codes but ndk-build is not working on me. How do you build it without an Android.mk file?

minSdkVersion set too high

I see it got set to 21 due to some issue around allowing the NDK to generate resources for newer architectures.

That doesn't sound right, since the result is that anything depending on this library must also have minSdkVersion set to at least 21. This in turn implies any app using this library cannot support anything prior to Lollipop. Is that really intentional/required?

multi streams playing at the same time

I will do a demo app which contains multi video windows to show several rtmp live streams. I can play only one rtmp stream now, how could I create multi clients at the same time ?

Are there any docs on how to capture camera and send as rtmp stream?

I have a SurfaceTextureView on which the camera feed is shown. I read the camera feed as ImageReader. Once I receive a frame, I want to send it as an RTMP stream to my server. I see that there is a writeVideo method, which accepts H264 nal units. But, I'm unsure how to convert camera stream to that. Can you please point me in a direction where I can find some resources or give me an example?

Can't play some rtmp stream: RtmpIOException

Hi.
I'm using ExoPlayer RTMP extension (r2.5.1): https://github.com/google/ExoPlayer/tree/dev-v2/extensions/rtmp
This link: rtmp://studiosystem.co.in:1935/v4news/livestream => play OK
This link: rtmp://video.f10.bdpcdn.net:1935/vod/mp4:Media/2017/08/09/14/cn9-809082017.mp4 => play ERROR but play OK in other players: vitamio, vlc,...
Logcat:

ExoPlayerImplInternal: Source error.
   net.butterflytv.rtmp_client.RtmpClient$RtmpIOException
	   at net.butterflytv.rtmp_client.RtmpClient.open(RtmpClient.java:53)
	   at com.google.android.exoplayer2.ext.rtmp.RtmpDataSource.open(RtmpDataSource.java:57)
	   at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:692)
	   at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:315)
	   at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112)
	   at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587)
	   at java.lang.Thread.run(Thread.java:841)

Please help me!
Thanks.

P/s: Demo that link play OK on VLC:

image

RTMP throws fatal exception

While playing RTMP stream this weird exception happens, And gives no clue about why its happening:

E/ExoPlayerImplInternal: Source error.
net.butterflytv.rtmp_client.RtmpClient$RtmpIOException
at net.butterflytv.rtmp_client.RtmpClient.open(RtmpClient.java:53)
at com.google.android.exoplayer2.ext.rtmp.RtmpDataSource.open(RtmpDataSource.java:57)
at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:137)
at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:692)
at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:315)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
08-26 22:40:08.186 7769-9587/com.myapp A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xf88e3c8c in tid 9587 (Loader:Extracto)

Please help!

How does network failure work?

RtmpClient.open has a few error codes that indicate when establishing the connection fails. However I cannot see any way for RtmpClient to indicate connectivity issues to the caller after the connection is established.

If you've managed to open a connection, read() just returns 0 repeatedly if the connection is subsequently killed (e.g. by putting the device in airplane mode). I would expect read() to throw some kind of IOException in this case. I would also expect open() to throw IOException rather than returning an integer, since it makes it far less likely that the caller will forget to handle failure, but that's more debatable :).

Thoughts? Would it be possible to have read() indicate failure properly?

Under what conditions can RtmpClient.read() return 0 bytes?

Most Java APIs for reading data (e.g. InputStream and all subclasses) are blocking, meaning they either (a) read at least one byte, (b) fail by throwing an exception, (c) return -1 to indicate the end of the data has been reached.

It's undocumented whether RtmpClient.read() can return 0 or not, meaning that no bytes have been read. It appears that it can, from experimentation. Please could:

  • The behaviour of read() be clearly documented. It's unclear whether returning 0 is allowed just by looking at the documentation.
  • Ideally read() would have behaviour like InputStream. If it is allowed to return 0 then a caller may end up needing to implement a while loop that basically polls (and consumes CPU) until data can be read. Which is far from ideal.

Reopen of #21 Writing frames returns -1

I would like to have another question to the return codes of writeVideo.
I will copy here the question i posted to the already closed issue:

Hi,

Could you please look at this fragment of code?

this is a onActivityResult method of my activity:

    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if(requestCode == 1 && resultCode == RESULT_OK) {
            Uri videoUri = data.getData();
            InputStream inputStream = getInputStreamFromUri(videoUri, getContentResolver());

            rtmpMuxer.open("rtmp://192.168.1.108/live/Gg", 320, 240);

            byte[] chunk = new byte[4096];
            int counter = 0;
            try {
                while (inputStream.read(chunk, 0, 4096) > 0) {
                    counter++;
                    System.out.println("video succeeded " + rtmpMuxer.writeVideo(chunk, 0, 4096, counter));
                }
            } catch (IOException e) {
                e.printStackTrace();
            }
        }

So, the server I am broadcasting to works fine, I have tested it, and the file that is represented as inputStream and then divided into chunks is a .h264 file. I got it by using ffmpeg on an .mp4 file.

So my goal here is to read the file from android external storage, and then broadcast it
chunk by chunk.

However the writeVideo fails to send most of the chunks. This is what console looks like

08-21 21:03:29.080 26684-26684/projekt.filip.raspberry I/System.out: video succeeded -1
08-21 21:03:29.080 26684-26684/projekt.filip.raspberry I/System.out: video succeeded -1
08-21 21:03:29.080 26684-26684/projekt.filip.raspberry I/System.out: video succeeded -1
08-21 21:03:29.080 26684-26684/projekt.filip.raspberry I/System.out: video succeeded -1
08-21 21:03:29.080 26684-26684/projekt.filip.raspberry I/System.out: video succeeded -1
08-21 21:03:29.080 26684-26684/projekt.filip.raspberry I/System.out: video succeeded 0
08-21 21:03:29.080 26684-26684/projekt.filip.raspberry I/System.out: video succeeded 0
08-21 21:03:29.080 26684-26684/projekt.filip.raspberry I/System.out: video succeeded -1
08-21 21:03:29.080 26684-26684/projekt.filip.raspberry I/System.out: video succeeded -1
08-21 21:03:29.080 26684-26684/projekt.filip.raspberry I/System.out: video succeeded -1
08-21 21:03:29.080 26684-26684/projekt.filip.raspberry I/System.out: video succeeded 0

Am I missing something here? Do you have any idea how to solve it? Any advice will be higly appriciated.

I tried LiveVideoBroadcaster and it works great, but it doesn't fit what I need because my goal is to send files from android storage.

Secure Publishing supporting?

I actually haven't yet tried it. I just wonder if this support the Secure Publishing like I can put url as 'rtmp://username:password@host:port/applicationname/streamingname'

there is around 10 sec delay time after it plays

Hi

thank you for your library.
I was looking for RTMP player for Android.

it can play the RTMP Live and the video.
but if I play the live, it took around 10 sec delay time.

how can I reduce this time to around 3sec ?

I changed buffer time of ExoPlayer, but it didn't affect.

App crashes (SIGABRT) on fast RTMP stream restart

Issue description

App crashes if RTMP streams are changed quickly (release player/initialize player) using ExoPlayer. If I make a delay before initializing a player with RTMP stream (1000ms) it doesn't crash. It has something to do with improper thread handling of RTMP extension. It doesn't happen if non-RTMP streams are used. It also doesn't happen if you switch between non-RTMP and RTMP streams.

Please suggest a workaround, I can modify the library of ExoPlayer. Thanks.

Reproduction steps

Quickly release/reinitilize player with RTMP streams inside the same activity.

Link to test content

rtmp://live-fs.wmncdn.net/mbctv1/live1.stream
rtmp://studiosystem.co.in:1935/v4news/livestream

Version of ExoPlayer being used

ExoPlayer 2.5.0

Device(s) and version(s) of Android being used

Nexus Player and VM

A full bug report captured from the device

08-09 00:12:46.754 10110 26351 26351 I DefaultRenderersFactory: Loaded FfmpegAudioRenderer.
08-09 00:12:46.754 10110 26351 26351 I ExoPlayerImpl: Init 6f1b5c0 [ExoPlayerLib/2.5.0] [fugu, Nexus Player, Asus, 26]
08-09 00:12:46.764 10025 21289 21289 I Finsky  : [2] com.google.android.finsky.services.e.a(5): Installation state replication succeeded.
08-09 00:12:46.780 10110 26351 26351 I System.out: initializePlayer
08-09 00:12:46.781 10110 26351 26351 D EventLogger: state [0.01, true, I]
08-09 00:12:46.782  1000   313   828 I chatty  : uid=1000(system) Binder:313_8 expire 3 lines
08-09 00:12:46.788 10110 26351 26351 D EventLogger: state [0.01, true, B]
08-09 00:12:46.788 10110 26351 26351 D EventLogger: sourceInfo [periodCount=1, windowCount=1
08-09 00:12:46.788 10110 26351 26351 D EventLogger:   period [?]
08-09 00:12:46.788 10110 26351 26351 D EventLogger:   window [?, false, false]
08-09 00:12:46.788 10110 26351 26351 D EventLogger: ]
08-09 00:12:46.788 10110 26351 26351 I System.out: onLoadingChanged
08-09 00:12:46.788 10110 26351 26351 I System.out: player com.google.android.exoplayer2.SimpleExoPlayer@7d5223e
08-09 00:12:46.788 10110 26351 26351 D EventLogger: loading [true]
08-09 00:12:46.988  root   230   230 W netd    : type=1400 audit(0.0:2909): avc: denied { read write } for path="socket:[3756942]" dev="sockfs" ino=3756942 scontext=u:r:netd:s0 tcontext=u:r:untrusted_app:s0:c512,c768 tclass=unix_stream_socket permissive=0
08-09 00:12:46.990 10110 26351 27063 F libc    : Invalid address 0xd2068400 passed to free: value not allocated
08-09 00:12:46.992 10110 26351 26929 W MessageQueue: Handler (com.google.android.exoplayer2.upstream.Loader$ReleaseTask) {22a89f} sending message to a Handler on a dead thread
08-09 00:12:46.992 10110 26351 26929 W MessageQueue: java.lang.IllegalStateException: Handler (com.google.android.exoplayer2.upstream.Loader$ReleaseTask) {22a89f} sending message to a Handler on a dead thread
08-09 00:12:46.992 10110 26351 26929 W MessageQueue: 	at android.os.MessageQueue.enqueueMessage(MessageQueue.java:545)
08-09 00:12:46.992 10110 26351 26929 W MessageQueue: 	at android.os.Handler.enqueueMessage(Handler.java:661)
08-09 00:12:46.992 10110 26351 26929 W MessageQueue: 	at android.os.Handler.sendMessageAtTime(Handler.java:630)
08-09 00:12:46.992 10110 26351 26929 W MessageQueue: 	at android.os.Handler.sendMessageDelayed(Handler.java:600)
08-09 00:12:46.992 10110 26351 26929 W MessageQueue: 	at android.os.Handler.sendEmptyMessageDelayed(Handler.java:564)
08-09 00:12:46.992 10110 26351 26929 W MessageQueue: 	at android.os.Handler.sendEmptyMessage(Handler.java:549)
08-09 00:12:46.992 10110 26351 26929 W MessageQueue: 	at com.google.android.exoplayer2.upstream.Loader$ReleaseTask.run(Loader.java:423)
08-09 00:12:46.992 10110 26351 26929 W MessageQueue: 	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
08-09 00:12:46.992 10110 26351 26929 W MessageQueue: 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
08-09 00:12:46.992 10110 26351 26929 W MessageQueue: 	at java.lang.Thread.run(Thread.java:764)
08-09 00:12:46.993 10110 26351 27063 F libc    : Fatal signal 6 (SIGABRT), code -6 in tid 27063 (Loader:Extracto)
08-09 00:12:47.175 10110 27087 27087 I crash_dump32: obtaining output fd from tombstoned
08-09 00:12:47.179  1058   206   206 I /system/bin/tombstoned: received crash request for pid 26351
08-09 00:12:47.181 10110 27087 27087 I crash_dump32: performing dump of process 26351 (target tid = 27063)
08-09 00:12:47.182 10110 27087 27087 F DEBUG   : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-09 00:12:47.182 10110 27087 27087 F DEBUG   : Build fingerprint: 'google/fugu/fugu:8.0.0/OPP4.170623.014/4187591:user/release-keys'
08-09 00:12:47.182 10110 27087 27087 F DEBUG   : Revision: '0'
08-09 00:12:47.182 10110 27087 27087 F DEBUG   : ABI: 'x86'
08-09 00:12:47.182 10110 27087 27087 F DEBUG   : pid: 26351, tid: 27063, name: Loader:Extracto  >>> app.name <<<
08-09 00:12:47.183 10110 27087 27087 F DEBUG   : signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
08-09 00:12:47.189 10110 27087 27087 F DEBUG   : Abort message: 'Invalid address 0xd2068400 passed to free: value not allocated'
08-09 00:12:47.190 10110 27087 27087 F DEBUG   :     eax 00000000  ebx 000066ef  ecx 000069b7  edx 00000006
08-09 00:12:47.190 10110 27087 27087 F DEBUG   :     esi 000069b7  edi d33f9b78
08-09 00:12:47.190 10110 27087 27087 F DEBUG   :     xcs 00000023  xds 0000002b  xes 0000002b  xfs 0000006b  xss 0000002b
08-09 00:12:47.190 10110 27087 27087 F DEBUG   :     eip ffffe430  ebp d33f9b98  esp d33f9b2c  flags 00000296
08-09 00:12:47.235 10110 27087 27087 F DEBUG   : 
08-09 00:12:47.235 10110 27087 27087 F DEBUG   : backtrace:
08-09 00:12:47.235 10110 27087 27087 F DEBUG   :     #00 pc ffffe430  [vdso:ffffe000] (__kernel_vsyscall+16)
08-09 00:12:47.235 10110 27087 27087 F DEBUG   :     #01 pc 0008523c  /system/lib/libc.so (tgkill+28)
08-09 00:12:47.235 10110 27087 27087 F DEBUG   :     #02 pc 0002e3ef  /system/lib/libc.so (abort+111)
08-09 00:12:47.235 10110 27087 27087 F DEBUG   :     #03 pc 0003646e  /system/lib/libc.so (__libc_fatal+46)
08-09 00:12:47.235 10110 27087 27087 F DEBUG   :     #04 pc 000b021b  /system/lib/libc.so (ifree+811)
08-09 00:12:47.235 10110 27087 27087 F DEBUG   :     #05 pc 000b04ca  /system/lib/libc.so (je_free+122)
08-09 00:12:47.236 10110 27087 27087 F DEBUG   :     #06 pc 0001527a  /system/lib/libc.so (free+42)
08-09 00:12:47.236 10110 27087 27087 F DEBUG   :     #07 pc 00007760  /data/app/app.name-n0Q6B-VO-xAqQTQ49v0Opg==/lib/x86/librtmp-jni.so (RTMP_Free+32)
08-09 00:12:47.236 10110 27087 27087 F DEBUG   :     #08 pc 000036eb  /data/app/app.name-n0Q6B-VO-xAqQTQ49v0Opg==/lib/x86/librtmp-jni.so (Java_net_butterflytv_rtmp_1client_RtmpClient_nativeOpen+235)
08-09 00:12:47.236 10110 27087 27087 F DEBUG   :     #09 pc 006454b7  /system/lib/libart.so (art_quick_generic_jni_trampoline+71)
08-09 00:12:47.236 10110 27087 27087 F DEBUG   :     #10 pc 0063f522  /system/lib/libart.so (art_quick_invoke_stub+338)
08-09 00:12:47.236 10110 27087 27087 F DEBUG   :     #11 pc 00112b18  /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+232)
08-09 00:12:47.236 10110 27087 27087 F DEBUG   :     #12 pc 00324233  /system/lib/libart.so (_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPNS_9ArtMethodEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+371)
08-09 00:12:47.236 10110 27087 27087 F DEBUG   :     #13 pc 0031cf09  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+809)
08-09 00:12:47.236 10110 27087 27087 F DEBUG   :     #14 pc 006261a6  /system/lib/libart.so (MterpInvokeDirect+534)
08-09 00:12:47.236 10110 27087 27087 F DEBUG   :     #15 pc 006303a1  /system/lib/libart.so (artMterpAsmInstructionStart+14369)
08-09 00:12:47.236 10110 27087 27087 F DEBUG   :     #16 pc 002f6f29  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+537)
08-09 00:12:47.237 10110 27087 27087 F DEBUG   :     #17 pc 002feeea  /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+234)
08-09 00:12:47.237 10110 27087 27087 F DEBUG   :     #18 pc 0031cedd  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+765)
08-09 00:12:47.237 10110 27087 27087 F DEBUG   :     #19 pc 00624aed  /system/lib/libart.so (MterpInvokeVirtual+893)
08-09 00:12:47.237 10110 27087 27087 F DEBUG   :     #20 pc 006302a1  /system/lib/libart.so (artMterpAsmInstructionStart+14113)
08-09 00:12:47.237 10110 27087 27087 F DEBUG   :     #21 pc 002f6f29  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+537)
08-09 00:12:47.237 10110 27087 27087 F DEBUG   :     #22 pc 002feeea  /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+234)
08-09 00:12:47.237 10110 27087 27087 F DEBUG   :     #23 pc 0031cedd  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+765)
08-09 00:12:47.238 10110 27087 27087 F DEBUG   :     #24 pc 00625d65  /system/lib/libart.so (MterpInvokeInterface+1653)
08-09 00:12:47.238 10110 27087 27087 F DEBUG   :     #25 pc 006304a1  /system/lib/libart.so (artMterpAsmInstructionStart+14625)
08-09 00:12:47.238 10110 27087 27087 F DEBUG   :     #26 pc 002f6f29  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+537)
08-09 00:12:47.238 10110 27087 27087 F DEBUG   :     #27 pc 002feeea  /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+234)
08-09 00:12:47.238 10110 27087 27087 F DEBUG   :     #28 pc 0031cedd  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+765)
08-09 00:12:47.238 10110 27087 27087 F DEBUG   :     #29 pc 00625d65  /system/lib/libart.so (MterpInvokeInterface+1653)
08-09 00:12:47.238 10110 27087 27087 F DEBUG   :     #30 pc 006304a1  /system/lib/libart.so (artMterpAsmInstructionStart+14625)
08-09 00:12:47.238 10110 27087 27087 F DEBUG   :     #31 pc 002f6f29  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+537)
08-09 00:12:47.238 10110 27087 27087 F DEBUG   :     #32 pc 002feeea  /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+234)
08-09 00:12:47.238 10110 27087 27087 F DEBUG   :     #33 pc 0031cedd  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+765)
08-09 00:12:47.238 10110 27087 27087 F DEBUG   :     #34 pc 00625d65  /system/lib/libart.so (MterpInvokeInterface+1653)
08-09 00:12:47.238 10110 27087 27087 F DEBUG   :     #35 pc 006304a1  /system/lib/libart.so (artMterpAsmInstructionStart+14625)
08-09 00:12:47.238 10110 27087 27087 F DEBUG   :     #36 pc 002f6f29  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+537)
08-09 00:12:47.238 10110 27087 27087 F DEBUG   :     #37 pc 002feeea  /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+234)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #38 pc 0031cedd  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+765)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #39 pc 00625d65  /system/lib/libart.so (MterpInvokeInterface+1653)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #40 pc 006304a1  /system/lib/libart.so (artMterpAsmInstructionStart+14625)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #41 pc 002f6f29  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+537)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #42 pc 002feeea  /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+234)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #43 pc 0031cedd  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+765)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #44 pc 00624aed  /system/lib/libart.so (MterpInvokeVirtual+893)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #45 pc 006302a1  /system/lib/libart.so (artMterpAsmInstructionStart+14113)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #46 pc 002f6f29  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+537)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #47 pc 002feeea  /system/lib/libart.so (_ZN3art11interpreter33ArtInterpreterToInterpreterBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+234)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #48 pc 0031cedd  /system/lib/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+765)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #49 pc 00625d65  /system/lib/libart.so (MterpInvokeInterface+1653)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #50 pc 006304a1  /system/lib/libart.so (artMterpAsmInstructionStart+14625)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #51 pc 002f6f29  /system/lib/libart.so (_ZN3art11interpreterL7ExecuteEPNS_6ThreadEPKNS_7DexFile8CodeItemERNS_11ShadowFrameENS_6JValueEb+537)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #52 pc 002fedcd  /system/lib/libart.so (_ZN3art11interpreter30EnterInterpreterFromEntryPointEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameE+141)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #53 pc 00614ead  /system/lib/libart.so (artQuickToInterpreterBridge+1341)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #54 pc 0064557d  /system/lib/libart.so (art_quick_to_interpreter_bridge+77)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #55 pc 0063f522  /system/lib/libart.so (art_quick_invoke_stub+338)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #56 pc 00112b18  /system/lib/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+232)
08-09 00:12:47.239 10110 27087 27087 F DEBUG   :     #57 pc 00537f9d  /system/lib/libart.so (_ZN3artL18InvokeWithArgArrayERKNS_33ScopedObjectAccessAlreadyRunnableEPNS_9ArtMethodEPNS_8ArgArrayEPNS_6JValueEPKc+109)
08-09 00:12:47.240 10110 27087 27087 F DEBUG   :     #58 pc 00539676  /system/lib/libart.so (_ZN3art35InvokeVirtualOrInterfaceWithJValuesERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectP10_jmethodIDP6jvalue+470)
08-09 00:12:47.240 10110 27087 27087 F DEBUG   :     #59 pc 0056bfb7  /system/lib/libart.so (_ZN3art6Thread14CreateCallbackEPv+1719)
08-09 00:12:47.240 10110 27087 27087 F DEBUG   :     #60 pc 00080087  /system/lib/libc.so (_ZL15__pthread_startPv+55)
08-09 00:12:47.240 10110 27087 27087 F DEBUG   :     #61 pc 0002f8db  /system/lib/libc.so (__start_thread+75)
08-09 00:12:47.240 10110 27087 27087 F DEBUG   :     #62 pc 0001ec26  /system/lib/libc.so (__bionic_clone+70)

Effective bitrate

Is there a way to obtain the real bitrate resulting from the streaming?

I am encoding separately and from Android 4.3 there is the option of changing bitrate mid-stream so I would like for the library to let me know of the real bitrate in order to change this on-the-fly.

Thanks!

Rtmp live stream displays the first frame and freezes

I use your library together with ExoPlayer v2.5.4, and when i try to play this stream rtmp://188.130.252.20:1935/live/test live=1 the stream displays the first frame and freezes(last incoming state STATE_BUFFERING)
For MediaSource used com.google.android.exoplayer2.source.ExtractorMediaSource

partial code:

RtmpDataSourceFactory dataSourceFactory = new RtmpDataSource.RtmpDataSourceFactory();
MediaSource mediaSource = new ExtractorMediaSource(Uri.parse("rtmp://188.130.252.20:1935/live/test live=1"), dataSourceFactory, new DefaultExtractorsFactory(), null, null);

log:

I/OMXClient: Using client-side OMX mux.
I/MediaCodec: [OMX.qcom.video.decoder.avc] setting surface generation to 18942978
I/ExtendedACodec: setupVideoDecoder()
I/ExtendedACodec: vpp-enable search is 0 and value is 0
I/ExtendedACodec: Decoder will be in frame by frame mode
W/ExtendedACodec: Failed to set frame packing format on component
W/ExtendedACodec: Failed to get Profile and Level from Component
W/ExtendedACodec: Failed to get Entropy from Component

rtmp vod streams working fine
Device used for testing Le X527, API 23

Include 64-bit libraries in releases

The aar for the most recent release (here) only contains 32-bit .so files in the jni directory.

This means the RTMP library fails to load with UnsatisfiedLinkError if the application using the library also uses any other dependency that does contain 64-bit .so files. This happens because Android cannot load 32-bit and 64-bit libraries concurrently, as described here. There are hacky workaround to this issue, but they're really not ideal.

Please could you include 64-bit variant .so files in the release? Thanks!

Does not sure about rmtpMuxer.writeVideo()

Hi, I've try to create screen cast application, I've use MediaCodec with mime type = "video/avc" to receive buffer from VirtualDisplay but I does not sure that when I call I've did it wrong or not

        // Receive buffer from MediaCodec object
        ByteBuffer encodedData = mEncoder.getOutputBuffer(index);
        encodedData.position(mBufferInfo.offset);
        encodedData.limit(mBufferInfo.offset + mBufferInfo.size);
        
        // Set byte[] which will be sent to RMTP server
        byte[] bytes = new byte[encodedData.remaining()];
        encodedData.get(bytes);

        int rtmpConnectionState = mRTMPMuxer != null ? mRTMPMuxer.isConnected() : 0;
        if (rtmpConnectionState != 0) {
            int writeResult = mRTMPMuxer.writeVideo(bytes, 0, bytes.length, (int)System.currentTimeMillis());
        }

When I sent data to server I got writeResult = -1 then RMTP connection is disconnect.
You can see my project here: https://github.com/insthync/AndroidSimpleScreenRTMP

what's server does librtmp support?

When I used wowza server,I got a first frame and then fast farward for a few second. Instand of Adobe Media Server,It could not play any more.The question is what's server does this sdk support?And how can I compile by myself?

can't play streams without audio

Hello,

i'm using LibRtmp extention r2.5.3 with ExoPlayer to play live rtmp video only streams

it working great if the stream has audio but if the stream has no audio it never works !

any idea ?

Publish stream

Hello. i am trying publishing my video from camera, but I don't know how to use you're method writeVideo . I should get byte array from camera ?

  rtmpMuxer.open("rtmp://mysite.com/streamName");
  rtmpMuxer.writeVideo(byte[] data, int offset, int length, int timestamp);

Library update

Hello :)
I see that you have an update in your project and edit some methods
Can you update gradle dependencies and readme in GitHub?

UnsatisfiedLinkError without abifilters

When I use your lib as a gradle dependency, it crashes at runtime with UnsatisfiedLinkError:

java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader[DexPathList[[zip file ".../base.apk"],nativeLibraryDirectories=[.../lib/arm64, .../base.apk!/lib/arm64-v8a, /system/lib64, /vendor/lib64]]] couldn't find "librtmp-jni.so"
                                                         at java.lang.Runtime.loadLibrary0(Runtime.java:984)
                                                         at java.lang.System.loadLibrary(System.java:1530)
                                                         at net.butterflytv.rtmp_client.RtmpClient.<clinit>(RtmpClient.java:9)

It's here:

static {
    System.loadLibrary("rtmp-jni");
}

It works when I add abiFilters (tested od Nexus 5X which handles e.g. armeabi-v7a).

defaultConfig {
    ...
    ndk {
        abiFilters "armeabi-v7a", "x86", "armeabi", "mips"
    }
}

But it doesn't make sense to me. Why does adding abifilter change anything? If you understand it, maybe there should be some mention in readme about it.

Add RtmpClient.open return values to the API

RtmlClient.open has Javadoc that defines a number of possible return values:

     * -1 RTMP_Alloc error
     * -2 RTMP_SetupURL error
     * -3 RTMP_Connect error
     * -4 RTMP_ConnectStream error

Could these be exposed in the RtmpClient API as public static final int constants, so that code using RtmpClient can reference them rather than having to define their own?

frame_rate on server always 0

I have send video data by the function rmtpMuxer.writeVideo() but the frame_rate data on server always 0, Now video can be recorded on server on can't watch it live.

Does not sure what I should do, I want to make it able to watch it realtime.

librtmp acknowledgement and LGPL license included at project root?

IANAL, but the librtmp code that you have included in your library is under the LGPL, and it looks like Section 5 says that one can only create a combined library if the derivative is also LGPL. At the very least, I would expect you need to declare that this library include code licensed under the LGPL, and give the librtmp copyright in your NOTICE.

I'm worried that it is misleading to potential users of this library to offer it as Apache-licensed, when the core code is not under that license. It could come back to bite clients in commercial environments.

RtmpClient.write crashes

I am trying to use RtmpClient.write it crashes saying

A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0xdf in tid 1198 (AsyncTask #3)

This is my code snippet

if (rtmpURL != null && !rtmpURL.isEmpty()) {
                    try {
                        new AsyncTask<Void, Void, Void>() {
                            @Override
                            protected Void doInBackground(Void... voids) {
                                Log.d(TAG, "doInBackground execute");
//                                mRtmpClient.writeVideo(mFrameData,0,mFrameData.length, (int) System.currentTimeMillis());
                                try {
                                    Uri.Builder builder = Uri.parse(rtmpURL).buildUpon();
                                    builder.appendQueryParameter("live", "1");
                                    Log.d(TAG, "Final URL " + builder.build().toString());
                                    /*mRtmpClient.open(builder.build().toString() + "", PREVIEW_WIDTH, PREVIEW_HEIGHT);
                                    mRtmpClient.writeVideo(mFrameData, 0, mFrameData.length, (int) System.currentTimeMillis());*/
                                    mRtmpLive.open(builder.build().toString(),true);
                                    mRtmpLive.write(mFrameData);
                                } catch (Exception e) {
                                    e.printStackTrace();
                                }
                                return null;
                            }

                            @Override
                            protected void onPostExecute(Void aVoid) {
                                super.onPostExecute(aVoid);
                                Log.d(TAG, "OnPost execute");
                            }
                        }.execute();

                    } catch (Exception e) {
                        e.printStackTrace();
                    }
                }

READ_PHONE_STATE permission

as there is no minSdkSupport defined, 1 is assumed. this cause any project including this library to request Permission READ_PHONE_STATE. Which is bad if app is not actually making Phone calls!

Writing frames returns -1

Is there some way to check what a return code means?

I currently create a RTMPMuxer like so RTMPMuxer rtmpMuxer = new RTMPMuxer(); and open it using
int res = rtmpMuxer.open("rtmp://<url>", 1810, 1080);

I then try to send frames from the Android camera (NV21 format) using rtmpMuxer.writeVideo(arr, 0, arr.length, (int) System.currentTimeMillis()) where arr is the byte[] from the camera. But this returns -1.
I checked rtmpMuxer.isConnected() == 1 and that returns true, so it is connected.

How can I debug it not sending frames?

timestamp units

I have a question regarding the timestamp units that the API expects. I assume they are milliseconds, as it is stated by the RTMP specs. However I cannot figure out how to transmit audio, the data is sent and the handshake accepted, I can see it using wireshark. However I noticed that the timestamp is always reset to zero in each chunk. Should I use different timestamp units? Have you faced this issue before?

crash when i use ExoPlayer-with-RTMP-and-FLV-seek demo

hello, thanks for you works.

i download the ExoPlayer-with-RTMP-and-FLV-seek and run the demo, and i find some bugs when i'm testing:

  1. i tested the last two rtmp videos, usually, it works well at first, but when i open the rtmp PlayerActivity at about ten times continuity, the app crashed with the following logs. test phones. xiaomi huawei
  2. when there is no network. open the rtmp video PlayerActivity will crash directly with the similar logs.

could you please help me look at this issue, thanks!

jue


05-19 20:27:06.031 303-303/? I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** ** * * ***
05-19 20:27:06.031 303-303/? I/DEBUG: Build fingerprint: 'Huawei/G718/hwg718:4.1.2/HuaweiG718/C92B175:user/ota-rel-keys,release-keys'
05-19 20:27:06.031 303-303/? I/DEBUG: pid: 13557, tid: 13557, name: .exoplayer.demo >>> com.google.android.exoplayer.demo <<<
05-19 20:27:06.031 303-303/? I/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 000001aa
05-19 20:27:06.121 303-303/? I/DEBUG: r0 000005e8 r1 40005000 r2 5e608bfc r3 00000000
05-19 20:27:06.121 303-303/? I/DEBUG: r4 00003718 r5 5e608be8 r6 5e60c300 r7 00000196
05-19 20:27:06.121 303-303/? I/DEBUG: r8 00000a88 r9 4025165c sl 5e7e91b8 fp 00000000
05-19 20:27:06.121 303-303/? I/DEBUG: ip 000044c8 sp befef408 lr 4021c083 pc 4021c736 cpsr 60000030
05-19 20:27:06.121 303-303/? I/DEBUG: d0 0000000080000000 d1 0001380080000000
05-19 20:27:06.121 303-303/? I/DEBUG: d2 44a0000044340000 d3 3f80000000000500
05-19 20:27:06.121 303-303/? I/DEBUG: d4 0000000000000000 d5 0000000000000000
05-19 20:27:06.121 303-303/? I/DEBUG: d6 000000004016b6f8 d7 00000000c2480000
05-19 20:27:06.121 303-303/? I/DEBUG: d8 0000000000000000 d9 4434000042e00000
05-19 20:27:06.121 303-303/? I/DEBUG: d10 0000000043300000 d11 0000000000000000
05-19 20:27:06.121 303-303/? I/DEBUG: d12 0000000000000000 d13 0000000000000000
05-19 20:27:06.121 303-303/? I/DEBUG: d14 0000000000000000 d15 0000000000000000
05-19 20:27:06.121 303-303/? I/DEBUG: d16 0000000000000001 d17 0000000000000001
05-19 20:27:06.121 303-303/? I/DEBUG: d18 0000000000000002 d19 0070007300690044
05-19 20:27:06.121 303-303/? I/DEBUG: d20 004500790061006c d21 0074006e00650076
05-19 20:27:06.121 303-303/? I/DEBUG: d22 006e006e006f0043 d23 0069007400630065
05-19 20:27:06.121 303-303/? I/DEBUG: d24 0018001700160014 d25 001a0018001a0019
05-19 20:27:06.121 303-303/? I/DEBUG: d26 0000000000000000 d27 0000000000000000
05-19 20:27:06.121 303-303/? I/DEBUG: d28 011e011d011c011b d29 0120011f011e011c
05-19 20:27:06.121 303-303/? I/DEBUG: d30 001a001a001a001a d31 0000000000000000
05-19 20:27:06.121 303-303/? I/DEBUG: scr 68000013
05-19 20:27:06.141 303-303/? I/DEBUG: #00 pc 00014736 /system/lib/libc.so (dlmalloc+1769)
05-19 20:27:06.141 303-303/? I/DEBUG: #1 pc 00016fef /system/lib/libc.so (malloc+10)
05-19 20:27:06.151 303-303/? I/DEBUG: #2 pc 0000efdd /system/lib/libutils.so (android::SharedBuffer::alloc(unsigned int)+8)
05-19 20:27:06.151 303-303/? I/DEBUG: #3 pc 00011de7 /system/lib/libutils.so (android::VectorImpl::shrink(unsigned int, unsigned int)+80)
05-19 20:27:06.151 303-303/? I/DEBUG: #4 pc 00011e73 /system/lib/libutils.so (android::VectorImpl::removeItemsAt(unsigned int, unsigned int)+14)
05-19 20:27:06.151 303-303/? I/DEBUG: #5 pc 00028e29 /system/lib/libandroidfw.so (android::InputConsumer::consume(android::InputEventFactoryInterface
, bool, long long, unsigned int_, android::InputEvent)+296)
05-19 20:27:06.151 303-303/? I/DEBUG: #6 pc 0005a4d5 /system/lib/libandroid_runtime.so (android::NativeInputEventReceiver::consumeEvents(JNIEnv, bool, long long)+68)
05-19 20:27:06.151 303-303/? I/DEBUG: #7 pc 0005a68d /system/lib/libandroid_runtime.so (android::NativeInputEventReceiver::handleEvent(int, int, void_)+92)
05-19 20:27:06.151 303-303/? I/DEBUG: #8 pc 00014755 /system/lib/libutils.so (android::Looper::pollInner(int)+516)
05-19 20:27:06.151 303-303/? I/DEBUG: #9 pc 00014819 /system/lib/libutils.so (android::Looper::pollOnce(int, int_, int_, void
)+104)
05-19 20:27:06.151 303-303/? I/DEBUG: #10 pc 0005fa17 /system/lib/libandroid_runtime.so (android::NativeMessageQueue::pollOnce(JNIEnv, int)+22)
05-19 20:27:06.151 303-303/? I/DEBUG: #11 pc 0001fd30 /system/lib/libdvm.so (dvmPlatformInvoke+112)
05-19 20:27:06.151 303-303/? I/DEBUG: #12 pc 0004ea79 /system/lib/libdvm.so (dvmCallJNIMethod(unsigned int const_, JValue_, Method const_, Thread
)+360)
05-19 20:27:06.151 303-303/? I/DEBUG: #13 pc 00000214 /dev/ashmem/dalvik-jit-code-cache (deleted)
05-19 20:27:06.151 303-303/? I/DEBUG: befef3c8 00000000
05-19 20:27:06.151 303-303/? I/DEBUG: befef3cc 4237dc8e /system/lib/libdvm.so
05-19 20:27:06.151 303-303/? I/DEBUG: befef3d0 4239a578 /system/lib/libdvm.so
05-19 20:27:06.151 303-303/? I/DEBUG: befef3d4 40258a6c
05-19 20:27:06.151 303-303/? I/DEBUG: befef3d8 00000000
05-19 20:27:06.151 303-303/? I/DEBUG: befef3dc 00000000
05-19 20:27:06.151 303-303/? I/DEBUG: befef3e0 befef490 [stack]
05-19 20:27:06.151 303-303/? I/DEBUG: befef3e4 58708d60 /dev/ashmem/dalvik-LinearAlloc (deleted)
05-19 20:27:06.151 303-303/? I/DEBUG: befef3e8 befef4bc [stack]
05-19 20:27:06.151 303-303/? I/DEBUG: befef3ec befef4bc [stack]
05-19 20:27:06.151 303-303/? I/DEBUG: befef3f0 c0000000
05-19 20:27:06.151 303-303/? I/DEBUG: befef3f4 00003710
05-19 20:27:06.161 303-303/? I/DEBUG: befef3f8 00000000
05-19 20:27:06.161 303-303/? I/DEBUG: befef3fc 00000000
05-19 20:27:06.161 303-303/? I/DEBUG: befef400 df0027ad
05-19 20:27:06.161 303-303/? I/DEBUG: befef404 00000000
05-19 20:27:06.161 303-303/? I/DEBUG: #00 befef408 436f6210 /dev/ashmem/dalvik-heap (deleted)
05-19 20:27:06.161 303-303/? I/DEBUG: befef40c 436f6210 /dev/ashmem/dalvik-heap (deleted)
05-19 20:27:06.161 303-303/? I/DEBUG: befef410 58708d60 /dev/ashmem/dalvik-LinearAlloc (deleted)
05-19 20:27:06.161 303-303/? I/DEBUG: befef414 403e7f08
05-19 20:27:06.161 303-303/? I/DEBUG: befef418 befef43c [stack]
05-19 20:27:06.161 303-303/? I/DEBUG: befef41c 00003700
05-19 20:27:06.161 303-303/? I/DEBUG: befef420 00000000
05-19 20:27:06.161 303-303/? I/DEBUG: befef424 00000000
05-19 20:27:06.161 303-303/? I/DEBUG: befef428 00000001
05-19 20:27:06.161 303-303/? I/DEBUG: befef42c 5e7a0018
05-19 20:27:06.161 303-303/? I/DEBUG: befef430 befef4d0 [stack]
05-19 20:27:06.161 303-303/? I/DEBUG: befef434 5e7e91b8
05-19 20:27:06.161 303-303/? I/DEBUG: befef438 00000000
05-19 20:27:06.171 303-303/? I/DEBUG: befef43c 4021eff1 /system/lib/libc.so (malloc+12)
05-19 20:27:06.171 303-303/? I/DEBUG: #1 befef440 00000004
05-19 20:27:06.171 303-303/? I/DEBUG: befef444 40161fe1 /system/lib/libutils.so (android::SharedBuffer::alloc(unsigned int)+12)
05-19 20:27:06.171 303-303/? I/DEBUG: #2 befef448 5e7e9148
05-19 20:27:06.171 303-303/? I/DEBUG: befef44c 40164deb /system/lib/libutils.so (android::VectorImpl::shrink(unsigned int, unsigned int)+84)
05-19 20:27:06.181 303-303/? I/DEBUG: 40004fe0 00000000 00000000 00000000 00000000 ................
05-19 20:27:06.181 303-303/? I/DEBUG: 40004ff0 00000000 00000000 00000000 00000000 ................
05-19 20:27:06.181 303-303/? I/DEBUG: 40005000 00000000 0000001b 425a3780 4025156c .........7ZBl.%@
05-19 20:27:06.181 303-303/? I/DEBUG: 40005010 746e6f63 2e746e65 72616853 00000023 content.Shar#...
05-19 20:27:06.181 303-303/? I/DEBUG: 40005020 421cce00 00000005 00000008 00000000 ...B............
05-19 20:27:06.181 303-303/? I/DEBUG: 5e608bdc 691895f4 4fca8d9c abac74f0 10bbbc37 ...i...O.t..7...
05-19 20:27:06.181 303-303/? I/DEBUG: 5e608bec 000041a1 5e608be8 5e608be8 5e6b0428 .A....^..^(.k^
05-19 20:27:06.181 303-303/? I/DEBUG: 5e608bfc 00000196 4025165c 0000000c ffffffff .....%@........
05-19 20:27:06.181 303-303/? I/DEBUG: 5e608c0c 00000004 00000000 00000000 00000000 ................
05-19 20:27:06.181 303-303/? I/DEBUG: 5e608c1c 002625a0 002625a0 01000102 00000000 .%&..%&.........
05-19 20:27:06.181 303-303/? I/DEBUG: 000036f8 ffffffff ffffffff ffffffff ffffffff ................
05-19 20:27:06.181 303-303/? I/DEBUG: 00003708 ffffffff ffffffff ffffffff ffffffff ................
05-19 20:27:06.181 303-303/? I/DEBUG: 00003718 ffffffff ffffffff ffffffff ffffffff ................
05-19 20:27:06.181 303-303/? I/DEBUG: 00003728 ffffffff ffffffff ffffffff ffffffff ................
05-19 20:27:06.181 303-303/? I/DEBUG: 00003738 ffffffff ffffffff ffffffff ffffffff ................
05-19 20:27:06.181 303-303/? I/DEBUG: 5e608bc8 fe845556 366b3498 cb99b9df 7bb43898 VU...4k6.....8.{
05-19 20:27:06.181 303-303/? I/DEBUG: 5e608bd8 865f3e58 691895f4 4fca8d9c abac74f0 X>
....i...O.t..
05-19 20:27:06.191 303-303/? I/DEBUG: 5e608be8 10bbbc37 000041a1 5e608be8 5e608be8 7....A....^..^
05-19 20:27:06.191 303-303/? I/DEBUG: 5e608bf8 5e6b0428 00000196 4025165c 0000000c (.k^.....%@....
05-19 20:27:06.191 303-303/? I/DEBUG: 5e608c08 ffffffff 00000004 00000000 00000000 ................
05-19 20:27:06.191 303-303/? I/DEBUG: 5e60c2e0 00000000 00000000 00000000 00000000 ................
05-19 20:27:06.191 303-303/? I/DEBUG: 5e60c2f0 00000000 00000000 00000000 00000000 ................
05-19 20:27:06.191 303-303/? I/DEBUG: 5e60c300 00000000 00000000 00000000 00000000 ................
05-19 20:27:06.191 303-303/? I/DEBUG: 5e60c310 00000000 00000000 00000000 00000000 ................
05-19 20:27:06.191 303-303/? I/DEBUG: 5e60c320 00000000 00000000 00000000 00000000 ................
05-19 20:27:06.191 303-303/? I/DEBUG: 4025163c 5e7295b0 5e6002e8 5e3e4ad0 5e7de9a8 ..r^..^.J>^..}^ 05-19 20:27:06.191 303-303/? I/DEBUG: 4025164c 5e7dd230 5e6b8d18 5e7d2428 00000000 0.}^..k^($}^.... 05-19 20:27:06.191 303-303/? I/DEBUG: 4025165c 5e608be8 5e7188f0 00000000 00000000 ..^..q^........
05-19 20:27:06.191 303-303/? I/DEBUG: 4025166c 00000000 00000000 00000000 00000000 ................
05-19 20:27:06.191 303-303/? I/DEBUG: 4025167c 00000000 00000000 00000000 00000000 ................
05-19 20:27:06.191 303-303/? I/DEBUG: 5e7e9198 00000000 00000000 00000000 00000000 ................
05-19 20:27:06.191 303-303/? I/DEBUG: 5e7e91a8 4016b6f8 00000000 00000000 00000007 ...@............
05-19 20:27:06.191 303-303/? I/DEBUG: 5e7e91b8 403042a0 00000007 00001002 00000002 .B0@............
05-19 20:27:06.201 303-303/? I/DEBUG: 5e7e91c8 00000000 00000000 00000000 00000000 ................
05-19 20:27:06.201 303-303/? I/DEBUG: 5e7e91d8 00000000 00000000 3f800000 3f800000 ...........?...?
05-19 20:27:06.201 303-303/? I/DEBUG: 000044a8 ffffffff ffffffff ffffffff ffffffff ................
05-19 20:27:06.201 303-303/? I/DEBUG: 000044b8 ffffffff ffffffff ffffffff ffffffff ................
05-19 20:27:06.201 303-303/? I/DEBUG: 000044c8 ffffffff ffffffff ffffffff ffffffff ................
05-19 20:27:06.201 303-303/? I/DEBUG: 000044d8 ffffffff ffffffff ffffffff ffffffff ................
05-19 20:27:06.201 303-303/? I/DEBUG: 000044e8 ffffffff ffffffff ffffffff ffffffff ................
05-19 20:27:06.201 303-303/? I/DEBUG: befef3e8 befef4bc befef4bc c0000000 00003710 .............7..
05-19 20:27:06.201 303-303/? I/DEBUG: befef3f8 00000000 00000000 df0027ad 00000000 .........'......
05-19 20:27:06.201 303-303/? I/DEBUG: befef408 436f6210 436f6210 58708d60 403e7f08 .boC.boC.pX..>@ 05-19 20:27:06.201 303-303/? I/DEBUG: befef418 befef43c 00003700 00000000 00000000 <....7.......... 05-19 20:27:06.201 303-303/? I/DEBUG: befef428 00000001 5e7a0018 befef4d0 5e7e91b8 ......z^......~^ 05-19 20:27:06.201 303-303/? I/DEBUG: 4021c714 1610f8df 44794478 696fe01d 0214f105 ....xDyD..oi.... 05-19 20:27:06.201 303-303/? I/DEBUG: 4021c724 692fb93f 0210f105 e017b91f 0214f107 ?./i............ 05-19 20:27:06.201 303-303/? I/DEBUG: 4021c734 69786817 d1f92800 b113693b 0210f107 .hxi.(..;i...... 05-19 20:27:06.201 303-303/? I/DEBUG: 4021c744 428ae7f6 6013bf28 f8dfd209 f8df05dc ...B(..........
05-19 20:27:06.201 303-303/? I/DEBUG: 4021c754 447815dc f7ff4479 e000f941 f1b9461f ..xDyD..A....F..
05-19 20:27:06.211 303-303/? I/DEBUG: 4021c060 b930fd21 2becf8df f8d2447a 078b11b4 !.0....+zD......
05-19 20:27:06.211 303-303/? I/DEBUG: 4021c070 f8dfd50a 447d5be4 70dcf505 f7fe2500 .....[}D...p.%..
05-19 20:27:06.211 303-303/? I/DEBUG: 4021c080 2800e958 8249f041 f2002cf4 2c0a823f X..(A.I..,..?..,
05-19 20:27:06.211 303-303/? I/DEBUG: 4021c090 340bd903 0407f024 2410e000 7bbcf8df ...4$......$...{
05-19 20:27:06.211 303-303/? I/DEBUG: 4021c0a0 447f08e2 fa36683e 079df302 f003d042 ...D>h6.....B...
05-19 20:27:06.351 775-848/? I/BootReceiver: Copying /data/tombstones/tombstone_02 to DropBox (SYSTEM_TOMBSTONE)
05-19 20:27:06.381 775-786/? I/WindowState: WIN DEATH: Window{4365ba20 com.google.android.exoplayer.demo/com.google.android.exoplayer.demo.SampleChooserActivity paused=false}
05-19 20:27:06.381 775-9773/? I/ActivityManager: Process com.google.android.exoplayer.demo (pid 13557) has died.
05-19 20:27:06.381 775-9773/? W/ActivityManager: Force removing ActivityRecord{44340a98 com.google.android.exoplayer.demo/.PlayerActivity}: app died, no saved state
05-19 20:27:06.381 775-1124/? I/WindowState: WIN DEATH: Window{43a82a70 SurfaceView paused=false}
05-19 20:27:06.391 775-21807/? I/WindowState: WIN DEATH: Window{43a7a300 com.google.android.exoplayer.demo/com.google.android.exoplayer.demo.PlayerActivity paused=false}
05-19 20:27:06.391 775-21807/? W/WindowManager: Force-removing child win Window{43cfdb58 Panel:com.google.android.exoplayer.demo/com.google.android.exoplayer.demo.PlayerActivity paused=false} from container Window{43a7a300 com.google.android.exoplayer.demo/com.google.android.exoplayer.demo.PlayerActivity paused=false}
05-19 20:27:06.391 775-21807/? D/PowerManagerService: releaseWakeLock flags=0x2000000a tag=KEEP_SCREEN_ON_FLAG
05-19 20:27:06.391 775-1161/? W/WindowManager: Failed looking up window
java.lang.IllegalArgumentException: Requested window android.os.BinderProxy@43a91878 does not exist
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7709)
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:7700)
at com.android.server.wm.WindowState$DeathRecipient.binderDied(WindowState.java:854)
at android.os.BinderProxy.sendDeathNotice(Binder.java:449)
at dalvik.system.NativeStart.run(Native Method)
05-19 20:27:06.391 775-1161/? I/WindowState: WIN DEATH: null
05-19 20:27:06.421 775-9773/? I/ActivityManager: Start proc com.google.android.exoplayer.demo for activity com.google.android.exoplayer.demo/.SampleChooserActivity: pid=15079 uid=10082 gids={3003, 1028, 1015}
05-19 20:27:06.441 775-1080/? W/ActivityRecord: goujw packagename: com.google.android.exoplayer.demo
05-19 20:27:06.441 775-1080/? W/ActivityRecord: goujw userId: 0
05-19 20:27:06.451 775-1080/? V/LightsService: setBrightness brightness1=150
05-19 20:27:06.451 775-1080/? V/LightsService: setPowerSaving brightness2=150
05-19 20:27:06.461 15079-15079/? E/Trace: error opening trace file: No such file or directory (2)
05-19 20:27:06.461 15079-15079/? D/ActivityThread: setTargetHeapUtilization:0.25
05-19 20:27:06.461 15079-15079/? D/ActivityThread: setTargetHeapIdealFree:8388608
05-19 20:27:06.461 15079-15079/? D/ActivityThread: setTargetHeapConcurrentStart:2097152
05-19 20:27:06.471 15079-15079/? D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 0ms
05-19 20:27:06.471 15079-15079/? W/dalvikvm: Refusing to reopen boot DEX '/system/framework/hwframework.jar'
05-19 20:27:06.521 775-776/? E/dalvikvm: GC_CONCURRENT freed 2259K, 47% free 22905K/42503K, paused 15ms+10ms, total 118ms
05-19 20:27:06.521 775-869/? D/dalvikvm: WAIT_FOR_CONCURRENT_GC blocked 104ms
05-19 20:27:06.621 15079-15079/? I/Adreno200-EGL: <qeglDrvAPI_eglInitialize:269>: EGL 1.4 QUALCOMM build: (CL2924417)
Build Date: 08/22/13 Thu
Local Branch: Huawei_01270965
Remote Branch:
Local Patches:
Reconstruct Branch:
05-19 20:27:06.842 1065-1065/? D/PinyinIME: onStartInput ccontentType: 0 Restarting:false
05-19 20:27:06.842 1065-1065/? D/Settings: getAllInstallLangId().length3
05-19 20:27:06.842 1065-1065/? D/Settings: getAllInstallLangId().length3
05-19 20:27:06.842 775-1127/? W/InputMethodManagerService: Got RemoteException sending setActive(false) notification to pid 13557 uid 10082
05-19 20:27:06.852 775-869/? I/ActivityManager: Displayed com.google.android.exoplayer.demo/.SampleChooserActivity: +452ms

Question about timestamp in rtmpMuxer

Normal timestamp is long, but in rtmpMuxer.write() the timestamp is int. What is the timestamp mean in function write? I use System.current() or SystemClock.es... sometimes work but sometime return -1. The timestamp puzzled me.
Forgive my poor English, sorry.
Thank you a lot.

RTMP - Fatal signal 11 (SIGSEGV) when switching into airplane mode

Issue description

During RTMP stream playback with Exoplayer, when i switch the phone to airplane mode, exoplayer throws the following exception , the error handler block of exoplayer doesn't get called and the process dies.

E ExoPlayerImplInternal: Source error.
E ExoPlayerImplInternal: net.butterflytv.rtmp_client.RtmpClient$RtmpIOException
E ExoPlayerImplInternal: at net.butterflytv.rtmp_client.RtmpClient.open(RtmpClient.java:55)
E ExoPlayerImplInternal: at com.google.android.exoplayer2.ext.rtmp.RtmpDataSource.open(RtmpDataSource.java:57)
E ExoPlayerImplInternal: at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:141)
E ExoPlayerImplInternal: at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:702)
E ExoPlayerImplInternal: at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:315)
E ExoPlayerImplInternal: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
E ExoPlayerImplInternal: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
E ExoPlayerImplInternal: at java.lang.Thread.run(Thread.java:764)
F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0xc22e83b4 in tid 22827 (Loader:Extracto), pid 21732 ()
Reproduction steps

Just start playing any stream with exoplayer and then switch to airplane mode or close the network connection.

    final BandwidthMeter bandwidthMeter = new DefaultBandwidthMeter();
    final TrackSelection.Factory videoTrackSelectionFactory = new AdaptiveTrackSelection.Factory(bandwidthMeter);
    TrackSelector trackSelector = new DefaultTrackSelector(videoTrackSelectionFactory);
    player = ExoPlayerFactory.newSimpleInstance(getContext(), trackSelector);
    Surface videoSurface = new Surface(getSurfaceTexture());
    player.setVideoSurface(videoSurface);
    DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(getContext(), "testapplication");
    ExtractorsFactory extractorsFactory = new DefaultExtractorsFactory();
    MediaSource videoSource =
            new ExtractorMediaSource(Uri.parse(getCurrentVideoUrl()),
                    dataSourceFactory,
                    extractorsFactory,
                    null,
                    null);
    player.addListener(new PlayerEventHandler(this));
    player.setRepeatMode(Player.REPEAT_MODE_ALL);
    player.prepare(videoSource);

Link to test content

Version of ExoPlayer being used

Exoplayer 2.6.0 is used
//Exoplayer Support Added Here
implementation 'com.google.android.exoplayer:exoplayer:2.6.0'
//Support For Rtmp Streaming Added Here
implementation 'com.google.android.exoplayer:extension-rtmp:2.6.0'

Device(s) and version(s) of Android being used

NEXUS 5 7.0
GM5 Plus 7.0
Android Emulator Android 8.1.0
Android Emulator Android 8.0

A full bug report captured from the device

bugreport-sdk_gphone_x86-OPM1.171004.001-2017-12-16-00-05-18.zip

Relevant part of the bug report:

12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: Source error.
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: net.butterflytv.rtmp_client.RtmpClient$RtmpIOException
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: at net.butterflytv.rtmp_client.RtmpClient.open(RtmpClient.java:55)
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: at com.google.android.exoplayer2.ext.rtmp.RtmpDataSource.open(RtmpDataSource.java:57)
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: at com.google.android.exoplayer2.upstream.DefaultDataSource.open(DefaultDataSource.java:141)
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: at com.google.android.exoplayer2.source.ExtractorMediaPeriod$ExtractingLoadable.load(ExtractorMediaPeriod.java:702)
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: at com.google.android.exoplayer2.upstream.Loader$LoadTask.run(Loader.java:315)
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162)
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636)
12-16 00:04:59.321 10080 23330 29613 E ExoPlayerImplInternal: at java.lang.Thread.run(Thread.java:764)
12-16 00:04:59.322 10080 23330 29614 F libc : Fatal signal 11 (SIGSEGV), code 1, fault addr 0xc1feefb4 in tid 29614 (Loader:Extracto), pid 23330 (co.wormapp.worm)
12-16 00:04:59.342 10080 23330 23330 D wormlog : Player exception occurred:com.google.android.exoplayer2.ExoPlaybackException
12-16 00:04:59.342 10080 23330 23330 D wormlog : Player rtmp exception occurred:-3
12-16 00:04:59.342 10080 23330 23330 I ExoPlayerImpl: Release 1d5c0fe [ExoPlayerLib/2.6.0] [generic_x86, Android SDK built for x86, Google, 27] [goog.exo.core, goog.exo.rtmp]
12-16 00:04:59.338 10080 29670 29670 W crash_dump32: type=1400 audit(0.0:17): avc: denied { search } for name="uk.co.wormapp.worm" dev="dm-0" ino=115523 scontext=u:r:crash_dump:s0:c512,c768 tcontext=u:object_r:app_data_file:s0:c512,c768 tclass=dir permissive=0
12-16 00:04:59.382 10080 29670 29670 I crash_dump32: obtaining output fd from tombstoned, type: kDebuggerdTombstone
12-16 00:04:59.382 1058 1511 1511 I /system/bin/tombstoned: received crash request for pid 23330
12-16 00:04:59.385 10080 29670 29670 I crash_dump32: performing dump of process 23330 (target tid = 29614)
12-16 00:04:59.385 10080 29670 29670 F DEBUG : *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
12-16 00:04:59.385 10080 29670 29670 F DEBUG : Build fingerprint: 'google/sdk_gphone_x86/generic_x86:8.1.0/OPM1.171004.001/4376136:user/release-keys'
12-16 00:04:59.385 10080 29670 29670 F DEBUG : Revision: '0'
12-16 00:04:59.385 10080 29670 29670 F DEBUG : ABI: 'x86'
12-16 00:04:59.385 10080 29670 29670 F DEBUG : pid: 23330, tid: 29614, name: Loader:Extracto >>> uk.co.wormapp.worm <<<
12-16 00:04:59.385 10080 29670 29670 F DEBUG : signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0xc1feefb4
12-16 00:04:59.385 10080 29670 29670 F DEBUG : eax 13805f60 ebx fff80000 ecx 8a180000 edx 00000063
12-16 00:04:59.385 10080 29670 29670 F DEBUG : esi ae7df79c edi 8a182444
12-16 00:04:59.385 10080 29670 29670 F DEBUG : xcs 00000073 xds 0000007b xes 0000007b xfs 0000003b xss 0000007b
12-16 00:04:59.385 10080 29670 29670 F DEBUG : eip ae793921 ebp 8207f6c8 esp 8207f660 flags 00010a07
12-16 00:04:59.387 10080 29670 29670 F DEBUG :
12-16 00:04:59.387 10080 29670 29670 F DEBUG : backtrace:
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #00 pc 00093921 /system/lib/libc.so (arena_run_dalloc+113)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #1 pc 0008e500 /system/lib/libc.so (arena_dalloc_large_locked_impl+224)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #2 pc 0008e40b /system/lib/libc.so (je_arena_dalloc_large_junked_locked+43)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #3 pc 000b2cea /system/lib/libc.so (je_tcache_bin_flush_large+378)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #4 pc 000b3c0f /system/lib/libc.so (tcache_destroy+607)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #5 pc 000b3994 /system/lib/libc.so (je_tcache_cleanup+36)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #6 pc 000b4436 /system/lib/libc.so (je_tsd_cleanup+70)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #7 pc 000b54bc /system/lib/libc.so (je_tsd_cleanup_wrapper+44)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #8 pc 00071b84 /system/lib/libc.so (pthread_key_clean_all()+164)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #9 pc 000715d9 /system/lib/libc.so (pthread_exit+89)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #10 pc 0007144d /system/lib/libc.so (__pthread_start(void*)+61)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #11 pc 000205db /system/lib/libc.so (_start_thread+75)
12-16 00:04:59.387 10080 29670 29670 F DEBUG : #12 pc 0001ec16 /system/lib/libc.so (

Crash when using ExoPlayer-with-RTMP-and-FLV-seek demo

Thanks for your excellent library and demo, it crashes when I start PlayerActivity and then finish it on and on, and the logs are as below,

com.google.android.exoplayer.demo A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x18 in tid 2134 (RenderThread)

please tell me how to resolve it.

Thanks again!

Reusing ExoPlayer with Rtmp streams is crashing the app

I have an ExoPlayer with Surface view on my MainActivity and I'm trying to switch between multiple Rtmp Stream directly from the MainActivity.

The initial Rtmp Stream works as expected but whenever I try to switch to a new Rtmp Stream it crashes on me.

This is the code used for both playing the first stream/video & switching to different stream/video.

public void preparePlayer(Context context, Uri uri, VideoStreamingType videoStreamingType) {
        if (mRendererBuildingState == RENDERER_BUILDING_STATE_BUILT) {
            stopVideo();
        }
        mPlayerNeedsPrepare = true;
        mVideoUri = uri;
        mRendererBuilder = getRenderer(context, uri, videoStreamingType);
        if (mPlayerNeedsPrepare) {
            prepare();
            mPlayerNeedsPrepare = false;
        }
        mExoPlayer.setPlayWhenReady(true);
    }

public void prepare() {
        mVideoFormat = null;
        mVideoRenderer = null;
        mRendererBuildingState = RENDERER_BUILDING_STATE_BUILDING;
        maybeReportPlayerState();
        mRendererBuilder.buildRenderers(this, mMediaCodecAudioVideoTrackRendererEventListener);
    }

public void stopVideo() {
        mRendererBuilder.cancel();
        mExoPlayer.stop();
        mExoPlayer.seekTo(0L);
    }

getRenderer() provides me ExtractorRendererBuilder class that you modified on the integration of this Library and ExoPlayer if I'm passing in a link for rtmp stream.

I tested switching between normal videos (mp4, webM, mkv) and hls stream videos they work as expected no crashes so far.

Could you help me find a solution for this issue ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.