Giter Club home page Giter Club logo

alibaba / cicadaplayer Goto Github PK

View Code? Open in Web Editor NEW
671.0 51.0 189.0 5.86 MB

CicadaPlayer is the player core of AliPlayer, which supports multiple platforms Android, iOS, macOS, Windows, Linux, and WebAssembly for now. The goal is to provide a player core which supports multi-platform, hardware accelerator, and customizable and extensible features. Which supports WideVine drm, LL-HLS, MPEG-DASH and HDR playback.

License: MIT License

CMake 2.41% Shell 2.11% Perl 0.89% C++ 51.03% C 8.89% Objective-C++ 3.95% Objective-C 8.93% Python 0.18% Java 18.18% Ruby 0.06% Batchfile 0.02% Dart 3.36%
mediaplayer ffmpeg widevine webassembly fairplay ll-hls dash codec hdr

cicadaplayer's Introduction

Cicada Logo

coverity Status codecov LICENSE

iOS CI macOS CI Android CI Linux CI

Keep the world free of difficult videos to play!

Cicada Media Player is a multi platform player sdk,Keep the world free of difficult videos to play,using Cicada Media Player, build your multimedia apps happily.

Try it on Android devices

deom

HOW TO compile

The default ffmpeg, curl, and openssl git url is the github mirror, if you want use another, set it before compile like:

export FFMPEG_GIT=https://gitee.com/mirrors/ffmpeg.git
export OPENSSL_GIT=https://gitee.com/mirrors/openssl.git
export CURL_GIT=https://gitee.com/mirrors/curl.git

How to use

Features

  • HLS LL-HLS master play list support, seamless switch
  • MPEG-DASH
  • WideVine
  • ABR
  • hardware decode on Android and Apple platform
  • HEVC support
  • OpenGL render
  • HDR render
  • change volume by software
  • speed playback
  • snapshot
  • subtitle title and external subtitle title
  • on playing cache
  • background video playback
  • http keep-alive
  • customer ip resolve
  • video rotation
  • black list on Android hardware h264 decoder
  • plugin supporting

Contact

DingDing

License

MIT LICENSE

Copyright (c) 2019-present Alibaba Inc.

CicadaPlayerSDK using the projects:

cicadaplayer's People

Contributors

befovy avatar dlcodingaw avatar futan-yj avatar i-m-superman avatar kongjianneu avatar lileilei1119 avatar pingkai avatar radish520like avatar rendongge avatar shengqiangliu avatar skufly avatar xjsxjtu avatar zhouguixin 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

cicadaplayer's Issues

播放视频容易卡顿

在同一个网络环境下,播放同一个m3u8资源,使用这个播放器会更加容易遇到卡顿的情况,缓存速度也更慢,开始播放时间也会比较久

Can't compile windows on win10

按文档compile windows on win10 use visual studio 2017操作到3.build cmdline
执行CicadaPlayer\cmdline\msvc_build\build_win.bat

出现如下错误:
1>E:\workspace\CicadaPlayer\framework\utils\ffmpeg_utils.c(8): fatal error C1083: 无法打开包括文件: “libavcodec/h264_parse.h”: No such file or directory
1>已完成生成项目“framework_utils.vcxproj”的操作 - 失败。

CicadaPlayer Question

How to set and compile a specific platform, for example, only need to compile arm64

该更新啦

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

unable to play wmv

when play video files, like .wmv,

will have error message:
'Invalid data found when processing input'

It seems related to:
acaudwell/Gource#216

the 0.3 branch is pinned to ffmpeg 4.2.1. if change to 4.2.2, the included hevc patches can't be applied successfully.

Android设备播放多音轨ts文件,无音频输出。对比Android中MediaPlayer通用API,缺失一些重要接口

单音轨文件播放正常,有声音输出

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

能否实现gif截图

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

CicadaPlayer播放mp4多音轨视频时,怎么切换不同音轨?

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

mac osx 系统上执行到./genxcodeproj.sh这里报错

-- The C compiler identification is unknown
-- The CXX compiler identification is unknown
System is unknown to cmake, create:
Platform/iOS to use this system, please send your config file to [email protected] so it can be added to cmake
CMake Error at CMakeLists.txt:3 (project):
No CMAKE_C_COMPILER could be found.

CMake Error at CMakeLists.txt:3 (project):
No CMAKE_CXX_COMPILER could be found.

本地视频卡顿

设备性能较差,1920x1080的分辨率设备 播放 2540x1920的视频,卡顿严重。是否有什么需要特殊配置的

Build CicadaPlayer for both Simulator and Device

Describe the bug
Following the instructions to compile CicadaPlayer for iOS, the result is that the CicadaPlayer only works on an iOS device, can't make it work on a Simulator.

It says alivcffmpeg is only built for arm64, but for what i see in the scripts, it should create Fat frameworks with all architectures right?

Should CicadaPlayerSDK.framework and alivcffmepg.framework contain all architectures?

Am I doing something wrong?

Thanks 🙇

To Reproduce
Steps to reproduce the behavior:

  1. Clone repo
  2. Follow README instructions to build for iOS
  3. Try to execute CicadaDemo in a Simulator
  4. See error

Expected behavior
I can execute CicadaDemo in both Device and Simulator

execute ./build_external.sh iOS error

Describe the bug
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [curl] Error 1
make[1]: *** [install-recursive] Error 1
make: *** [install-recursive] Error 1

To Reproduce
Steps to reproduce the behavior:
execute ./build_external.sh iOS

Desktop (please complete the following information):

  • OS:mac

trackBitrate and bufferedPosition are always 0 for RTMP

Describe the bug
When reproducing an RTMP stream both trackBitrate and bufferedPosition are always 0.
It works as expected when reproducing HLS for instance.

To get these values i'm accessing them like this:

let bitrate = player.getCurrentTrack(CicadaTrackType(rawValue: 0))?.trackBitrate
let buffer = player.bufferedPosition

To Reproduce
Steps to reproduce the behavior:

  1. Just open any RTMP stream

Expected behavior
We should get the current values for bitrate and buffer as we do for HTTP streams.

Also I have one more question, is there any way to obtain bandwidth information for the current stream? Couldn't find anything in the public API.

Thanks!

Question:how the Android MediaCodec aware of the surface destroy and recreate?

@pingkai As I know, There is a fundamental limitation of MediaCodec in the Android platform. that it needs a Surface attached to it at all times. When the SurfaceView is removed from the view or underlying Surface is destroyed. This in turn forces to destroy its MediaCodec instance. But in cicada player, I hadn't found logic about MediaCodec destroy and recreate. It's confused me, help give some explain.

As said about, I start to play the video and do the home press key to into the background(Surface destroyed) and then reopen into the foreground(Surface recreate) to test the scene of the surface destroy and recreate. There is no black screen. Thanks for your great work.

Android设备播放多音轨ts文件,无音频输出。对比Android中MediaPlayer通用API,缺失一些重要接口

单音轨文件播放正常,有音频输出。
多音轨文件播放无音频输出,并且手动设置音轨未生效。测试代码如下:

2B13A87D-BF14-430e-85C2-F28E8D3B7C7D

今天试着加到公司项目中,发现还需要处理很多通用功能,暂时放弃~
对比原生MediaPlayer、ExoPlayer、IjkPlayer提供的API,CicadaPlayer主要缺少:

  • isPlaying() 是否正在播放,虽然可以通过其它手段判断,有会更方便

  • getCurrentPosition() 当前播放位置,虽然监听OnInfoListener可以得到,有会更方便

  • setVolume(float leftVolume, float rightVolume) 设置左声道、右声道音量,对于单音轨多声道的使用场景

  • getAudioSessionId() 播放器ID(The audio session ID is a system wide unique identifier for the audio stream played by this MediaPlayer instance.)做频谱、均衡器、重低音等需要参数

  • CicadaPlayer已经有了设置速率setSpeed()方法,而设置音调setPitch()还没

目前对CicadaPlayer使用还不够深入,说法上有错误的地方还望指出~~~
测试文件有点大,需要的话可以发邮箱
上午手点快了,所有多提了一次 ^_^

Bug: Playing not correctly with a complex master playlist m3u8

System info

Using Android CicadaPlayer

Issue description

When playing with Apple master playlist advanced (TS) url, https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8, the player only play audio and subtitle stream at first, About 10s later, the video stream begins to play, there isn't in AVSync. We test the url with ExoPlayer, it plays well.

Reproduction steps

Replace the input url with https://devstreaming-cdn.apple.com/videos/streaming/examples/img_bipbop_adv_example_ts/master.m3u8. The issue can be reproduced.

Question about DRM support

Hi

This project looks quite interesting and promising with regards to unified playback.

An important piece of information i have not been able to obtain and that is an important concern for me is the DRM support. What (if any) DRMs are supported and on which platforms? Is there any resource on the web where i can see what the plans are, and examples of DRM-protected content playback is supported?

【build error】/Applications/xxx/iPhoneSimulator13.2.sdk/xxx/AudioServices.h:21:14: fatal error: 'CoreAudio/AudioHardware.h' file not found

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:1159:83: error: expected ','
kCFURLBookmarkCreationWithSecurityScope API_AVAILABLE(macos(10.7), macCatalyst(13.0)) API_UNAVAILABLE(ios, watchos, tvos) = ( 1UL << 11 ), // Mac OS X 10.7.3 and later, include information in the bookmark data which allows the same sandboxed process to acce...
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:1160:98: error: expected ','
kCFURLBookmarkCreationSecurityScopeAllowOnlyReadAccess API_AVAILABLE(macos(10.7), macCatalyst(13.0)) API_UNAVAILABLE(ios, watchos, tvos) = ( 1UL << 12 ), // Mac OS X 10.7.3 and later, if used with kCFURLBookmarkCreationWithSecurityScope, at resolution time o...
^
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/CoreFoundation.framework/Headers/CFURL.h:1170:85: error: expected ','
kCFURLBookmarkResolutionWithSecurityScope API_AVAILABLE(macos(10.7), macCatalyst(13.0)) API_UNAVAILABLE(ios, watchos, tvos) = ( 1UL << 10 ), // Mac OS X 10.7.3 and later, use the secure information included at creation time to provide the ability to access t...
^
In file included from src/libavcodec/audiotoolboxdec.c:23:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioToolbox.h:27:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioServices.h:21:14: fatal error: 'CoreAudio/AudioHardware.h' file not found
#include <CoreAudio/AudioHardware.h>
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/AudioToolbox.framework/Headers/AudioServices.h:21:14: note: did not find header 'AudioHardware.h' in framework 'CoreAudio'
(loaded from '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks')
4 errors generated.
make: *** [libavcodec/audiotoolboxdec.o] Error 1
build error

release/0.3 编译报错 taking address of temporary array

version release/0.3
编译环境 win10 wsl ubuntu 18.04
clang-7 clang++-7
编译报错
以下是报错日志

In file included from /mnt/e/PERSON/code/Player/third_lib/CicadaPlayer/framework/muxer/ffmpegMuxer/FfmpegMuxer.cpp:13:0:
/mnt/e/PERSON/code/Player/third_lib/CicadaPlayer/framework/muxer/ffmpegMuxer/FfmpegMuxer.cpp: In member function ‘void FfmpegMuxer::check_codec_tag(const AVStream*)’:
/mnt/e/PERSON/code/Player/third_lib/CicadaPlayer/framework/../external/install/../external/ffmpeg/libavutil/avutil.h:348:86: error: taking address of temporary array
 #define av_fourcc2str(fourcc) av_fourcc_make_string((char[AV_FOURCC_MAX_STRING_SIZE]){0}, fourcc)
                                                                                      ^~~
/mnt/e/PERSON/code/Player/third_lib/CicadaPlayer/framework/utils/frame_work_log.h:68:63: note: in definition of macro ‘AF_LOGW’
 #define AF_LOGW(...) __log_print(AF_LOG_LEVEL_WARNING,LOG_TAG,__VA_ARGS__)
                                                               ^~~~~~~~~~~
/mnt/e/PERSON/code/Player/third_lib/CicadaPlayer/framework/muxer/ffmpegMuxer/FfmpegMuxer.cpp:107:21: note: in expansion of macro ‘av_fourcc2str’
                     av_fourcc2str(stream->codecpar->codec_tag), stream->codecpar->codec_id, av_fourcc2str(otag));
                     ^~~~~~~~~~~~~
/mnt/e/PERSON/code/Player/third_lib/CicadaPlayer/framework/../external/install/../external/ffmpeg/libavutil/avutil.h:348:86: error: taking address of temporary array
 #define av_fourcc2str(fourcc) av_fourcc_make_string((char[AV_FOURCC_MAX_STRING_SIZE]){0}, fourcc)
                                                                                      ^~~
/mnt/e/PERSON/code/Player/third_lib/CicadaPlayer/framework/utils/frame_work_log.h:68:63: note: in definition of macro ‘AF_LOGW’
 #define AF_LOGW(...) __log_print(AF_LOG_LEVEL_WARNING,LOG_TAG,__VA_ARGS__)
                                                               ^~~~~~~~~~~
/mnt/e/PERSON/code/Player/third_lib/CicadaPlayer/framework/muxer/ffmpegMuxer/FfmpegMuxer.cpp:107:93: note: in expansion of macro ‘av_fourcc2str’
                     av_fourcc2str(stream->codecpar->codec_tag), stream->codecpar->codec_id, av_fourcc2str(otag));
                                                                                             ^~~~~~~~~~~~~
At global scope:
cc1plus: warning: unrecognized command line option ‘-Wno-inconsistent-missing-override’
mediaPlayer.out/framework.out/muxer/CMakeFiles/muxer.dir/build.make:97: recipe for target 'mediaPlayer.out/framework.out/muxer/CMakeFiles/muxer.dir/ffmpegMuxer/FfmpegMuxer.cpp.o' failed
make[3]: *** [mediaPlayer.out/framework.out/muxer/CMakeFiles/muxer.dir/ffmpegMuxer/FfmpegMuxer.cpp.o] Error 1
CMakeFiles/Makefile2:641: recipe for target 'mediaPlayer.out/framework.out/muxer/CMakeFiles/muxer.dir/all' failed
make[2]: *** [mediaPlayer.out/framework.out/muxer/CMakeFiles/muxer.dir/all] Error 2
CMakeFiles/Makefile2:378: recipe for target 'CMakeFiles/cicadaPlayer.dir/rule' failed
make[1]: *** [CMakeFiles/cicadaPlayer.dir/rule] Error 2
Makefile:137: recipe for target 'cicadaPlayer' failed
make: *** [cicadaPlayer] Error 2

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.