Giter Club home page Giter Club logo

sgplayer's Introduction

Logo

Build Status License Platform

SGPlayer

  • SGPlayer is a powerful media play framework for iOS, macOS, and tvOS.

Features

  • iOS, tvOS, macOS.
  • 360° panorama video.
  • Compose complex asset.
  • Background playback.
  • RTMP/RTSP streaming.
  • Setting playback speed.
  • Multiple audio/video tracks.
  • H.264/H.265 hardware accelerator.
  • Accurate status notifications.
  • Thread safety.

Based On

  • FFmpeg
  • Metal
  • AudioToolbox

Requirements

  • iOS 13.0 or later
  • tvOS 13.0 or later
  • macOS 10.15 or later

Getting Started

Build FFmpeg and OpenSSL

  • Build scripts are used by default for FFmpeg 4.4.4 and OpenSSL 1.1.1w
git clone https://github.com/libobjc/SGPlayer.git
cd SGPlayer
git checkout 2.1.0 -B latest

// iOS
./build.sh iOS build

// tvOS
./build.sh tvOS build

// macOS
./build.sh macOS build

Open demo project in Xcode

  • Open demo/demo.xcworkspace. You can see simple use cases.

Check Dependencies

- SGPlayer.framework
- AVFoundation.framework
- AudioToolBox.framework
- VideoToolBox.framework
- libiconv.tbd
- libbz2.tbd
- libz.tbd

Flow Chart

Flow Chart

Author

Developed by Author

sgplayer's People

Contributors

chaocharleswang avatar libobjc 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  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

sgplayer's Issues

Memory issues on iPhone 5 ,iPhone 5s iOS 9

Hi libobjc, good work 👍
I find one issue.
I try SGPlayer today and It works perfectly on my iPhone 6 and iPhone 6s.
But when I install demo app on iPhone 5, 5s iOS 9 and play RTMP url, this app quickly received memory warning and app crashes, only crashes when play RTMP.
I switch to use HLS url, this app play video streaming ok.

RTSP video speed, frame rate

RTSP video plays faster, then buffering for 3 seconds. This is infinite loop.
How to make it play with normal speed?
How to change frame rate?

iOS/tvOS 11 beta4 ffmpeg crash

Great library, thanks for all the effort into it!

The ffmpeg player has been working great up until today when I upgraded from iOS & tvOS 11 beta 3 to beta 4. It now crashes on both iOS & tvOS (playing a server ts stream). The only error Xcode gives is 'Thread 1: EXC_BAD_ACCESS (code=2, address=0x194c50ad8)' pointing to main.m, even with 'All Exceptions' breakpoint enabled.

To double check, I ran the exact same build under beta 3 on iOS & it worked fine, I then upgraded the device to beta 4 & re-ran & it now crashes in the same way the tvOS build does.

A little bit of manual debugging seems to show its crashing when it goes to display the first frame (or around that time), possibly OpenGL/rendering related? Not sure if this is an iOS/tvOS beta issue (that Apple may fix in a future beta), or maybe a change in the api that SGPlayer will need updating to handle perhaps.

Any ideas/pointers on how to get this working would be really appreciated!
Thanks.

Thumb nails ?

How to generate thumb nails for a video ? using SGPlayer for non h264 video

How to play flv segments as a full video?

Some video source split the whole video to many flv segments, I tried merge it to a hls format m3u8 file, but it play failed with Error
"Error Domain=ffmpeg code : -541478725, ffmpeg msg : End of file Code=2 "(null)"

I see MPV provide an "edl protocol" to play segments like edl://f1.flv;f2.flv
Is there any similar solution for SGPlayer?

I tried merge to m3u8 format like below, but seems hls didn't accept flv video codec.
#EXTM3U
#EXT-X-VERSION:3
#EXT-X-ALLOW-CACHE:NO
#EXT-X-TARGETDURATION:400
#EXTINF:348.859,
http://samplesite/f1.flv
#EXTINF:381.301,
http://samplesite/f2.flv
#EXT-X-ENDLIST

Stream only audio?

Is it possible for a video streaming to disable video and have audio only?

有个问题请教

现在是调用 replaceVideoWithURL 就会自动缓冲,有没有办法来控制 不让他缓冲,比如用手机流量的时候,调用暂停好像也会缓冲,那样不是也废流量

MAC APP Store

Hi, when i use the FFMPEG library the certification report send me this issue :

private spi symbol(s) in framework: '/System/Library/Frameworks/Security.framework/Versions/A/Security'
+++ : SecIdentityCreate

The ffmpeg library for MACOS will be compile with this option
--disable-securetransport

Can you upgrade the zip file download at this url http://omw595ki7.bkt.clouddn.com/ffmpeg2

with this flag ?

Tnk's

请问如何嵌入自定义格式的实时流媒体视频播放?

我的音视频流媒体数据是通过tcp/udp从网络实时过来的(并不是本地文件或者http直播流),视频是h264的原始格式,但是是通过自定义格式包装后,实时发送过来的,现在我们的SGPlayer能够支持自定义流的播放么?或者要支持这样的数据播放,需要怎么做呢?谢谢

CocoaPods

能支持用CocoaPods来进行安装吗

Deinterlacing streams

Is is possible to enable deinterlacing options? If not, implementations of this option would be very helpfull! Thanks!

SGFFAudioDecoder类中的reloadAudioOuputInfo方法有笔误

  • (void)reloadAudioOuputInfo
    {
    if ([self.delegate respondsToSelector:@selector(audioDecoder:channelCount:)]) {
    [self.delegate audioDecoder:self samplingRate:&self->_samplingRate];
    }
    if ([self.delegate respondsToSelector:@selector(audioDecoder:samplingRate:)]) {
    [self.delegate audioDecoder:self channelCount:&self->_channelCount];
    }
    }
    这个方法里的代码是不是应该写成:
  • (void)reloadAudioOuputInfo
    {
    if ([self.delegate respondsToSelector:@selector(audioDecoder:channelCount:)]) {
    [self.delegate audioDecoder:self channelCount:&self->_channelCount];
    }
    if ([self.delegate respondsToSelector:@selector(audioDecoder:samplingRate:)]) {
    [self.delegate audioDecoder:self samplingRate:&self->_samplingRate];
    }
    }

编译失败

demo编译失败

Undefined symbols for architecture arm64:
"OBJC_IVAR$_SGFFAVYUVVideoFrame.channel_pixels", referenced from:
-[SGGLTextureYUV420 updateTextureWithGLFrame:aspect:] in SGPlayer(SGGLTextureYUV420.o)
"OBJC_CLASS$_SGFFAVYUVVideoFrame", referenced from:
objc-class-ref in SGPlayer(SGGLFrame.o)
"OBJC_CLASS$_SGFFCVYUVVideoFrame", referenced from:
objc-class-ref in SGPlayer(SGGLFrame.o)
"OBJC_CLASS$_SGFFPlayer", referenced from:
objc-class-ref in SGPlayer(SGPlayerImp.o)
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

概率性的编译失败 有时候可以 过一会就又不行了 好诡异

douyu live flv stream problem

using sgplayer mac to play douyu live flv stream on 13' retina mac pro 2015, the screen only show 1/4(left corner)
if connect to my display,it's working fine, show complete size.

update:
if not use the highest resolution the screen can't show completely,only 1/4 or less

fixed:
use hack way,
in SGGLViewController.m 220 line chage scale to 1 .like this CGFloat scale = 1;

播放本地视频, 如何获取预览图?

我在新的项目中使用到了SGPlayer, 很感谢作者开源这么好的项目, 我现在要实现预览功能, 快进的时候希望能过按时间获取截图, 用ios原生sdk可以获取到ios支持格式的视频图, 但是有没有办法通过ffmpeg来实现,因为ios的sdk没办法搞定原生不支持的编码格式, 作者是否有打算加入此功能,或者帮我提供一些思路.

Wrong variable type

Hi,

In file SGFFDecoder.m:

@property (nonatomic, assign) bool selectAudioTrackIndex;

selectAudioTrackIndex are not a bool but an integer.
Correct declaration:

@property (nonatomic, assign) int selectAudioTrackIndex;

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.