wseemann / FFmpegMediaPlayer

FFmpegMediaPlayer can be used to control playback of audio/video files and streams.
673 stars 201 forks source link

Error (0, 0) for playing RTMP url #123

Open rameshbo opened 7 years ago

rameshbo commented 7 years ago

Hi,

I love FFmpeg Mediaplayer as i found this good player after days of search.

I am unable to play RTMP url from my RTMP url is valid. rtmp://airlive.nic.in/livepkgr/airmarathi. i tested it. (you could test it online here https://www.hlsplayer.net/rtmp-player)

I used the prebuilt AAR provided by you in the home page.

Here is the stacktrace...

I/System.out: waiting for debugger to settle... I/System.out: waiting for debugger to settle... I/System.out: debugger has settled (1395) D/PhoneWindowEx: [PWEx][generateLayout] setLGNavigationBarColor : colors=0xff000000 I/PhoneWindow: [setLGNavigationBarColor] color=0x ff000000 V/FFmpegMediaPlayer-JNI: native_init V/FFmpegMediaPlayer-JNI: native_setup V/FFmpegMediaPlayer-JNI: setDataSource: path rtmp://airlive.nic.in/livepkgr/airmarathi D/libc: skt_base:0, kt_base:0, mptcp_enabled:0, socks_enabled:0, wifi_connected:1 D/libc: getaddrinfo called from pid =13793 D/libc: skt_base:0, kt_base:0, mptcp_enabled:0, socks_enabled:0, wifi_connected:1 D/libc: getaddrinfo called from pid =13793 D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true D/PhoneWindow: notifyNavigationBarColor, color=0x: ff000000, token: android.view.ViewRootImplAO$WEx@f1c9767 I/Adreno-EGL: : EGL 1.4 QUALCOMM build: Nondeterministic_AU_msm8909_LA.BR.1.2.6_RB1__release_AU (Idd51518bdf) OpenGL ES Shader Compiler Version: E031.29.00.00 Build Date: 12/11/15 Fri Local Branch: Remote Branch: quic/LA.BR.1.2.6_rb1.5 Local Patches: NONE Reconstruct Branch: NOTHING I/OpenGLRenderer: Initialized EGL, version 1.4 V/RenderScript: 0xb923ecf8 Launching thread(s), CPUs 4 I/Timeline: Timeline: Activity_idle id: android.os.BinderProxy@c61a44e time:352862330 V/FFmpegMediaPlayer-JNI: notify: 100 E/FFmpegMediaPlayer: Error (0,0) V/FFmpegMediaPlayer-JNI: release V/ViewRootImpl: Contents drawing finished : com.xyz.abc/com.xyz.abc.MainActivity Disconnected from the target VM, address: 'localhost:8601', transport: 'socket'

Here is my code:

    String rtmpUrl= "rtmp://airlive.nic.in/livepkgr/airmarathi";
    FFmpegMediaPlayer mp = new FFmpegMediaPlayer();
    mp.setOnPreparedListener(new FFmpegMediaPlayer.OnPreparedListener() {

        @Override
        public void onPrepared(FFmpegMediaPlayer mp) {
            mp.start();
        }

    });

    mp.setOnErrorListener(new FFmpegMediaPlayer.OnErrorListener() {

        @Override
        public boolean onError(FFmpegMediaPlayer mp, int what, int extra) {
            mp.release();
            return false;
        }
    });

    mp.setOnCompletionListener(new FFmpegMediaPlayer.OnCompletionListener() {
        @Override
        public void onCompletion(FFmpegMediaPlayer mp) {
            mp.release();
            return;
        }
    });

    try {
        mp.setDataSource(rtmpUrl);
        mp.prepareAsync();
    } catch (IllegalArgumentException e) {
        e.printStackTrace();
    } catch (SecurityException e) {
        e.printStackTrace();
    } catch (IllegalStateException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }

can someone please help to fix it.

Thanks, Ramesh.

hexlay commented 7 years ago

same here, even decreased target API, in my case no crash or anything, just no audio is played

codaman commented 4 years ago

same as mine

titosobabas commented 4 years ago

same here, any help?