Android/iOS video player based on FFmpeg n3.4, with MediaCodec, VideoToolbox support.

Overview

ijkplayer

Platform Build Status
Android Build Status
iOS Build Status

Video player based on ffplay

Download

  • Android:
  • Gradle
# required
allprojects {
    repositories {
        jcenter()
    }
}

dependencies {
    # required, enough for most devices.
    compile 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
    compile 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8'

    # Other ABIs: optional
    compile 'tv.danmaku.ijk.media:ijkplayer-armv5:0.8.8'
    compile 'tv.danmaku.ijk.media:ijkplayer-arm64:0.8.8'
    compile 'tv.danmaku.ijk.media:ijkplayer-x86:0.8.8'
    compile 'tv.danmaku.ijk.media:ijkplayer-x86_64:0.8.8'

    # ExoPlayer as IMediaPlayer: optional, experimental
    compile 'tv.danmaku.ijk.media:ijkplayer-exo:0.8.8'
}
  • iOS
  • in coming...

My Build Environment

Latest Changes

Features

  • Common
  • remove rarely used ffmpeg components to reduce binary size config/module-lite.sh
  • workaround for some buggy online video.
  • Android
  • platform: API 9~23
  • cpu: ARMv7a, ARM64v8a, x86 (ARMv5 is not tested on real devices)
  • api: MediaPlayer-like
  • video-output: NativeWindow, OpenGL ES 2.0
  • audio-output: AudioTrack, OpenSL ES
  • hw-decoder: MediaCodec (API 16+, Android 4.1+)
  • alternative-backend: android.media.MediaPlayer, ExoPlayer
  • iOS
  • platform: iOS 7.0~10.2.x
  • cpu: armv7, arm64, i386, x86_64, (armv7s is obselete)
  • api: MediaPlayer.framework-like
  • video-output: OpenGL ES 2.0
  • audio-output: AudioQueue, AudioUnit
  • hw-decoder: VideoToolbox (iOS 8+)
  • alternative-backend: AVFoundation.Framework.AVPlayer, MediaPlayer.Framework.MPMoviePlayerControlelr (obselete since iOS 8)

NOT-ON-PLAN

  • obsolete platforms (Android: API-8 and below; iOS: pre-6.0)
  • obsolete cpu: ARMv5, ARMv6, MIPS (I don't even have these types of devices…)
  • native subtitle render
  • avfilter support

Before Build

# install homebrew, git, yasm
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git
brew install yasm

# add these lines to your ~/.bash_profile or ~/.profile
# export ANDROID_SDK=<your sdk path>
# export ANDROID_NDK=<your ndk path>

# on Cygwin (unmaintained)
# install git, make, yasm
  • If you prefer more codec/format
cd config
rm module.sh
ln -s module-default.sh module.sh
cd android/contrib
# cd ios
sh compile-ffmpeg.sh clean
  • If you prefer less codec/format for smaller binary size (include hevc function)
cd config
rm module.sh
ln -s module-lite-hevc.sh module.sh
cd android/contrib
# cd ios
sh compile-ffmpeg.sh clean
  • If you prefer less codec/format for smaller binary size (by default)
cd config
rm module.sh
ln -s module-lite.sh module.sh
cd android/contrib
# cd ios
sh compile-ffmpeg.sh clean
  • For Ubuntu/Debian users.
# choose [No] to use bash
sudo dpkg-reconfigure dash
  • If you'd like to share your config, pull request is welcome.

Build Android

git clone https://github.com/Bilibili/ijkplayer.git ijkplayer-android
cd ijkplayer-android
git checkout -B latest k0.8.8

./init-android.sh

cd android/contrib
./compile-ffmpeg.sh clean
./compile-ffmpeg.sh all

cd ..
./compile-ijk.sh all

# Android Studio:
#     Open an existing Android Studio project
#     Select android/ijkplayer/ and import
#
#     define ext block in your root build.gradle
#     ext {
#       compileSdkVersion = 23       // depending on your sdk version
#       buildToolsVersion = "23.0.0" // depending on your build tools version
#
#       targetSdkVersion = 23        // depending on your sdk version
#     }
#
# If you want to enable debugging ijkplayer(native modules) on Android Studio 2.2+: (experimental)
#     sh android/patch-debugging-with-lldb.sh armv7a
#     Install Android Studio 2.2(+)
#     Preference -> Android SDK -> SDK Tools
#     Select (LLDB, NDK, Android SDK Build-tools,Cmake) and install
#     Open an existing Android Studio project
#     Select android/ijkplayer
#     Sync Project with Gradle Files
#     Run -> Edit Configurations -> Debugger -> Symbol Directories
#     Add "ijkplayer-armv7a/.externalNativeBuild/ndkBuild/release/obj/local/armeabi-v7a" to Symbol Directories
#     Run -> Debug 'ijkplayer-example'
#     if you want to reverse patches:
#     sh patch-debugging-with-lldb.sh reverse armv7a
#
# Eclipse: (obselete)
#     File -> New -> Project -> Android Project from Existing Code
#     Select android/ and import all project
#     Import appcompat-v7
#     Import preference-v7
#
# Gradle
#     cd ijkplayer
#     gradle

Build iOS

git clone https://github.com/Bilibili/ijkplayer.git ijkplayer-ios
cd ijkplayer-ios
git checkout -B latest k0.8.8

./init-ios.sh

cd ios
./compile-ffmpeg.sh clean
./compile-ffmpeg.sh all

# Demo
#     open ios/IJKMediaDemo/IJKMediaDemo.xcodeproj with Xcode
# 
# Import into Your own Application
#     Select your project in Xcode.
#     File -> Add Files to ... -> Select ios/IJKMediaPlayer/IJKMediaPlayer.xcodeproj
#     Select your Application's target.
#     Build Phases -> Target Dependencies -> Select IJKMediaFramework
#     Build Phases -> Link Binary with Libraries -> Add:
#         IJKMediaFramework.framework
#
#         AudioToolbox.framework
#         AVFoundation.framework
#         CoreGraphics.framework
#         CoreMedia.framework
#         CoreVideo.framework
#         libbz2.tbd
#         libz.tbd
#         MediaPlayer.framework
#         MobileCoreServices.framework
#         OpenGLES.framework
#         QuartzCore.framework
#         UIKit.framework
#         VideoToolbox.framework
#
#         ... (Maybe something else, if you get any link error)
# 

Support (支持)

  • Please do not send e-mail to me. Public technical discussion on github is preferred.
  • 请尽量在 github 上公开讨论技术问题,不要以邮件方式私下询问,恕不一一回复。

License

Copyright (c) 2017 Bilibili
Licensed under LGPLv2.1 or later

ijkplayer required features are based on or derives from projects below:

android/ijkplayer-exo is based on or derives from projects below:

android/example is based on or derives from projects below:

ios/IJKMediaDemo is based on or derives from projects below:

ijkplayer's build scripts are based on or derives from projects below:

Commercial Use

ijkplayer is licensed under LGPLv2.1 or later, so itself is free for commercial use under LGPLv2.1 or later

But ijkplayer is also based on other different projects under various licenses, which I have no idea whether they are compatible to each other or to your product.

IANAL, you should always ask your lawyer for these stuffs before use it in your product.

Comments
  • 视频缓冲和分段播放问题

    视频缓冲和分段播放问题

    感谢作者贡献了这么好的项目!我在使用的时候碰到了一些问题: 1、在使用IJKFFMoviePlayerController的暂停时缓冲也跟着暂停了,我用NSTimer去输出缓冲也是不变 2、处理多段播放能否使用另一个FFPlayer进行预缓冲和切换 3、最终缓冲playableDuration与视频的duration会有0.4~0.6秒的差距,这个是否是正常的 谢谢

    opened by Zard1096 72
  • 怎样边播放边录制直播视频呢?

    怎样边播放边录制直播视频呢?

    想到的方案有:

    一.(基于m3u8的经验是)下载直播流,再在本地拼接成视频文件 担心占用正在播放时的带宽导致播放器播放卡顿,本地拼接开销也是问题.

    二.截屏录制 基本不行,已实验过替换surfaceviw为自定义的AndroidTextureView,开启线程调用TextureView那个方法 getBitmap(bmp), 传入bmp宽高和屏幕(N6差不多2413x1357)一样的话需要耗时900+ms的时间截一次屏,而且播放画面卡顿一下.即便快到如 #301 dan-huang说的20ms,那截出来的怕也只能做成gif图了..

    三.从ijkplayer缓存里直接拷贝到一个本地文件 参考 jgfntu@b1efc14 的 ffp_get_current_frame_l 函数, 里面的vp->bmp->pitches[0]始终都是0,不知啥原因就搜资料,13年的资料说是结构体SDL_Overlay已弃用,不知道是不是代码太新,,所以就改成 AVFrame* fmp=vp->frame;拿到 AVFrame,可是现在拿到了不知道该怎么弄了, 或是说整个ijkplayer视频解码完成之后哪个代码是控制缓存的呢

    求 @bbcallen 赐教

    staled 
    opened by cjztool 41
  • android的系统,在播过过程中,视频一直显示缓存中。

    android的系统,在播过过程中,视频一直显示缓存中。

    @bbcallen 安卓的手机,在播放http://ssports.vod.smgbb.cn.cloudcdn.net/otv/vod/auto_bbf0913484a59baedb5d694236a45cc2.m3u8流的过程中。显示缓存。显示缓存后就不能继续播放了。有遇到类似的bug吗? 各位大神。有遇到的麻烦指导下。谢谢!着急期盼。

    staled 
    opened by andyjmzheng 39
  • ./compile-ffmpeg.sh: 133: ./compile-ffmpeg.sh: source: not found

    ./compile-ffmpeg.sh: 133: ./compile-ffmpeg.sh: source: not found

    Please help me

    [*] make NDK standalone toolchain

    ./compile-ffmpeg.sh: 85: [: Linux: unexpected operator WARNING: The shell running this script isn't bash. Although we try to avoid bashism in scripts, things can happen. Copying prebuilt binaries... Copying sysroot headers and libraries... Copying libstdc++ headers and libraries... Copying files to: /home/longtq/ijkplayer-android-master/android/build/ffmpeg-armv7a/toolchain Cleaning up... Done.


    [*] check ffmpeg env

    ./compile-ffmpeg.sh: 133: ./compile-ffmpeg.sh: source: not found longtq@longtq:~/ijkplayer-android-master/android$

    opened by ghost 33
  • 紧急!不能播放ape文件,已经用了module-default.sh

    紧急!不能播放ape文件,已经用了module-default.sh

    下面是logcat: updateConfiguration freq=2462 BSSID=38:97:d6:18:df:50 RSSI=-53 "FlyAuDio"WPA_PSK 10-10 19:13:51.145 1067-1067/system_process E/WifiTrafficPoller: TRAFFIC_STATS_POLL true Token 25 num clients 12 10-10 19:13:51.145 1067-1067/system_process E/WifiTrafficPoller: packet count Tx=8273 Rx=69260 10-10 19:13:51.145 1067-1067/system_process E/WifiTrafficPoller: notifying of data activity 1 10-10 19:13:51.379 14764-15336/cn.flyaudio.videoplayer E/IJKMEDIA: Unsupported file version - 4.11 10-10 19:13:51.381 14764-15336/cn.flyaudio.videoplayer E/IJKMEDIA: /storage/emulated/0/musicTest/ape/天空 - 王菲.ape: Not yet implemented in FFmpeg, patches welcome 10-10 19:13:51.382 14764-14764/cn.flyaudio.videoplayer E/tv.danmaku.ijk.media.player.IjkMediaPlayer: Error (-10000,0) 10-10 19:13:51.684 1067-2072/system_process E/WifiMonitor: handleEvent unknown: 14 CTRL-EVENT-SCAN-STARTED

    opened by mouseOf2ch 30
  • How to display videos in portrait orientation?

    How to display videos in portrait orientation?

    The video was recorded in portrait orientation, but shows on the wrong orientation.. any ideas where should I start with for orientation correction? Thanks!

    PS: tested on android devices

    enhancement 
    opened by emptyway 28
  • 使用自定义数据源的问题

    使用自定义数据源的问题

    使用自定义数据源,实现接口tv.danmaku.ijk.media.player.misc.IMediaDataSource

    public int readAt(long position, byte[] buffer, int offset, int size) throws IOException

    这个方法给ijkplayer提供数据,为什么这个方法会频繁有size=0的时候调进来,这样是读不到任何数据的呀,是不是BUG,我觉得应该传1

    opened by mgoann 26
  • android的系统,在播过过程中,视频停止播放,一直显示缓存中。

    android的系统,在播过过程中,视频停止播放,一直显示缓存中。

    我在android的手机上测试url:http://ssports.vod.smgbb.cn.cloudcdn.net/otv/vod/auto_bbf0913484a59baedb5d694236a45cc2.m3u8 过程中。播放大概十分钟后,视频就播放停止,一直缓冲。退出播放器。再打开也是不能播放。 下面是打印。请高手给查看下。谢谢!

    09-22 13:33:15.119 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_stop() 09-22 13:33:15.129 10271-10315/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ message_loop exit 09-22 13:33:15.129 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_stop()=0 09-22 13:33:15.129 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ IjkMediaPlayer_release 09-22 13:33:15.129 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_android_surface(surface=0x0) 09-22 13:33:15.129 10271-10316/tv.danmaku.ijk.media.sample D/dalvikvm﹕ threadid=20: thread exiting, not yet detached (count=0) 09-22 13:33:15.129 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ffpipeline_set_surface() 09-22 13:33:15.129 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_android_surface(surface=0x0)=void 09-22 13:33:15.129 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_shutdown_l() 09-22 13:33:15.129 10271-10373/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ MediaCodec: enqueue_thread_func: exit: -1 09-22 13:33:15.129 10271-10373/tv.danmaku.ijk.media.sample D/dalvikvm﹕ threadid=19: thread exiting, not yet detached (count=0) 09-22 13:33:15.129 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ wait for read_tid 09-22 13:33:15.169 10271-10317/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ HLS request for url 'http://ssports.vod.smgbb.cn.cloudcdn.net/otv/vod/600k/bbf0913484a59baedb5d694236a45cc2_600k_084.ts', offset 0, playlist 0 09-22 13:33:15.169 10271-10317/tv.danmaku.ijk.media.sample E/IJKMEDIA﹕ ffurl_connect 09-22 13:33:15.169 10271-10317/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ http_open http://ssports.vod.smgbb.cn.cloudcdn.net/otv/vod/600k/bbf0913484a59baedb5d694236a45cc2_600k_084.ts 09-22 13:33:15.169 10271-10317/tv.danmaku.ijk.media.sample W/IJKMEDIA﹕ No trailing CRLF found in HTTP header. 09-22 13:33:15.169 10271-10317/tv.danmaku.ijk.media.sample E/IJKMEDIA﹕ ffurl_connect 09-22 13:33:15.209 10271-10317/tv.danmaku.ijk.media.sample W/IJKMEDIA﹕ PES packet size mismatch 09-22 13:33:15.209 10271-10347/tv.danmaku.ijk.media.sample D/dalvikvm﹕ threadid=17: thread exiting, not yet detached (count=0) 09-22 13:33:15.859 10271-10372/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ SDL_AMediaCodecJava_stop 09-22 13:33:15.889 10271-10372/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ MediaCodec: func_run_sync: exit: 0 09-22 13:33:15.889 10271-10372/tv.danmaku.ijk.media.sample D/dalvikvm﹕ threadid=18: thread exiting, not yet detached (count=0) 09-22 13:33:15.899 10271-10317/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ Statistics: 344 bytes read, 0 seeks 09-22 13:33:15.899 10271-10317/tv.danmaku.ijk.media.sample D/dalvikvm﹕ threadid=15: thread exiting, not yet detached (count=0) 09-22 13:33:15.899 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ wait for video_refresh_tid 09-22 13:33:15.919 10271-10271/tv.danmaku.ijk.media.sample E/IJKMEDIA﹕ SDL_Overlay(ffmpeg): overlay_free_l(0x63602ce8) 09-22 13:33:15.919 10271-10271/tv.danmaku.ijk.media.sample E/IJKMEDIA﹕ SDL_Overlay(ffmpeg): overlay_free_l(0x646837c8) 09-22 13:33:15.919 10271-10271/tv.danmaku.ijk.media.sample E/IJKMEDIA﹕ SDL_Overlay(ffmpeg): overlay_free_l(0x636d95f0) 09-22 13:33:15.919 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_shutdown_l()=void 09-22 13:33:15.919 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_dec_ref(): ref=0 09-22 13:33:15.919 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_shutdown_l() 09-22 13:33:15.919 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_shutdown_l()=void 09-22 13:33:15.919 10271-10271/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ SDL_AMediaCodecJava_delete 09-22 13:33:16.129 10271-10271/tv.danmaku.ijk.media.sample I/Timeline﹕ Timeline: Activity_idle id: android.os.BinderProxy@423dacd8 time:8856411 09-22 13:33:17.449 10271-10271/tv.danmaku.ijk.media.sample I/Timeline﹕ Timeline: Activity_launch_request id:tv.danmaku.ijk.media.sample time:8857733 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ IjkMediaPlayer_native_setup 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ av_version_info: ff2.8--ijk0.3.3--dev0.3.3--rc1 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ffpipeline_create_from_android() 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_inject_opaque(0x1d3004d6) 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_option_int(ijkinject-opaque, 489686230) 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_option_int()=void 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_inject_opaque()=void 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_android_set_mediacodec_select_callback() 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ffpipeline_set_mediacodec_select_callback 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_android_set_mediacodec_select_callback()=void 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ IjkMediaPlayer_setOptionLong 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_option_int(overlay-format, 842225234) 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_option_int()=void 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ IjkMediaPlayer_setOptionLong 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_option_int(framedrop, 12) 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_option_int()=void 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ IjkMediaPlayer_setOptionLong 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_option_int(http-detect-range-support, 0) 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_option_int()=void 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample I/VideoView﹕ mUri.getPath:http://ssports.vod.smgbb.cn.cloudcdn.net/otv/vod/auto_bbf0913484a59baedb5d694236a45cc2.m3u8 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ IjkMediaPlayer_setOptionLong 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_option_int(skip_loop_filter, 48) 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_option_int()=void 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ IjkMediaPlayer_setOptionLong 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_option_int(get-av-frame-timeout, 3000000) 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_option_int()=void 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ IjkMediaPlayer_setOptionLong 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_option_int(mediacodec, 1) 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_option_int()=void 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ IjkMediaPlayer_setOptionLong 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_option_int(start-on-prepared, 1) 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_option_int()=void 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ IjkMediaPlayer_setDataSourceAndHeaders 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample V/IJKMEDIA﹕ setDataSource: path http://ssports.vod.smgbb.cn.cloudcdn.net/otv/vod/auto_bbf0913484a59baedb5d694236a45cc2.m3u8 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_data_source(url="http://ssports.vod.smgbb.cn.cloudcdn.net/otv/vod/auto_bbf0913484a59baedb5d694236a45cc2.m3u8") 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_data_source(url="http://ssports.vod.smgbb.cn.cloudcdn.net/otv/vod/auto_bbf0913484a59baedb5d694236a45cc2.m3u8")=0 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ IjkMediaPlayer_setVideoSurface 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_android_surface(surface=0xc950001d) 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ffpipeline_set_surface() 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_set_android_surface(surface=0xc950001d)=void 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ IjkMediaPlayer_prepareAsync 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_prepare_async() 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ ===== options ===== 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ player-opts : overlay-format = 842225234 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ player-opts : framedrop = 12 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ player-opts : get-av-frame-timeout = 3000000 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ player-opts : mediacodec = 1 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ player-opts : start-on-prepared = 1 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ format-opts : ijkinject-opaque = 489686230 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ format-opts : http-detect-range-support = 0 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ codec-opts : skip_loop_filter = 48 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ =================== 09-22 13:33:17.659 10271-10271/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ijkmp_prepare_async()=0 09-22 13:33:17.669 10271-2566/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ SDL_RunThread: [2566] ff_msg_loop 09-22 13:33:17.669 10271-2566/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ message_loop 09-22 13:33:17.669 10271-2566/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ FFP_MSG_FLUSH: 09-22 13:33:17.669 10271-2567/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ SDL_RunThread: [2567] ff_vout 09-22 13:33:17.669 10271-2568/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ SDL_RunThread: [2568] ff_read 09-22 13:33:17.669 10271-2567/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ ffpipenode_create_video_output_from_android_mediacodec() 09-22 13:33:17.669 10271-2568/tv.danmaku.ijk.media.sample E/IJKMEDIA﹕ ffurl_connect 09-22 13:33:17.669 10271-2568/tv.danmaku.ijk.media.sample I/IJKMEDIA﹕ http_open http://ssports.vod.smgbb.cn.cloudcdn.net/otv/vod/auto_bbf0913484a59baedb5d694236a45cc2.m3u8 09-22 13:33:17.669 10271-2568/tv.danmaku.ijk.media.sample E/IJKMEDIA﹕ ffurl_connect 09-22 13:33:17.729 10271-10271/tv.danmaku.ijk.media.sample I/Timeline﹕ Timeline: Activity_idle id: android.os.BinderProxy@42635d40 time:8858013 09-22 13:33:17.759 10271-2568/tv.danmaku.ijk.media.sample D/IJKMEDIA﹕ request: GET /otv/vod/auto_bbf0913484a59baedb5d694236a45cc2.m3u8 HTTP/1.1 User-Agent: Lavf/56.40.101 Accept: / Range: bytes=0- Connection: close Host: ssports.vod.smgbb.cn.cloudcdn.net Icy-MetaData: 1

    staled 
    opened by andyjmzheng 26
  • 在无网络下播放失败,重试,会出现signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)

    在无网络下播放失败,重试,会出现signal 11 (SIGSEGV), code 1 (SEGV_MAPERR)

    ********** Crash dump: ********** Build fingerprint: 'samsung/ja3gzs/ja3g:4.4.2/KOT49H/I9500ZSUDNK1:user/release-keys' pid: 6521, tid: 6595, name: ff_read >>> tv.danmaku.ijk.media.player:ijk <<< signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr deadbaad Stack frame I/DEBUG (22333): #00 pc 000117d0 /system/lib/libc.so (dlfree+1191): Routine ?? ??:0 Stack frame I/DEBUG (22333): #01 pc 0000dd1f /system/lib/libc.so (free+10): Routine ?? ??:0 Stack frame I/DEBUG (22333): #02 pc 0014ec63 /data/app-lib/tv.danmaku.ijk.media.player-12/libijkffmpeg.so (ffurl_closep+82): Routine ffurl_closep at /home/lyq/git/ijkplayer-d0413/ijkplayer/android/contrib/ffmpeg-armv7a/libavformat/avio.c:476 Crash dump is completed 就是 av_freep(&h->priv_data);这个方法

    can-not-reproduce staled 
    opened by lyqaiym 25
  • ijkplayer播放rtmp直播流,延迟明显

    ijkplayer播放rtmp直播流,延迟明显

    Android上使用master或stable分支的代码,编译后的demo播放rtmp直播流,从打开操作到屏幕显示活动视频,测试差不多需要8s左右,有时更长。

    视频打开后,对比实际活动,播放延迟要明显滞后超过5s以上。

    在PC端测试原版ffplay,也有类似现象,但如果加入如下参数,则播放延迟会明显减低至2s以内。

    ffplay -fflags nobuffer -i rtmp://dev:1935//live/livestream

    请问如果ijkplayer要增加该参数,要如何操作呢? 我尝试在ijkplayer/android/ijkmediawidget/src/tv/danmaku/ijk/media/widget/VideoView.java这个文件中增加 ijkMediaPlayer.setOverlayFormat(AvFourCC.SDL_FCC_RV32); ijkMediaPlayer.setAvFormatOption("fflags", “nobuffer”); // add ijkMediaPlayer.setAvCodecOption("skip_loop_filter", "48"); ijkMediaPlayer.setFrameDrop(12);

    貌似没有任何效果

    opened by walkermi 25
  • Wait for stream closed or switch url on the fly on IOS

    Wait for stream closed or switch url on the fly on IOS

    Hi,

    I have a rtsp server that can stream only 1 stream on the same time.

    When i try to call stop or shutdown, i have to wait around 10 or 15 seconds before i can init a new player. If i init the player before this time, the server say me that there is already a stream open.

    What can i do either to switch on the fly without needing to init a new player or have a message that it's ok ? I don't see MPMoviePlaybackStateStopped, only MPMoviePlaybackStatePlaying or MPMoviePlaybackStatePaused.

    It would be nice to not wait the 10 or 15s, with vlc i don't have this problem.

    staled 
    opened by linked67 23
  • ijkmp_shutdown_l不能退出,发生死锁

    ijkmp_shutdown_l不能退出,发生死锁

    正常情况下,android环境下,切换播放源时调用 release会产生如下日志: 12-27 15:13:21.412 20614 20614 D IJKMEDIA: liblog: 224766- 3510- 0-ijkmp_stop() 12-27 15:13:21.412 20614 14352 D IJKMEDIA: liblog: 224767- 3511- 0-message_loop exit 12-27 15:13:21.412 20614 14352 I IJKMEDIA: liblog: 224768- 3512- 0-SDL_JNI_DetachThreadEnv: [14352] 12-27 15:13:21.413 20614 20614 D IJKMEDIA: liblog: 224769- 3513- 0-ijkmp_stop()=0 12-27 15:13:21.413 20614 20614 D IJKMEDIA: liblog: 224770- 3514- 0-IjkMediaPlayer_release 12-27 15:13:21.413 20614 20614 D IJKMEDIA: liblog: 224771- 3515- 0-ijkmp_set_android_surface(surface=0x0) 12-27 15:13:21.413 20614 20614 D IJKMEDIA: liblog: 224772- 3516- 0-ffpipeline_set_surface() 12-27 15:13:21.413 20614 20614 D IJKMEDIA: liblog: 224773- 3517- 0-ijkmp_set_android_surface(surface=0x0)=void 12-27 15:13:21.413 20614 20614 D IJKMEDIA: liblog: 224774- 3518- 0-ijkmp_shutdown_l() 12-27 15:13:21.420 20614 14353 I IJKMEDIA: liblog: 224775- 3519- 0-SDL_JNI_DetachThreadEnv: [14353] 12-27 15:13:21.421 20614 14354 I IJKMEDIA: liblog: 224776- 3520- 0-SDL_JNI_DetachThreadEnv: [14354] 12-27 15:13:21.422 20614 14358 I IJKMEDIA: liblog: 224777- 3521- 0-SDL_JNI_DetachThreadEnv: [14358] 12-27 15:13:21.439 20614 14357 I IJKMEDIA: liblog: 224780- 3524- 0-SDL_JNI_DetachThreadEnv: [14357] 12-27 15:13:21.445 20614 20614 D IJKMEDIA: liblog: 224781- 3525- 0-ijkmp_shutdown_l()=void 12-27 15:13:21.446 20614 20614 D IJKMEDIA: liblog: 224782- 3526- 0-ijkmp_dec_ref(): ref=0 12-27 15:13:21.446 20614 20614 D IJKMEDIA: liblog: 224783- 3527- 0-ijkmp_shutdown_l() 12-27 15:13:21.446 20614 20614 D IJKMEDIA: liblog: 224784- 3528- 0-ijkmp_shutdown_l()=void

    即正常情况下ijkmp_shutdown_l()与ijkmp_shutdown_l()=void成对出现。 在频繁多次reset进行播放源切换后出现了日志仅有ijkmp_shutdown_l()而没有ijkmp_shutdown_l()=void的情况,即ijkmp_shutdown_l进入后一直不退出,app应用无响应。 日志如下: 12-27 15:13:39.544 20614 20614 D IJKMEDIA: liblog: 227208- 5452- 0-ijkmp_stop() 12-27 15:13:39.544 20614 14446 D IJKMEDIA: liblog: 227209- 5453- 0-message_loop exit 12-27 15:13:39.544 20614 14446 I IJKMEDIA: liblog: 227210- 5454- 0-SDL_JNI_DetachThreadEnv: [14446] 12-27 15:13:39.545 20614 20614 D IJKMEDIA: liblog: 227211- 5455- 0-ijkmp_stop()=0 12-27 15:13:39.545 20614 20614 D IJKMEDIA: liblog: 227212- 5456- 0-IjkMediaPlayer_release 12-27 15:13:39.545 20614 20614 D IJKMEDIA: liblog: 227213- 5457- 0-ijkmp_set_android_surface(surface=0x0) 12-27 15:13:39.545 20614 20614 D IJKMEDIA: liblog: 227214- 5458- 0-ffpipeline_set_surface() 12-27 15:13:39.545 20614 20614 D IJKMEDIA: liblog: 227215- 5459- 0-ijkmp_set_android_surface(surface=0x0)=void 12-27 15:13:39.545 20614 20614 D IJKMEDIA: liblog: 227216- 5460- 0-ijkmp_shutdown_l() 12-27 15:13:39.548 20614 14447 I IJKMEDIA: liblog: 227217- 5461- 0-SDL_JNI_DetachThreadEnv: [14447]

    ijkmp_shutdown_l函数源码如下: void ijkmp_shutdown_l(IjkMediaPlayer *mp) { assert(mp);

    MPTRACE("ijkmp_shutdown_l()\n");
    if (mp->ffplayer) {
        ffp_stop_l(mp->ffplayer);
        ffp_wait_stop_l(mp->ffplayer);
    }
    MPTRACE("ijkmp_shutdown_l()=void\n");
    

    }

    其中ffp_stop_l存在死锁可能: int ffp_stop_l(FFPlayer *ffp) { assert(ffp); VideoState *is = ffp->is; if (is) { is->abort_request = 1; toggle_pause(ffp, 1); }

    msg_queue_abort(&ffp->msg_queue);
    if (ffp->enable_accurate_seek && is && is->accurate_seek_mutex
        && is->audio_accurate_seek_cond && is->video_accurate_seek_cond) {
        SDL_LockMutex(is->accurate_seek_mutex);
        is->audio_accurate_seek_req = 0;
        is->video_accurate_seek_req = 0;
        SDL_CondSignal(is->audio_accurate_seek_cond);
        SDL_CondSignal(is->video_accurate_seek_cond);
        SDL_UnlockMutex(is->accurate_seek_mutex);
    }
    return 0;
    

    }

    opened by benbochong 0
  • 因为哔哩哔哩非法裁员,从今天开始我会抵制哔哩哔哩

    因为哔哩哔哩非法裁员,从今天开始我会抵制哔哩哔哩

    我的 B 站朋友正在经受非法裁员,听了他们的讲述之后,我决定不再支持哔哩哔哩。

    B 站的 HR 使出浑身解数,使用各种肮脏违法手段逼迫你毕业。

    我很生气,我很难过。

    如果哔哩哔哩的兴旺是建立在普通打工人的痛苦之上,那我选择放弃并抵制它。

    看动画不能用 Netflix 吗?看视频不能用 Youtube 吗?看漫画不能用粉色软件吗?看乐色不能用抖音吗?

    生活一定离不开哔哩哔哩吗?

    真心祝愿叔叔能通过压榨员工获得光明的未来。

    我能做的就是再也不买你的大会员,卸载哔哩哔哩,你永远赚不到我这一份钱。

    https://yaoyuan19950830.github.io/Boycott-Bilibili/

    opened by Yaoyuan19950830 0
  • iOS Demo播放视频内存开销远大于原生播放器

    iOS Demo播放视频内存开销远大于原生播放器

    iOS系统,用官方Demo,无其他业务。 播放一个几分钟的MP4视频,内存开销100MB。相同视频,用原生播放器播放,只有十来MB。未发现内存泄漏,停止播放后内存正常,就是播放的时候,内存消耗比较大。 image

    后面调研发现,在使用AVPlayer时,Xcode统计的的内存消耗完全没有变化,但检测到系统可用内存显著减少。现在怀疑是AVPlayer自己拥有独立于App进程的单独进程,在那里有相应的内存等开销。xcode只统计自己的内存消耗,因此基本无内存变化。查阅苹果文档未发现支持该猜想的描述,如果有知道的大佬,烦请知无不言。

    因此想问两个问题,一个是IJK播放小视频内存开销大几十上百MB,是否正常? 另外,AVPlayer是不是有自己的进程处理网络请求等逻辑?

    opened by Flanker711 0
  • vp09不能播放

    vp09不能播放

    https://user-images.githubusercontent.com/17246251/205286138-2821b53c-c334-48bd-a5e6-c81c690090b0.mp4

    如果是vp9格式就可以播放; 而上面的视频会报 Empty VP Codec Configuration box

    opened by Equalzys 0
Owner
bilibili
bilibili Open Source Task Force
bilibili
Yet Another Video Player (or YAVP) is a Video Player for Android that is based on Googles ExoPlayer.

Yet Another Video Player Yet Another Video Player (or YAVP) is a Video Player for Android that is based on Googles ExoPlayer. Who Is YAVP For? First o

null 62 Dec 29, 2022
FFmpeg compiled for Android. Execute FFmpeg commands with ease in your Android app.

FFMPEG video operations FFmpeg compiled for Android. Execute FFmpeg commands with ease in your Android app. Getting Started This project is provide in

Simform Solutions 277 Jan 2, 2023
Video Transcoder is an application which uses the open source program FFmpeg to transcode video files from one format to another.

Video Transcoder Do you want to encode videos on your phone into different formats, trim videos, or extract audio? Are you looking for a free solution

Branden Archer 358 Dec 30, 2022
Compose-video-player - Video player for Android Compose powered by ExoPlayer

Compose Video Player Video player for Android Compose powered by ExoPlayer. Addi

Juan Pablo Herrera 22 Dec 13, 2022
Fermata Media Player is a free, open source audio and video player with a simple and intuitive interface.

Fermata Media Player About Fermata Media Player is a free, open source audio and video player with a simple and intuitive interface. It is focused on

Andrey 227 Jan 6, 2023
mpv-android is a video player for Android based on libmpv.

mpv-android is a video player for Android based on libmpv.

null 1.1k Jan 6, 2023
Simple and lightweight, yet polished and powerful Android video player based on ExoPlayer

Just (Video) Player Android video player based on ExoPlayer It uses ExoPlayer's extension-ffmpeg with all its audio formats enabled (it can handle eve

Marcel Dopita 677 Dec 28, 2022
AutoPlayer - A player based on ExoPlayer for play video automatically in RecyclerView, when an item is visible.

A player based on ExoPlayer for play video automatically in RecyclerView, when an item is visible.

Kishan Singh 6 Aug 14, 2022
[] FFmpeg build for android random architectures with example jni

AndroidFFmpegLibrary This project aims to create working library providing playing video files in android via ffmpeg libraries. With some effort and N

AppUnite Sp. z o.o. Spk. 1.1k Dec 27, 2022
Free p2p cdn android github sdk to reduce video streaming costs of live and on demand video using webrtc by upto 90% and improve scalability by 6x - 🚀 Vadootv 🚀

Android p2p cdn sdk to distribute load and reduce costs(https://peervadoo.com) Vadootv is a p2p sdk integration to reduce your video streaming costs b

Vadootv 40 Oct 5, 2022
The Madman library (Media Ads Manager) enables you to advertise video contents with video ads.

Madman (Media ads manager) is a high performance alternative to Google's standard IMA android SDK. If you have your own VAST server and want to render video ads and have full control over the UI, then this library is for you.

Flipkart Incubator 65 Nov 10, 2022
Custom Android view with video player, loader and placeholder image

VideoPlayerView Custom Android view with video player, loader and placeholder image. To stay up-to-date with news about the library Usage Here is an e

Marcin Moskała 89 Nov 18, 2022
NOVA is an open source video player for Android

NOVA: opeN sOurce Video plAyer Overview NOVA is an open source video player for Android. It consists in a fork of the original Archos Video Player Com

NOVA 876 Jan 2, 2023
api.video Android player

api.video is the video infrastructure for product builders. Lightning fast video APIs for integrating, scaling, and managing on-demand & low latency live streaming features in your app.

api.video 9 Dec 15, 2022
A Custom Video Player with Controls in Kotlin

UNT-Video-Player A Custom Video Player with Controls in Kotlin Hello folks, Here is the custom video player built in Kotlin; with SeekBar, fast forwar

ultroNeous Technologies 0 Nov 8, 2021
Exo Player Video with jetPack Compose

Exo Player Video with jetPack Compose

mohamed tamer 2 Feb 26, 2022
Sample HLS Video player in Kotlin with mvvm

HLSVideoPlayer Sample HLS Video player in Kotlin with mvvm Note: mvvm is partially implemented due to time constraint, so here is a scope for improvem

null 0 Apr 9, 2022
Odeon Music Player is a lightweight music player for Android.

Odeon ?? Odeon Music Player is a lightweight music player for Android. Get it on Google Play. We value your privacy, your battery life and your device

Thibault Seisel 63 Dec 20, 2022
Music Player - This is a basic music player built with Android Studio and Kotlin

Music Player Made by Jenny Cárdenas This is a basic music player built with Android Studio and Kotlin, it shows two views in the UI, the user can play

Jenny C 3 Oct 28, 2021