Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot stream an MP3 #81

Closed
vibin opened this issue Oct 2, 2014 · 10 comments
Closed

Cannot stream an MP3 #81

vibin opened this issue Oct 2, 2014 · 10 comments

Comments

@vibin
Copy link

vibin commented Oct 2, 2014

Hello. I haven't been able to stream MP3 files using ijkplayer. I went through the setup of ndk and generating .so files. All that is done, but I get a "Protocol not found" error. Full log below

15858               dalvikvm  D  Trying to load lib /data/app-lib/com.vibin.billy.debug-2/libstlport_shared.so 0x42f79820

 15858               dalvikvm  D  Added shared lib /data/app-lib/com.vibin.billy.debug-2/libstlport_shared.so 0x42f79820

 15858               dalvikvm  D  No JNI_OnLoad found in /data/app-lib/com.vibin.billy.debug-2/libstlport_shared.so 0x42f79820, skipping init

 15858               dalvikvm  D  Trying to load lib /data/app-lib/com.vibin.billy.debug-2/libijkffmpeg.so 0x42f79820

 15858                 linker  W  libijkffmpeg.so has text relocations. This is wasting memory and is a security risk. Please fix.

 15858               dalvikvm  D  Added shared lib /data/app-lib/com.vibin.billy.debug-2/libijkffmpeg.so 0x42f79820

 15858               dalvikvm  D  No JNI_OnLoad found in /data/app-lib/com.vibin.billy.debug-2/libijkffmpeg.so 0x42f79820, skipping init

 15858               dalvikvm  D  Trying to load lib /data/app-lib/com.vibin.billy.debug-2/libijkutil.so 0x42f79820

 15858               dalvikvm  D  Added shared lib /data/app-lib/com.vibin.billy.debug-2/libijkutil.so 0x42f79820

 15858               dalvikvm  D  Trying to load lib /data/app-lib/com.vibin.billy.debug-2/libijkadk.so 0x42f79820

 15858               dalvikvm  D  Added shared lib /data/app-lib/com.vibin.billy.debug-2/libijkadk.so 0x42f79820

 15858               dalvikvm  D  No JNI_OnLoad found in /data/app-lib/com.vibin.billy.debug-2/libijkadk.so 0x42f79820, skipping init

 15858               dalvikvm  D  Trying to load lib /data/app-lib/com.vibin.billy.debug-2/libijksdl.so 0x42f79820

 15858               dalvikvm  D  Added shared lib /data/app-lib/com.vibin.billy.debug-2/libijksdl.so 0x42f79820

 15858               dalvikvm  D  Trying to load lib /data/app-lib/com.vibin.billy.debug-2/libijkplayer.so 0x42f79820

 15858               dalvikvm  D  Added shared lib /data/app-lib/com.vibin.billy.debug-2/libijkplayer.so 0x42f79820
 15858               IJKMEDIA  W  IjkMediaPlayer_native_init
 15858               IJKMEDIA  W  IjkMediaPlayer_native_setup
 15858         PPlayerService  D  Service's onCreate
 15858               IJKMEDIA  W  IjkMediaPlayer_reset
 15858               IJKMEDIA  W  IjkMediaPlayer_release
 15858               IJKMEDIA  W  ijkmp_set_android_surface(surface=0x0)
 15858               IJKMEDIA  W  ijkmp_set_android_surface(surface=0x0)=void
 15858               IJKMEDIA  W  ijkmp_shutdown_l()
 15858               IJKMEDIA  W  ijkmp_shutdown_l()=void
 15858               IJKMEDIA  W  IjkMediaPlayer_native_setup
 15858               IJKMEDIA  W  IjkMediaPlayer_reset
 15858               IJKMEDIA  W  IjkMediaPlayer_release
 15858               IJKMEDIA  W  ijkmp_set_android_surface(surface=0x0)
 15858               IJKMEDIA  W  ijkmp_set_android_surface(surface=0x0)=void
 15858               IJKMEDIA  W  ijkmp_shutdown_l()
 15858               IJKMEDIA  W  ijkmp_shutdown_l()=void
 15858               IJKMEDIA  W  IjkMediaPlayer_native_setup
 15858               IJKMEDIA  W  IjkMediaPlayer_setDataSourceAndHeaders
 15858               IJKMEDIA  V  setDataSource: path https://ec-media.soundcloud.com/5aR86CFZOsAy.128.mp3?f10880d39085a94a0418a7ef69b03d522cd6dfee9399eeb9a522009e6dfeba35a6231300b9773.......
 15858               IJKMEDIA  W  ijkmp_set_data_source(url="https://ec-media.soundcloud.com/5aR86CFZOsAy.128.mp3?f10880d39085a94a0418a7ef69b03d522cd6dfee9399eeb9a522009e6dfeba35a62313...........
 15858               IJKMEDIA  W  ijkmp_set_data_source(url="https://ec-media.soundcloud.com/5aR86CFZOsAy.128.mp3?f10880d39085a94a0418a7ef69b03d522cd6dfee9399eeb9a522009e6dfeba35a62313.......
 15858         PPlayerService  D  service https://ec-media.soundcloud.com/5aR86CFZOsAy.128.mp3?f10880d39085a94a0418a7ef69b0301efcce2eb8236ce3fcd961f0...............
 15858               IJKMEDIA  W  IjkMediaPlayer_prepareAsync
 15858               IJKMEDIA  W  ijkmp_prepare_async()
 15858               IJKMEDIA  I  SDL_RunThread: [16509] ff_msg_loop
 15858               IJKMEDIA  W  message_loop
 15858               IJKMEDIA  W  FFP_MSG_FLUSH:
 15858               IJKMEDIA  W  ijkmp_prepare_async()=0
 15858               IJKMEDIA  I  SDL_RunThread: [16511] ff_read
 15858               IJKMEDIA  I  SDL_RunThread: [16510] ff_vout
 15858               IJKMEDIA  E  https://ec-media.soundcloud.com/5aR86CFZOsAy.128.mp3?f10880d39085a94a0418a7ef69b03d522cd6dfee9399eeb9a522009e6dfeba35a6231300b9...........: Protocol not found
 15858               IJKMEDIA  W  FFP_MSG_ERROR: 0
 15858   tv.danmaku.ijk.med..  E  Error (-10000,0)

Did I screw up the setup? Why does it say " No JNI_OnLoad found "?
Also, MP3 and HLS Audio (m3u8) are supported by this library right?
Thanks a lot!

@bbcallen
Copy link
Contributor

bbcallen commented Oct 3, 2014

If you prefer more codec/format
ln -fs config/module-default.sh config/module.sh

and then
sh compile-ffmpeg clean
sh compile-ffmpeg all

@vibin
Copy link
Author

vibin commented Oct 3, 2014

Doesn't the default module.sh point(symlink) to module-lite.sh which does contain mp3?

I just need mp3 and HLS.

@waninkoko
Copy link

The problem is related to 'https' not being supported. Did you compile openssl before compiling FFmpeg? If not, FFmpeg will be compiled without SSL, and that means not https support.

@vibin
Copy link
Author

vibin commented Oct 4, 2014

Okay, I just tried playing an mp3 from a http url and I get a different error now. Log below. Thanks.

It says "could not find codec parameters".

  1350               IJKMEDIA  W  Could not find codec parameters for stream 0 (Audio: mp3, 44100 Hz, 2 channels, 128 kb/s): unspecified frame size
  1350               IJKMEDIA  W  Consider increasing the value for the 'analyzeduration' and 'probesize' options
  1350               IJKMEDIA  W  http://ec-media.soundcloud.com/p7Uw60gtODDZ.128.mp3?f10880d39085a94a0418a7ef69b03d522cd6dfee9399eeb9a522009e6bf9b93b1c57cf78a3e4865f4b47b62a40b86e0209984a23f40484b51853d2c1e8a7dc8285658d0e8e&AWSAccessKeyId=AKIAJNIGGLK7XA7YZSNQ&Expires=1412417762&Signature=Oz5cUbgp06dzFOy3aTBm0txXSIY%3D: could not find codec parameters
  1350               IJKMEDIA  W  FFP_MSG_ERROR: 0
  1350   tv.danmaku.ijk.med..  E  Error (-10000,0)

@vibin
Copy link
Author

vibin commented Oct 4, 2014

Any update on this?

@bbcallen
Copy link
Contributor

bbcallen commented Oct 8, 2014

Do you mind to share this file to some place I can download and debug?
Or try
setAvFormatOption("analyzeduration", );
setAvFormatOption("probesize", );

@vibin
Copy link
Author

vibin commented Oct 8, 2014

I started using LibVLC and it works well, no problems at all with http/https or rtmp urls.

That mp3 url is a temporary url returned by SoundCloud API, so it's not accessible now. But nothing special, it's a normal mp3.

@bbcallen
Copy link
Contributor

The default module-lite.sh only contains features what I myself need.

In ffmpeg directory, run
./configure --list-decoders
./configure --list-demuxers
./configure --list-parsers
./configure --list-protocols

Pick up what you need, and make up a config file, as module-life.sh does,

I'm not good at ffmpeg enough to find out the real problem without run it.
Would you mind to share another non-temporary, normal mp3?

BTW: Seems android.media.MediaPlayer support mp3 on most devices, why not use that?

@vibin
Copy link
Author

vibin commented Oct 11, 2014

https://api.soundcloud.com/tracks/143553285/stream?client_id=apigee -- this url will redirect to the actual mp3 url. Open it.

Regarding android.media.MediaPlayer, well I wanted mp3+hls (or rtmp) support in one player.
As it turns out, VLC handles rtmp well, and of course plays mp3s. So I'm happy with that.

I thought the default module-lite.sh contained mp3. May be I'm wrong.

@bbcallen
Copy link
Contributor

Feel free to reopen if any more question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants