All Projects → xyqjay → m3u8ToMP4

xyqjay / m3u8ToMP4

Licence: other
iOS demo,avplayer play m3u8 .ts file

Programming Languages

swift
15916 projects
objective c
16641 projects - #2 most used programming language

Projects that are alternatives of or similar to m3u8ToMP4

Ezplayer
基于AVPlayer封装的视频播放器,功能丰富,快速集成,可定制性强,支持react-native。
Stars: ✭ 377 (+1613.64%)
Mutual labels:  m3u8, avplayer
MBVideoPlayer
A video player on top of AVQueuePlayer with custom header, playlist items, play, pause, seek to slider, time, resize to fullscreen, forward, backward horizontal, vertical capabilities.
Stars: ✭ 103 (+368.18%)
Mutual labels:  avplayer, swift5
Ios P2p Engine
Let your viewers become your unlimitedly scalable CDN.
Stars: ✭ 31 (+40.91%)
Mutual labels:  m3u8, avplayer
Bmplayer
A video player for iOS, based on AVPlayer, support the horizontal, vertical screen. support adjust volume, brightness and seek by slide, support subtitles.
Stars: ✭ 1,736 (+7790.91%)
Mutual labels:  avplayer, swift5
audioStreamDemo
A music player created in swift using AVPlayer to stream audio from server.
Stars: ✭ 33 (+50%)
Mutual labels:  avplayer, swift5
m3u8Downloader
meijuba.net,Python crawler,M3U8格式视频下载,桌面应用
Stars: ✭ 53 (+140.91%)
Mutual labels:  m3u8
YouTube to m3u
Grabs m3u from YouTube live.
Stars: ✭ 95 (+331.82%)
Mutual labels:  m3u8
Zee5
Just a simple shit but no one knows
Stars: ✭ 29 (+31.82%)
Mutual labels:  m3u8
iOS-SwiftUI-Firebase-Login-Example
Complete Sign up and Sign in Process for iOS SwiftUI - using Firebase Email and Password Authentication.
Stars: ✭ 37 (+68.18%)
Mutual labels:  swift5
JSONPreview
🎨 A view that previews JSON in highlighted form, it also provides the ability to format and collapse nodes.
Stars: ✭ 21 (-4.55%)
Mutual labels:  swift5
Combinative
UI event handling using Apple's combine framework.
Stars: ✭ 106 (+381.82%)
Mutual labels:  swift5
m3u8-downloader
Download the ts files according to the given m3u8 file.
Stars: ✭ 21 (-4.55%)
Mutual labels:  m3u8
SwiftRadix
Easily convert integers to binary/hex/octal strings and back again with clean functional syntax.
Stars: ✭ 34 (+54.55%)
Mutual labels:  swift5
TinyRage
Flappy Bird for WatchOS 6+ written in swift 5 using spriteKit
Stars: ✭ 23 (+4.55%)
Mutual labels:  swift5
SwiftTTPageController
最常见的标签控制器,仿今日头条首页、网易新闻首页 ,实现多个ViewController列表切换(更新适配Swift5)
Stars: ✭ 26 (+18.18%)
Mutual labels:  swift5
SwiftQRCodeScanner
An easy QR code reader for iOS written in Swift
Stars: ✭ 49 (+122.73%)
Mutual labels:  swift5
MMActionSheet
An actionSheet view implement with pure swift
Stars: ✭ 25 (+13.64%)
Mutual labels:  swift5
DPVideoMerger-Swift
Multiple videos merge in one video with manage scale & aspect ratio and also merge videos to grid matrix layout for Swift.
Stars: ✭ 49 (+122.73%)
Mutual labels:  swift5
m3u8
m3u8 file downloader library and chrome & firefox extensions/add-on's
Stars: ✭ 67 (+204.55%)
Mutual labels:  m3u8
SwiftUI-App
This swiftUI Demo is very simple & easy to understand. This swiftUI demo includes On-boarding screens, login screen, forgot password screen, sign up screen, home & logout.
Stars: ✭ 175 (+695.45%)
Mutual labels:  swift5

m3u8ToMP4

Swift 5.1 GitHub地址

  • 这个Demo暂时 DEMO里第一个Controller是简单的使用AVFoundation.FrameWork拼接视频
  • 第二个Controller里是AVPlayerItem无缝切换播放两段视频 2016-01-29 11:00:19
  • 第三个controller是本地起个轻量级服务器来播放m3u8视频 2016-01-29 11:00:37

###最近在研究m3u8的播放和缓存,所以工程名称是m3u8ToMP4

M3U8文件是指UTF-8编码格式的M3U文件。M3U文件是记录了一个索引纯文本文件,打开它时播放软件并不是播放它,而是根据它的索引找到对应的音视频文件的网络地址进行在线播放。

在线播放这块,视频格式被支持的话 AVPlayer是可以直接播放的。

缓存这块,只能拿到索引,把音视频一个一个下载下来,并且把索引也保存起来。但是下载后的视频(传个本地m3u8 URL)是无法播放的,对于播放缓存视频,这里我想到了三种解决方案: ####1、视频拼接 把下载下来的视频片段拼接起来,这个Demo就是MP4的拼接。 ####2、本地搭建服务器 使用CocoaHTTPServer在本地搭建个服务器,把M3U8内的视频索引换为本地相对路径。这个Demo还没有出,以后有空实验下。 这个已经测试成功,在Demo里的第三个Controller。2016-01-29 11:01:45 ####3、拿到本地缓存的视频片段挨个播放 AVPlayerItem,一个视频对应一个item同时创建两个item来回切换着播放,[AVQueuePlayer insertItem:afterItem:]这样应该可以做无缝切换视频,还没有试验。Demo暂时还没 刚刚测试,这样切换播放两段视频可以无缝切换,请看Demo里第二个Controller 2016-01-27 18:32:10 这样方案1、2都没有多大必要了。方案1的好处是可以拼接一个完整的视频出来。

AVFoundation.FrameWork非常强大,除了音视频播放外,
还有音频、视频的拼接、剪切功能,视频的音频提取等功能,
有兴趣的可以深入研究。

这里有一个高端的视频拼接方案 拥有多种视频拼接方法: 上下拼接,左右拼接, 上上下下/左左右右式拼接。 感兴趣的自己看 Github地址

###最近在土豆上看到了一个非常棒的纪录片 在用土豆APP缓存视频的时候产生了一个想法:

把这个缓存的视频提取出来,做收藏用。

但是用iTools把资源导出来后我傻眼了,它缓存的是m3u8文件,每一个视频段都是.ts结尾的,每段10s左右,一集有200多个ts文件,在Mac上使用QuickTime能正常使用,我就想是不是iOS也支持,写个Demo把他们拼接起来。

之前做过的项目有音频拼接,最近正好在学习swift,就干脆动手,用swift写一个视频拼接的Demo。

PS. 最近好忙。。。“最近”好忙
(*>.<*)。到底是“最近”好忙,还是我好忙,这是个问题( *_* ) 

后来写Demo时发现iOS的AVPlayer不支持这个ts,也没法拼接视频文件(ps.既然QuickTime支持,可以考虑移植到Mac上试试。pps.我对音视频格式也没有过多的研究所以不知道原因。)

但是,Demo都写了,得让我验证下行不行啊,我在腾讯视频上下了一集芈月传,发现腾讯视频缓存下来的是mp4格式的视频段,每段有5分钟,正和我意。于是放到工程里做测试用。

当然,除了试试osx平台行不行,我还需要找找其他渠道有没有视频供我下载

###这么好的视频当然要分享出来了 传送门:宇宙:时空之旅

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].